|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsds.DistributedObject
public abstract class DistributedObject
Defines generic distributed objects manipulated by SDS
Constructor Summary | |
---|---|
DistributedObject()
Creates a non-initialized distributed object along with no associated manager and a default produced reference |
Method Summary | |
---|---|
static Reference |
createReference()
|
java.util.Collection<Reference> |
deliver(Message msg,
boolean block,
java.util.Collection<Reference> recipients)
Message delivery to recipients |
java.util.Collection<Reference> |
deliver(Message msg,
boolean block,
Reference... recipients)
Message delivery to recipients |
sds.ResponseInfo |
getExpectedResponseInfo(java.lang.Long id)
|
Reference |
getManager()
Gets the reference of the manager which sent this distributed object to the local daemon |
Reference |
getReference()
Gets the reference of this distributed object |
void |
run(int port)
Executes this distributed object as a normal server (not a daemon). |
abstract void |
run(int port,
boolean daemon)
Executes this distributed object as a server. |
abstract boolean |
runsAsServer()
Indicated whether this distributed object is a server (or an intermediary) or a client |
void |
setDefaultReference()
|
void |
setManager(Reference manager)
To be used by a daemon to set the manager associated with this distributed object |
void |
setReference(Reference reference)
|
abstract void |
terminate()
Called by the hosting daemon when asked (by a manager) to kill its running distributed objects. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DistributedObject()
Creates a non-initialized distributed object along with no associated manager and a default produced reference
Method Detail |
---|
public final sds.ResponseInfo getExpectedResponseInfo(java.lang.Long id)
public final void setManager(Reference manager)
To be used by a daemon to set the manager associated with this distributed object
manager
- the manager which called the local daemon to activate this
distributed object. Setting null indicates that ths
distributed object is not associated with any managerpublic final Reference getManager()
Gets the reference of the manager which sent this distributed object to the local daemon
public final void setDefaultReference()
public static final Reference createReference()
public final void setReference(Reference reference)
public final Reference getReference()
Gets the reference of this distributed object
public abstract boolean runsAsServer()
Indicated whether this distributed object is a server (or an intermediary) or a client
public abstract void run(int port, boolean daemon) throws SdsException
Executes this distributed object as a server. This operation must be
non-blocking. A default reference is created if not initialized before (getReference()
returns null)
port
- the port to be used by this distributed object when running
as a serverdaemon
- tells this server to run as a daemon or a normal server
SdsException
- raised if the port is already reserved or when this
distributed object has no server abilitypublic final void run(int port) throws SdsException
Executes this distributed object as a normal server (not a daemon). This
operation must be non-blocking. A default reference is created if not
initialized before (getReference()
returns null)
port
- the port to be used by this distributed object when running
as a server
SdsException
- raised if the port is already reserved or when this
distributed object has no server abilityrun(int, boolean)
public final java.util.Collection<Reference> deliver(Message msg, boolean block, Reference... recipients)
Message delivery to recipients
msg
- the message to deliverblock
- true if this delivery operation waits for all
messages to be sent and corresponding responses to be receivedrecipients
- The list of recipients to receive the message
public final java.util.Collection<Reference> deliver(Message msg, boolean block, java.util.Collection<Reference> recipients)
Message delivery to recipients
msg
- the message to deliverblock
- true if this delivery operation waits for all
messages to be sent and correspondingrecipients
- the collection of recipients to receive the message
public abstract void terminate()
Called by the hosting daemon when asked (by a manager) to kill its running distributed objects. Allows to perform tasks before an effective closing (along with this distributed object's unregistration from its local daemon)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |