|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsds.DistributedObject
sds.DistributedServerObject
sds.service.Daemon
public final class Daemon
Server-oriented distributed object to be started on each distant host which
participates to the distributed system. It receives distributed objects sent
by a Manager
and manages their life cycle (from load and activation
to destruction)
DistributedObject
Field Summary | |
---|---|
static long |
DEFAULT_FIRST_ID
Default identifier (= 0) for loaded distributed objects |
static int |
NO_MAX_PORT
Indicates that this daemon can load and run server-oriented distributed objects without taking care of available ports numbers |
Constructor Summary | |
---|---|
Daemon(boolean requiresSignature,
int minPort,
int maxPort,
long firstId)
|
Method Summary | |
---|---|
void |
execute()
Defines this server's default behaviour (i.e. while not receiving messages from other distributed objects) |
int |
getMaxPort()
|
int |
getMinPort()
|
boolean |
hasMaxPort()
|
void |
processError(SdsException e)
Automatically called when DistributedServerObject.receive(Message) returns
false or when an SdsException while
processing an incoming request
|
boolean |
receive(Message msg)
Defines the server behavior when a message is received |
void |
terminateServer()
Automatically called by DistributedServerObject.terminate()
|
Methods inherited from class sds.DistributedServerObject |
---|
isSignatureRequired, run, runsAsServer, terminate |
Methods inherited from class sds.DistributedObject |
---|
createReference, deliver, deliver, getExpectedResponseInfo, getManager, getReference, run, setDefaultReference, setManager, setReference |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long DEFAULT_FIRST_ID
public static final int NO_MAX_PORT
Constructor Detail |
---|
public Daemon(boolean requiresSignature, int minPort, int maxPort, long firstId)
Method Detail |
---|
public int getMinPort()
public int getMaxPort()
public boolean hasMaxPort()
public void execute()
DistributedServerObject
Defines this server's default behaviour (i.e. while not receiving messages from other distributed objects)
execute
in class DistributedServerObject
public void processError(SdsException e)
DistributedServerObject
Automatically called when DistributedServerObject.receive(Message)
returns
false or when an SdsException
while
processing an incoming request
processError
in class DistributedServerObject
public boolean receive(Message msg) throws SdsException
DistributedServerObject
Defines the server behavior when a message is received
receive
in class DistributedServerObject
msg
- received message. Must not be null (no checking is
necessary when implementing this operation)
SdsException
- an error occurred when retrieving information from
the message (or cast)public void terminateServer()
DistributedServerObject
Automatically called by DistributedServerObject.terminate()
terminateServer
in class DistributedServerObject
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |