|
|||||||||
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 at least 3 apart. This is because (port+1) is used for loading agents, and (port+2) is used for the group manager's SinglePhaseDisseminator. Note that other (future) detectors/disseminators could use more 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
.
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, ENGAGEkey, ENGAGEMENT_MODEkey, ERRORSkey, GM_DETECTORkey, GM_DISSEMINATORkey, GM_MAX_SPEEDkey, GM_MCASTADDRkey, GM_MCASTPORTkey, GM_NETWORK_LATENCYkey, GM_PERIODkey, GM_RANGEkey, GPS_BAUDkey, GPS_PORTkey, LOADkey, MESSAGESkey, PORTkey, QUITkey, TSFACTORYkey |
Method Summary | |
void |
boot()
Activate the runtime support. |
void |
disengage()
Start the disengagement protocol needed to allow a host to depart from a community of mobile hosts. |
void |
engage()
Start the engagement protocol necessary to make this host part of a community of mobile hosts. |
int |
getLoadPort()
Returns the port used to load agents onto this LimeServer. |
LimeServerID |
getmcastServerID()
Returns the ID of the multicast server. |
int |
getPort()
Returns the port being used by this LIMEServer. |
static LimeServer |
getServer()
Return a handle to the Lime server. |
LimeServerID |
getServerID()
Returns the ID of the local server. |
java.lang.String |
getTupleSpaceFactory()
Returns the tuple space factory |
void |
groupChanged(GroupChangedEvent gce)
The makeup of the group has changed. |
boolean |
isDebugOn()
Returns true if debug messages should be printed. |
boolean |
isEngaged()
Return true if the host is engaged, false otherwise |
boolean |
isErrorsOn()
Returns true if error messages should be printed. |
boolean |
isMessagesOn()
Returns true if messages should be printed. |
boolean |
isPermanentConnections()
Returns true if TCP connections are maintained. |
boolean |
isShuttingDown()
Returns whether shutdown has been called on this LimeServer. |
ILimeAgent |
loadAgent(java.lang.String classname,
java.io.Serializable[] parameters)
Load an agent into the Lime server. |
void |
run()
Listens on the load port, when a client connects, it passes in the name of the agent that should be loaded into the LimeServer. |
void |
setProperty(java.lang.String key,
java.lang.String value)
|
void |
shutdown(boolean exit)
Shuts down the LimeServer. |
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 groupChanged(GroupChangedEvent gce)
groupChanged
in interface GroupChangedListener
gce
- the GroupChangedEventpublic void setProperty(java.lang.String key, java.lang.String value)
public static LimeServer getServer()
public java.lang.String getTupleSpaceFactory()
public LimeServerID getServerID()
public LimeServerID getmcastServerID()
public int getPort()
public int getLoadPort()
public boolean isPermanentConnections()
public boolean isDebugOn()
public boolean isErrorsOn()
public boolean isMessagesOn()
public void engage()
public void disengage()
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(boolean exit)
exit
- true if the method should system.exitpublic boolean isShuttingDown()
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 |