public abstract class RemoteRegistry extends Object implements RemoteConnection
| Modifier and Type | Field and Description |
|---|---|
protected AtomicLong |
actorIdCount |
protected org.nustaq.serialization.FSTConfiguration |
conf |
protected Consumer<Actor> |
disconnectHandler |
protected boolean |
isObsolete |
static int |
MAX_BATCH_CALLS |
static Object |
OUT_OF_ORDER_SEQ |
protected ConcurrentHashMap<Long,Object> |
publishedActorMapping |
protected ConcurrentHashMap<Object,Long> |
publishedActorMappingReverse |
protected ConcurrentLinkedQueue<Actor> |
remoteActors |
protected ConcurrentHashMap<Long,Actor> |
remoteActorSet |
protected BiFunction<Actor,String,Boolean> |
remoteCallInterceptor |
static BiFunction |
remoteCallMapper |
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 (virtual) connection close
|
void |
close()
closes the underlying connection (Warning: may side effect to other actors published on this connection)
|
IPromise |
closeNetwork()
closes underlying network connection also.
|
protected void |
closeRef(CallEntry ce,
ObjectSocket chan) |
protected void |
configureSerialization(Coding code) |
void |
disconnect()
called from ObjectSocket in case of disconnect (decoding errors or network issues)
|
void |
forwardRemoteMessage(RemoteCallEntry rce) |
org.nustaq.serialization.FSTConfiguration |
getConf() |
Consumer<Actor> |
getDisconnectHandler() |
Actor |
getFacadeActor() |
abstract Actor |
getFacadeProxy() |
Actor |
getPublishedActor(long id) |
Callback |
getPublishedCallback(long id) |
ConcurrentLinkedQueue<Actor> |
getRemoteActors() |
int |
getRemoteActorSize() |
BiFunction<Actor,String,Boolean> |
getRemoteCallInterceptor() |
long |
getRemoteId(Actor act) |
RemoteScheduler |
getScheduler() |
ActorServer |
getServer() |
ObjectSocket |
getSocketRef() |
abstract AtomicReference<ObjectSocket> |
getWriteObjectSocket() |
boolean |
isObsolete() |
boolean |
isTerminated() |
boolean |
pollAndSend2Remote(AtomicReference<ObjectSocket> chanHolder)
poll remote actor proxies and send.
|
protected boolean |
processRemoteCallEntry(ObjectSocket objSocket,
RemoteCallEntry response,
List<IPromise> createdFutures,
Object authContext) |
long |
publishActor(Actor act) |
void |
receiveCBResult(ObjectSocket chan,
long id,
Object result,
Object error) |
boolean |
receiveObject(ObjectSocket responseChannel,
ObjectSink receiver,
Object response,
List<IPromise> createdFutures,
Object authContext)
process a remote call entry or an array of remote call entries.
|
static void |
registerDefaultClassMappings(org.nustaq.serialization.FSTConfiguration conf) |
long |
registerPublishedCallback(Callback cb) |
Actor |
registerRemoteActorRef(Class actorClazz,
long remoteId,
Object client) |
void |
registerRemoteRefDirect(Actor act) |
protected void |
remoteRefStopped(Actor actor)
warning: MThreaded
|
void |
removePublishedObject(long receiverKey) |
protected void |
removeRemoteActor(Actor act) |
void |
setClassLoader(ClassLoader l) |
void |
setDisconnectHandler(Consumer<Actor> disconnectHandler) |
void |
setFacadeActor(Actor facadeActor) |
void |
setIsObsolete(boolean isObsolete)
give the application a way to explecitely flag a connection as obsolete
|
void |
setServer(ActorServer server) |
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
public static BiFunction remoteCallMapper
protected org.nustaq.serialization.FSTConfiguration conf
protected RemoteScheduler scheduler
protected AtomicLong actorIdCount
protected ConcurrentHashMap<Long,Object> publishedActorMapping
protected ConcurrentHashMap<Object,Long> publishedActorMappingReverse
protected ConcurrentLinkedQueue<Actor> remoteActors
protected ConcurrentHashMap<Long,Actor> remoteActorSet
protected volatile boolean terminated
protected BiFunction<Actor,String,Boolean> remoteCallInterceptor
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 BiFunction<Actor,String,Boolean> getRemoteCallInterceptor()
protected void configureSerialization(Coding code)
public Actor getPublishedActor(long id)
public Callback getPublishedCallback(long id)
public RemoteScheduler getScheduler()
public ConcurrentLinkedQueue<Actor> getRemoteActors()
public boolean isTerminated()
public void setTerminated(boolean terminated)
public long publishActor(Actor act)
public void unpublishActor(Actor act)
unpublishActor in interface RemoteConnectionact - public long registerPublishedCallback(Callback cb)
public void removePublishedObject(long receiverKey)
public void registerRemoteRefDirect(Actor act)
public Actor registerRemoteActorRef(Class actorClazz, long 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, Object authContext) throws Exception
responseChannel - - writer required to route callback messagesresponse - createdFutures - - can be null. Contains futures created by the submitted callsequenceauthContext - Exceptionprotected boolean processRemoteCallEntry(ObjectSocket objSocket, RemoteCallEntry response, List<IPromise> createdFutures, Object authContext) throws Exception
Exceptionpublic void cleanUp()
public void disconnect()
protected void closeRef(CallEntry ce, ObjectSocket chan) throws IOException
IOExceptionprotected void writeObject(ObjectSocket chan, RemoteCallEntry rce) throws Exception
Exceptionpublic void receiveCBResult(ObjectSocket chan, long 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 setClassLoader(ClassLoader l)
setClassLoader in interface RemoteConnectionpublic long getRemoteId(Actor act)
getRemoteId in interface RemoteConnectionpublic boolean pollAndSend2Remote(AtomicReference<ObjectSocket> chanHolder) throws Exception
chanHolder - Exceptionpublic void forwardRemoteMessage(RemoteCallEntry rce)
public abstract AtomicReference<ObjectSocket> getWriteObjectSocket()
public ObjectSocket getSocketRef()
getSocketRef in interface RemoteConnectionpublic boolean isObsolete()
public void setIsObsolete(boolean isObsolete)
public int getRemoteActorSize()
public void setFacadeActor(Actor facadeActor)
public Actor getFacadeActor()
public void setServer(ActorServer server)
public ActorServer getServer()
public IPromise closeNetwork()
RemoteConnectioncloseNetwork in interface RemoteConnectionCopyright © 2017. All rights reserved.