public abstract class RemoteRegistry extends Object implements RemoteConnection
| Modifier and Type | Field and Description |
|---|---|
protected AtomicInteger |
actorIdCount |
protected org.nustaq.serialization.FSTConfiguration |
conf |
protected java.util.function.Consumer<Actor> |
disconnectHandler |
protected boolean |
isObsolete |
static int |
MAX_BATCH_CALLS |
static Object |
OUT_OF_ORDER_SEQ |
protected ConcurrentHashMap<Integer,Object> |
publishedActorMapping |
protected ConcurrentHashMap<Object,Integer> |
publishedActorMappingReverse |
protected ConcurrentLinkedQueue<Actor> |
remoteActors |
protected ConcurrentHashMap<Integer,Actor> |
remoteActorSet |
protected java.util.function.BiFunction<Actor,String,Boolean> |
remoteCallInterceptor |
protected RemoteScheduler |
scheduler |
protected boolean |
terminated |
| Constructor and Description |
|---|
RemoteRegistry(Coding code) |
RemoteRegistry(org.nustaq.serialization.FSTConfiguration conf,
Coding coding) |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanUp()
cleanup after connection close
|
void |
close()
closes the underlying connection (Warning: may side effect to other actors published on this connection)
|
protected void |
closeRef(CallEntry ce,
ObjectSocket chan) |
protected void |
configureSerialization(Coding code) |
org.nustaq.serialization.FSTConfiguration |
getConf() |
java.util.function.Consumer<Actor> |
getDisconnectHandler() |
Actor |
getFacadeActor() |
abstract Actor |
getFacadeProxy() |
Actor |
getPublishedActor(int id) |
Callback |
getPublishedCallback(int id) |
ConcurrentLinkedQueue<Actor> |
getRemoteActors() |
int |
getRemoteActorSize() |
java.util.function.BiFunction<Actor,String,Boolean> |
getRemoteCallInterceptor() |
int |
getRemoteId(Actor act) |
RemoteScheduler |
getScheduler() |
abstract AtomicReference<ObjectSocket> |
getWriteObjectSocket() |
boolean |
isObsolete() |
boolean |
isTerminated() |
boolean |
pollAndSend2Remote(ObjectSocket chan)
poll remote actor proxies and send.
|
protected boolean |
processRemoteCallEntry(ObjectSocket objSocket,
RemoteCallEntry response,
List<IPromise> createdFutures) |
int |
publishActor(Actor act) |
void |
receiveCBResult(ObjectSocket chan,
int id,
Object result,
Object error) |
boolean |
receiveObject(ObjectSocket responseChannel,
ObjectSink receiver,
Object response,
List<IPromise> createdFutures)
process a remote call entry or an array of remote call entries.
|
static void |
registerDefaultClassMappings(org.nustaq.serialization.FSTConfiguration conf) |
int |
registerPublishedCallback(Callback cb) |
Actor |
registerRemoteActorRef(Class actorClazz,
int remoteId,
Object client) |
void |
registerRemoteRefDirect(Actor act) |
protected void |
remoteRefStopped(Actor actor)
warning: MThreaded
|
void |
removePublishedObject(int receiverKey) |
protected void |
removeRemoteActor(Actor act) |
void |
setClassLoader(ClassLoader l) |
void |
setDisconnectHandler(java.util.function.Consumer<Actor> disconnectHandler) |
void |
setFacadeActor(Actor facadeActor) |
void |
setIsObsolete(boolean isObsolete)
give the application a way to explecitely flag a connection as obsolete
|
void |
setRemoteCallInterceptor(java.util.function.BiFunction<Actor,String,Boolean> remoteCallInterceptor) |
void |
setTerminated(boolean terminated) |
void |
stopRemoteRefs() |
void |
unpublishActor(Actor act)
remove current
|
protected void |
writeObject(ObjectSocket chan,
RemoteCallEntry rce) |
public static final Object OUT_OF_ORDER_SEQ
public static int MAX_BATCH_CALLS
protected org.nustaq.serialization.FSTConfiguration conf
protected RemoteScheduler scheduler
protected AtomicInteger actorIdCount
protected ConcurrentHashMap<Integer,Object> publishedActorMapping
protected ConcurrentHashMap<Object,Integer> publishedActorMappingReverse
protected ConcurrentLinkedQueue<Actor> remoteActors
protected ConcurrentHashMap<Integer,Actor> remoteActorSet
protected volatile boolean terminated
protected java.util.function.BiFunction<Actor,String,Boolean> remoteCallInterceptor
protected java.util.function.Consumer<Actor> disconnectHandler
protected boolean isObsolete
public RemoteRegistry(org.nustaq.serialization.FSTConfiguration conf,
Coding coding)
public RemoteRegistry(Coding code)
public static void registerDefaultClassMappings(org.nustaq.serialization.FSTConfiguration conf)
public java.util.function.BiFunction<Actor,String,Boolean> getRemoteCallInterceptor()
public void setRemoteCallInterceptor(java.util.function.BiFunction<Actor,String,Boolean> remoteCallInterceptor)
protected void configureSerialization(Coding code)
public Actor getPublishedActor(int id)
public Callback getPublishedCallback(int id)
public RemoteScheduler getScheduler()
public ConcurrentLinkedQueue<Actor> getRemoteActors()
public boolean isTerminated()
public void setTerminated(boolean terminated)
public int publishActor(Actor act)
public void unpublishActor(Actor act)
unpublishActor in interface RemoteConnectionact - public int registerPublishedCallback(Callback cb)
public void removePublishedObject(int receiverKey)
public void registerRemoteRefDirect(Actor act)
public Actor registerRemoteActorRef(Class actorClazz, int remoteId, Object client)
protected void remoteRefStopped(Actor actor)
actor - public void stopRemoteRefs()
protected void removeRemoteActor(Actor act)
public boolean receiveObject(ObjectSocket responseChannel, ObjectSink receiver, Object response, List<IPromise> createdFutures) throws Exception
responseChannel - - writer required to route callback messagesresponse - createdFutures - - can be null. Contains futures created by the submitted callsequenceExceptionprotected boolean processRemoteCallEntry(ObjectSocket objSocket, RemoteCallEntry response, List<IPromise> createdFutures) throws Exception
Exceptionpublic void cleanUp()
protected void closeRef(CallEntry ce, ObjectSocket chan) throws IOException
IOExceptionprotected void writeObject(ObjectSocket chan, RemoteCallEntry rce) throws Exception
Exceptionpublic void receiveCBResult(ObjectSocket chan, int id, Object result, Object error) throws Exception
Exceptionpublic void close()
RemoteConnectionclose in interface RemoteConnectionpublic org.nustaq.serialization.FSTConfiguration getConf()
public abstract Actor getFacadeProxy()
public void setDisconnectHandler(java.util.function.Consumer<Actor> disconnectHandler)
public java.util.function.Consumer<Actor> getDisconnectHandler()
public void setClassLoader(ClassLoader l)
setClassLoader in interface RemoteConnectionpublic int getRemoteId(Actor act)
getRemoteId in interface RemoteConnectionpublic boolean pollAndSend2Remote(ObjectSocket chan) throws Exception
chan - Exceptionpublic abstract AtomicReference<ObjectSocket> getWriteObjectSocket()
public boolean isObsolete()
public void setIsObsolete(boolean isObsolete)
public int getRemoteActorSize()
public void setFacadeActor(Actor facadeActor)
public Actor getFacadeActor()
Copyright © 2015. All rights reserved.