|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--lime.LimeServer
The runtime support needed to run Lime on a given host.
There can be multiple Lime servers running on a single host, as long as they
are started on separate ports. The server must be explicitly activated by
calling the boot
method.
The server also provides methods that allow an agent in it to engage the
corresponding host in the Lime community. Engagement takes place as a
distributed transaction that reconciles the state of the system by shuffling
misplaced tuples and installing weak reaction
operations among
the engaging host and those already in the system. Similarly, disengagement
removes a host from the community.
The server can be accessed from within a program, or started from command
line using the Launcher
.
Field Summary | |
protected static java.util.Properties |
defaultProperties
The default server properties. |
static java.util.Properties |
properties
The server properties. |
Fields inherited from interface lime.PropertyKeys |
CONNECTkey, DEBUGkey, ERRORSkey, LOADkey, MAFACTORYkey, MCASTADDRkey, MCASTkey, MCASTPORTkey, MESSAGESkey, PORTkey, QUITkey, TSFACTORYkey |
Method Summary | |
void |
boot()
Activate the runtime support. |
boolean |
declareLeader()
Needed to bootstrap the system by introducing the first host, willing to accept connections from others hosts that want to join the system. |
boolean |
disengage()
Start the disengagement protocol needed to allow a host to depart from a community of mobile hosts. |
boolean |
engage()
Start the engagement protocol necessary to make this host part of a community of mobile hosts. |
java.lang.String |
getAgentFactory()
|
int |
getLoadPort()
|
java.lang.String |
getMulticastAddr()
|
int |
getMulticastPort()
|
int |
getPort()
Return the value of the socket port this server is using for unicast messages. |
static LimeServer |
getServer()
Return a handle to the Lime server. |
static LimeServerID |
getServerID()
Return the identity of this server. |
java.lang.String |
getTupleSpaceFactory()
|
boolean |
isDebugOn()
|
boolean |
isEngaged()
Return true if the host is engaged, false otherwise |
boolean |
isErrorsOn()
|
boolean |
isMessagesOn()
|
boolean |
isMulticastOn()
|
boolean |
isPermanentConnections()
|
ILimeAgent |
loadAgent(java.lang.String classname,
java.io.Serializable[] parameters)
Load an agent into the Lime server. |
void |
run()
The server's behavior. |
void |
setProperty(java.lang.String key,
java.lang.String value)
|
void |
shutDown()
Terminates this Lime server. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static java.util.Properties defaultProperties
public static java.util.Properties properties
Method Detail |
public void setProperty(java.lang.String key, java.lang.String value)
public static LimeServer getServer()
public static LimeServerID getServerID()
LimeServerID
valuepublic int getPort()
public int getLoadPort()
public int getMulticastPort()
public java.lang.String getMulticastAddr()
public java.lang.String getTupleSpaceFactory()
public java.lang.String getAgentFactory()
public boolean isPermanentConnections()
public boolean isMulticastOn()
public boolean isDebugOn()
public boolean isErrorsOn()
public boolean isMessagesOn()
public boolean declareLeader()
false
if the host was already engaged,
true
otherwise.public boolean engage()
true
if the host is engaged, false
if
the host was already engaged, or did not have any agents with a shared
tuple space.public boolean disengage()
true
if the host is successfully disengaged, false
if it was not engaged when the call was made.public boolean isEngaged()
true
if the host is engaged, false otherwisepublic ILimeAgent loadAgent(java.lang.String classname, java.io.Serializable[] parameters) throws AgentCreationException
.class
files) for
this class and all the other classes needed by the agent must be in a
directory in the same CLASSPATH
available to the Lime server
(and to the tuple space engine, if the latter employs user-defined
classes). If the Agent
subclass has a constructor with
parameters, it is possible to create the agent by supplying parameters in
the method call. The correct constructor is automatically retrieved by
the system based on the signature.classname
- the fully specified name of the agent's class.parameters
- the parameters for instantiating the agent. Their type
must match the type of a constructor of classname
.ILimeAgent
.AgentCreationException
- if it is impossible to create the
agent, e.g., because classname
is not a subclass of
ILimeAgent
, or the corresponding classes cannot be found.public void boot()
public void shutDown()
public void run()
run
in interface java.lang.Runnable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |