Interface IIActorRefAware
public interface IIActorRefAware
Interface for actors that need access to their own IIActorRef.
When a class implements this interface and is loaded as a plugin via
DynamicActorLoaderActor, the actor's own IIActorRef will be injected
after construction, allowing the plugin to access its children and other
actor-level information.
Example usage in a plugin:
public class MyPlugin implements CallableByActionName, IIActorRefAware {
private IIActorRef<?> selfRef;
@Override
public void setIIActorRef(IIActorRef<?> actorRef) {
this.selfRef = actorRef;
}
public void processChildren() {
// Can now access children
Set<String> childNames = selfRef.getNamesOfChildren();
for (String childName : childNames) {
// Process each child...
}
}
}
- Since:
- 2.16.0
- Author:
- devteam@scivicslab.com
-
Method Summary
Modifier and TypeMethodDescriptionvoidsetIIActorRef(IIActorRef<?> actorRef) Sets the actor's own IIActorRef.
-
Method Details
-
setIIActorRef
Sets the actor's own IIActorRef.This method is called automatically by
DynamicActorLoaderActorafter the plugin's IIActorRef is created, if the plugin implements this interface.- Parameters:
actorRef- the IIActorRef wrapping this plugin
-