@Singleton public class Stage extends Object implements Startable, ActorRuntime, RuntimeActions
| Modifier and Type | Class and Description |
|---|---|
static class |
Stage.Builder |
static class |
Stage.StageMode |
| Constructor and Description |
|---|
Stage() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetAllExtensions, getFirstExtension, getRuntime, setRuntimegetReference, getRemoteObserverReference, getStream, registerObserver, setRuntimegetInvoker, getInvoker, getReferencegetObserverReference, pingpublic void addStickyHeaders(Collection<String> stickyHeaders)
public void setClock(Clock clock)
public void setMessaging(Messaging messaging)
public void setInvocationHandler(InvocationHandler invocationHandler)
public void setExecutionPool(ExecutorService executionPool)
public ExecutorService getExecutionPool()
public int getExecutionPoolSize()
public void setExecutionPoolSize(int defaultPoolSize)
public void setLocalAddressCacheMaximumSize(int localAddressCacheMaximumSize)
public Execution getExecution()
public void setExecution(Execution execution)
public void setLocalObjectsCleaner(LocalObjectsCleaner localObjectsCleaner)
public LocalObjectsCleaner getLocalObjectsCleaner()
public ExecutionObjectCloner getObjectCloner()
public void setMessageLoopbackObjectCloner(ExecutionObjectCloner messageLoopbackObjectCloner)
public void setObjectCloner(ExecutionObjectCloner objectCloner)
public long getLocalObjectCount()
public String getClusterName()
public void setClusterName(String clusterName)
public String getPlacementGroup()
public void setPlacementGroup(String placementGroup)
public String getNodeName()
public void setNodeName(String nodeName)
public Stage.StageMode getMode()
public void setMode(Stage.StageMode mode)
public void setTimer(Timer timer)
public void setConcurrentDeactivations(int concurrentDeactivations)
public void setDefaultActorTTL(long defaultActorTTLMs)
public void setLocalAddressCacheTTL(long localAddressCacheTTL)
public void setNumReminderControllers(int numReminderControllers)
public void setDeactivationTimeout(long deactivationTimeoutMs)
public boolean getBroadcastActorDeactivations()
public void setBroadcastActorDeactivations(boolean broadcastActorDeactivation)
public void setEnableShutdownHook(boolean enableShutdownHook)
public void setEnableMessageLoopback(boolean enableMessageLoopback)
public void setFlushPlacementGroupCache(boolean flushPlacementGroupCache)
public boolean getFlushPlacementGroupCache()
public void setClusterPeer(ClusterPeer clusterPeer)
public void addExtension(ActorExtension extension)
Example:
stage.addExtension(new MongoDbProvider(...));
extension - Actor Extensions instance.public Hosting getHosting()
public ClusterPeer getClusterPeer()
public Task pulse()
public Task cleanup()
public void bind()
An ungrounded reference is a reference created with Actor.getRemoteReference and used outside of an actor method.
This is only necessary when there are two or more OrbitStages active in the same virtual machine and remote calls need to be issued from outside an actor. This method was created to help with test cases.
A normal application will have a single stage and should have no reason to call this method.
This method writes a weak reference to the runtime in a thread local. No cleanup is necessary, so none is available.
bind in interface ActorRuntimebind in interface BasicRuntimepublic List<NodeAddress> getAllNodes()
getAllNodes in interface ActorRuntimepublic List<NodeAddress> getServerNodes()
public NodeCapabilities.NodeState getState()
public ActorRuntime getRuntime()
public MessageSerializer getMessageSerializer()
public void setMessageSerializer(MessageSerializer messageSerializer)
public Task<?> invoke(RemoteReference toReference, Method m, boolean oneWay, int methodId, Object[] params)
invoke in interface BasicRuntimepublic Registration registerTimer(AbstractActor<?> actor, Callable<Task<?>> taskCallable, long dueTime, long period, TimeUnit timeUnit)
registerTimer in interface ActorRuntimepublic Clock clock()
clock in interface BasicRuntimepublic Task<?> registerReminder(Remindable actor, String reminderName, long dueTime, long period, TimeUnit timeUnit)
registerReminder in interface ActorRuntimepublic Task<?> unregisterReminder(Remindable actor, String reminderName)
unregisterReminder in interface ActorRuntimepublic String runtimeIdentity()
runtimeIdentity in interface ActorRuntimepublic Task<NodeAddress> locateActor(Addressable actorReference, boolean forceActivation)
locateActor in interface ActorRuntimepublic NodeAddress getLocalAddress()
getLocalAddress in interface ActorRuntimepublic <T extends ActorObserver> T registerObserver(Class<T> iClass, String id, T observer)
registerObserver in interface BasicRuntimepublic <T> T getReference(BasicRuntime runtime, NodeAddress address, Class<T> iClass, Object id)
getReference in interface DescriptorFactorypublic StreamProvider getStreamProvider(String providerName)
getStreamProvider in interface ActorRuntimepublic <T> AsyncStream<T> getStream(String provider, Class<T> dataClass, String id)
getStream in interface BasicRuntimepublic List<ActorExtension> getExtensions()
getExtensions in interface ActorRuntimepublic Task deactivateActor(Actor actor)
deactivateActor in interface RuntimeActionspublic Task<Long> getActorCount()
getActorCount in interface RuntimeActionspublic <T extends ActorExtension> T getStorageExtensionFor(Class actorClass)
public boolean canActivateActor(String interfaceName)
public Pipeline getPipeline()
public org.slf4j.Logger getLogger(Object object)
getLogger in interface BasicRuntimeCopyright © 2019 Electronic Arts Inc. All rights reserved.