org.mbari.siam.utils
Class ShoreMessagingService

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by org.mbari.siam.utils.ShoreMessagingService
All Implemented Interfaces:
java.io.Serializable, java.rmi.Remote, RemoteService, ShoreMessaging
Direct Known Subclasses:
NALMessagingService, SimulatedShoreMessagingService

public abstract class ShoreMessagingService
extends java.rmi.server.UnicastRemoteObject
implements ShoreMessaging

Base class for implementations of ShoreMessaging; performs functions not specific to particular modem device. Subclasses should implement methods of ShoreMessaging that are device-specific, e.g. connectModem(). ShoreMessagingService queues out-going messages for downlink. The downlink queue is populated by service clients and consumed by logic in a subclass' connect() method.

See Also:
Serialized Form

Nested Class Summary
protected  class ShoreMessagingService.ShutdownTask
           
 
Field Summary
protected  Queue _downlinkMsgQ
          Downlink messages to be sent to modem device
protected static org.apache.log4j.Logger _log4j
           
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
ShoreMessagingService()
          Constructor
 
Method Summary
 int nQueuedDownlinkMsgs()
          Get count of messages in downlink queue
 void ping()
          Just return; service is alive
 int queueDownlinkMessage(byte[] messageBytes)
          Queue a message for downlink; returns current count of messages in downlink queue.
 void shutdown()
          Initiate service shutdown
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mbari.siam.distributed.ShoreMessaging
connect, maxDownlinkMsgBytes
 

Field Detail

_log4j

protected static org.apache.log4j.Logger _log4j

_downlinkMsgQ

protected Queue _downlinkMsgQ
Downlink messages to be sent to modem device

Constructor Detail

ShoreMessagingService

public ShoreMessagingService()
                      throws java.rmi.RemoteException
Constructor

Throws:
java.rmi.RemoteException
Method Detail

queueDownlinkMessage

public int queueDownlinkMessage(byte[] messageBytes)
                         throws ShoreMessagingHelper.MessageTooBig,
                                java.lang.Exception
Queue a message for downlink; returns current count of messages in downlink queue.

Specified by:
queueDownlinkMessage in interface ShoreMessaging
Throws:
ShoreMessagingHelper.MessageTooBig
java.lang.Exception

nQueuedDownlinkMsgs

public int nQueuedDownlinkMsgs()
Get count of messages in downlink queue

Specified by:
nQueuedDownlinkMsgs in interface ShoreMessaging

ping

public void ping()
Just return; service is alive

Specified by:
ping in interface RemoteService

shutdown

public void shutdown()
Initiate service shutdown

Specified by:
shutdown in interface ShoreMessaging


Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.