public class RemoteServerImpl extends AbstractRemote implements RemoteServer
RemoteServer's base functionality.| Modifier and Type | Class and Description |
|---|---|
protected static class |
RemoteServerImpl.MethodReplyJobFactoryImpl
Implementation of the
TypedRecyclingFactory creating instances of
the according type. |
protected static class |
RemoteServerImpl.PublishProxyJobFactoryImpl
Implementation of the
TypedRecyclingFactory creating instances of
the according type. |
protected static class |
RemoteServerImpl.SignOffJobFactoryImpl
Implementation of the
TypedRecyclingFactory creating instances of
the according type. |
AbstractRemote.CancelMethodReplyJobFactoryImpl, AbstractRemote.JobDigesterDaemonFactoryImpl, AbstractRemote.PublishSubjectReplyJobFactoryImplorg.refcodes.component.mixins.Destroyable.DestroyAutomatonorg.refcodes.component.ConnectableComponent.ConnectableAutomatonorg.refcodes.component.ConnectionComponent.ConnectionAutomaton<CON>org.refcodes.component.mixins.ConnectionOpenable.ConnectionOpenAutomaton<CON>org.refcodes.component.mixins.OpenedAccessor.OpenedMutator, org.refcodes.component.mixins.OpenedAccessor.OpenedPropertyorg.refcodes.component.mixins.Closable.CloseAutomatonorg.refcodes.component.mixins.ClosedAccessor.ClosedMutator, org.refcodes.component.mixins.ClosedAccessor.ClosedProperty| Constructor and Description |
|---|
RemoteServerImpl() |
RemoteServerImpl(ExecutorService aExecutorService) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
void |
close() |
protected void |
close(CloseConnectionMessage aJob)
Takes care of closing the
RemoteServer depending on the
CloseConnectionMessage received from the RemoteClient
counterpart. |
void |
destroy() |
void |
digest(Message aJob)
The
AbstractRemote.digest(Message) method is invoked in order to trigger
processing of the provided Message, e.g. start execution
depending on the Message instance being provided from the
outside. |
protected void |
doSendJob(Message aJob)
For testing purposes, any job can be manually pushed into the job process
to the receiver.
|
boolean |
hasSubject(Object obj)
Returns true if the provided subject is contained inside this
RemoteServer. |
boolean |
isBusy()
-------------------------------------------------------------------------
TODO: Enhance the
isBusy() method, e.g. are there any threads
active? |
boolean |
isEmpty() |
protected void |
onSubjectPublished(Object aSubject)
Hook when a subject has been published.
|
protected void |
onSubjectSignedOff(Object aSubject)
Hook when a subject has been signed-off.
|
boolean |
publishSubject(Object aSubject)
Publishes an object to any
RemoteClient connected to the
RemoteServer. |
boolean |
signOffSubject(Object aSubject)
Tries to sign off the (previously published) subject, this can be vetoed
in case the subject is still in use by a
RemoteClient. |
boolean |
signOffSubject(Object aSubject,
int aTimeoutInMs)
Signs off the (previously published) subject, this be vetoed even in case
the subject is still in use by a
RemoteClient, but the veto will
only delay the sign off by the given timeout. |
int |
size() |
Iterator<Object> |
subjects()
Returns an (immutable) iterator containing all the proxy objects
previously being published.
|
fromSender, getExecutorService, isDestroyed, isOpenable, onClosed, onOpened, open, toReceivergetConnectionStatus, isClosable, isClosed, isOpenable, isOpened, open, setConnectionStatusclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic RemoteServerImpl()
public RemoteServerImpl(ExecutorService aExecutorService)
public void clear()
clear in interface org.refcodes.collection.mixins.Clearablepublic void close()
close in interface org.refcodes.component.mixins.Closableclose in class AbstractRemotepublic boolean isBusy()
isBusy() method, e.g. are there any threads
active?
-------------------------------------------------------------------------isBusy in interface org.refcodes.mixin.mixins.BusyAccessorpublic boolean hasSubject(Object obj)
RemoteServer.hasSubject in interface RemoteServerobj - The subject to be tested if it is contained inside the
RemoteServer.RemoteServer.public Iterator<Object> subjects()
RemoteServer.signOffSubject(Object)
method in order to remove a published subject.subjects in interface RemoteServerpublic boolean isEmpty()
isEmpty in interface org.refcodes.collection.mixins.Containablepublic boolean publishSubject(Object aSubject) throws org.refcodes.component.traps.OpenException
RemoteClient connected to the
RemoteServer.publishSubject in interface RemoteServeraSubject - A subject being published for inter-process communication
such as remote procedure calls or remote method invocations.org.refcodes.component.traps.OpenException - Thrown in case opening or accessing an open line
(connection, junction, link) caused problems.public boolean signOffSubject(Object aSubject) throws org.refcodes.component.traps.OpenException, org.refcodes.exception.traps.VetoException
RemoteClient.signOffSubject in interface RemoteServeraSubject - Description is currently not available!RemoteClient threw a VetoException then the
sign-off is aborted.org.refcodes.component.traps.OpenException - Thrown in case opening or accessing an open line
(connection, junction, link) caused problems.org.refcodes.exception.traps.VetoExceptionpublic boolean signOffSubject(Object aSubject, int aTimeoutInMs) throws org.refcodes.component.traps.OpenException
RemoteClient, but the veto will
only delay the sign off by the given timeout.signOffSubject in interface RemoteServeraSubject - The subject to be signed off.aTimeoutInMs - The timeout to be granted in case the sign-off has
been vetoed, nevertheless the subject will be signed off after the
timeout elapsed.RemoteClient threw a VetoException then the
sign-off is aborted.org.refcodes.component.traps.OpenException - Thrown in case opening or accessing an open line
(connection, junction, link) caused problems.public int size()
size in interface org.refcodes.collection.mixins.Containablepublic void destroy()
destroy in interface org.refcodes.component.mixins.Destroyabledestroy in class AbstractRemoteprotected void doSendJob(Message aJob) throws org.refcodes.component.traps.OpenException
aJob - The job to be pushed to the receiver.org.refcodes.component.traps.OpenException - Thrown in case the operation failed due to an I/O
malfunction such as the input- or output-connection (of an input-
and output-connection pair) is not available or being
disconnected.public void digest(Message aJob) throws org.refcodes.component.traps.DigestException
AbstractRemoteAbstractRemote.digest(Message) method is invoked in order to trigger
processing of the provided Message, e.g. start execution
depending on the Message instance being provided from the
outside. A RemoteClient digests such a Message different
than a RemoteServer.
This method is inspired by the Digester.digest(Object) method.digest in class AbstractRemoteaJob - The Message to be digested.org.refcodes.component.traps.DigestException - Thrown in case digesting (processing) a job by a
Digester.digest(Object) caused problems; the cause is
usually wrapped by this Exception.Digesterprotected void close(CloseConnectionMessage aJob)
RemoteServer depending on the
CloseConnectionMessage received from the RemoteClient
counterpart. In case a RemoteServer manages a one-to-many
connection to different RemoteClient instances, then the
CloseConnectionMessage provides meta data on which
RemoteClient connection to close.
By default just close() is being invoked as if having a
one-to-one connection.close in class AbstractRemoteaJob - The CloseConnectionMessage providing additional
information on which RemoteClient connection to close.protected void onSubjectPublished(Object aSubject)
aSubject - The subject being published.protected void onSubjectSignedOff(Object aSubject)
aSubject - The subject which has been signed-off.Copyright © 2015. All rights reserved.