|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--com.intel.research.rain.Service
|
+--uwcse.location.LocationService
The abstract class to be extended by runnable Location Services.
| Nested Class Summary | |
class |
LocationService.RediscoverServices
A task to rediscover a set of services. |
| Field Summary | |
protected static String |
CONFIG_FILENAME
|
protected static String |
MESSAGE_ELEMENT
|
protected static String |
MESSAGE_EXTENSION
|
protected static String |
RPC_ELEMENT
|
protected static String |
RPC_EXCEPTION_ELEMENT
|
protected static String |
RPC_EXTENSION
|
protected static String |
RPC_RESULT_ELEMENT
|
| Constructor Summary | |
LocationService()
Construct a new LocationService. |
|
| Method Summary | |
static void |
addObject(Message m,
String tagName,
Object o)
This static utility method pickles the Object o into a Rain message under the given XML tagName. |
LocationRpcResult |
callLocationRpc(ServiceID id,
LocationRpc rpc,
long timeout)
A helper routine to execute a remote procedure call on the service with the given ServiceID and block until we receive result or an exception. |
static long |
correctedTimeMillis()
Get the current value of the system clock with a correction applied by the Ntp server. |
static Object |
getObject(Message m,
String tagName)
This static helper method unpickles and extracts an Object from a Rain message under the given XML tagName. |
static long |
getSysclockError()
Get the number of milliseconds of error in our system clock versus the Ntp server. |
protected void |
handleTerminalCommand(String cmd)
This routine is called to process command strings captured by runTerminalCommandLoop. |
void |
multicastLocationMsg(Collection serviceIDs,
LocationMsg msg)
A helper routine to send a LocationMsg asynchronously to all the services in given Collection of ServiceIDs. |
void |
multicastLocationMsgs(Collection serviceIDs,
Collection msgs)
A helper routine to send a Collection of LocationMsgs asynchronously to all the services in given Collection of ServiceIDs. |
protected void |
processLocationMsg(ServiceID from,
LocationMsg locationMsg)
Catch LocationMsgs which are not handled by any extending classes or multimethods. |
protected LocationRpcResult |
processLocationRpc(ServiceID from,
LocationRpc rpc)
Catch LocationRpc requests which are not handled by any extending classes or multimethods and throw an exception back to the sender. |
void |
runTerminalCommandLoop()
Run the terminal command reader to process location service terminal commands. |
void |
sendLocationMsg(ServiceID to,
LocationMsg msg)
A helper routine to send a LocationMsg asynchronously to the given ServiceID. |
void |
sendLocationMsgs(ServiceID to,
Collection msgs)
A helper routine to send a Collection of independent LocationMsgs to the given ServiceID. |
void |
setDescription(Element description)
Overridden to insert subclasses' descriptions inside the structured registration hierarchy before registering with discovery. |
protected void |
withdraw()
Supplement the inherited behavior to shutdown the Ntp query timer when withdrawing from Rain. |
| Methods inherited from class com.intel.research.rain.Service |
getDaemon, getDispatcher, getServiceID, process, receive, setDaemon |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static final String MESSAGE_EXTENSION
protected static final String MESSAGE_ELEMENT
protected static final String RPC_EXTENSION
protected static final String RPC_ELEMENT
protected static final String RPC_RESULT_ELEMENT
protected static final String RPC_EXCEPTION_ELEMENT
protected static final String CONFIG_FILENAME
| Constructor Detail |
public LocationService()
throws RainException,
LocationException
RainException
LocationException| Method Detail |
public void setDescription(Element description)
setDescription in class Service
protected void processLocationMsg(ServiceID from,
LocationMsg locationMsg)
protected LocationRpcResult processLocationRpc(ServiceID from,
LocationRpc rpc)
throws Exception
Exception
public final LocationRpcResult callLocationRpc(ServiceID id,
LocationRpc rpc,
long timeout)
throws LocationRpcException
rpc - the remote procedure call to runtimeout - the timeout out in milliseconds to wait for a reply after
which an exception will be thorwn
LocationRpcException - when an exception is thrown by the remote
service. The cause is the exception thrown on the remote service.Throwable.getCause()
public final void sendLocationMsg(ServiceID to,
LocationMsg msg)
throws RainException
RainExceptionmulticastLocationMsg(Collection,LocationMsg),
sendLocationMsgs(ServiceID,Collection),
multicastLocationMsgs(Collection,Collection)
public final void multicastLocationMsg(Collection serviceIDs,
LocationMsg msg)
throws RainException
RainExceptionsendLocationMsg(ServiceID,LocationMsg),
sendLocationMsgs(ServiceID,Collection),
multicastLocationMsgs(Collection,Collection)
public final void sendLocationMsgs(ServiceID to,
Collection msgs)
throws RainException
RainExceptionsendLocationMsg(ServiceID,LocationMsg),
multicastLocationMsg(Collection,LocationMsg),
multicastLocationMsgs(Collection,Collection)
public final void multicastLocationMsgs(Collection serviceIDs,
Collection msgs)
throws RainException
RainExceptionsendLocationMsg(ServiceID,LocationMsg),
multicastLocationMsg(Collection,LocationMsg),
sendLocationMsgs(ServiceID,Collection)
public static void addObject(Message m,
String tagName,
Object o)
public static Object getObject(Message m,
String tagName)
public final void runTerminalCommandLoop()
throws IOException
IOExceptionhandleTerminalCommand(String)public static final long correctedTimeMillis()
System.currentTimeMillis()public static final long getSysclockError()
protected void handleTerminalCommand(String cmd)
runTerminalCommandLoop()protected void withdraw()
withdraw in class Service
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||