com.sentilla.platform.cmote
Class Protocol

java.lang.Object
  extended by com.sentilla.system.DriverAdapter
      extended by com.sentilla.platform.cmote.Protocol
All Implemented Interfaces:
Driver
Direct Known Subclasses:
ClientRadioProtocol, CollectionProtocol, MimeoDisseminationProtocol

public abstract class Protocol
extends DriverAdapter

Provides the template that message protocols must follow.

Abstract class for creating a new messaging protocol. Protocols must extend this class. To use the a new protocol, it must be registered as a Driver on the platform.

See Also:
Dispatcher, DriverAdapter, Drivers

Field Summary
 
Fields inherited from class com.sentilla.system.DriverAdapter
m_nextDriver
 
Constructor Summary
Protocol()
           
 
Method Summary
abstract  boolean doesInstanceMatch(Object obj)
          Checks if input object matches class type of implementing protocols messages.
abstract  Receiver newReceiver()
          Creates a new receiver.
abstract  Sender newSender()
          Creates a new sender.
abstract  void stackReceive(Receiver rcvr)
          Processes a message sent with the implementing protocol.
abstract  void stackSend(Sender s)
          Processes a message to send with the implementing protocol.
 
Methods inherited from class com.sentilla.system.DriverAdapter
getDriverName, getNextDriver, setNextDriver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Protocol

public Protocol()
Method Detail

stackReceive

public abstract void stackReceive(Receiver rcvr)
Processes a message sent with the implementing protocol. Must be implemented by all protocols. It is called by the Dispatcher when a message is received that was sent with implementing protocol. When finished processing the received message, this method should dispatch any resulting application message by calling Dispatcher.dispatch( Receiver rcvr ).

Parameters:
rcvr - Receiver object containing received object
See Also:
Receiver

stackSend

public abstract void stackSend(Sender s)
Processes a message to send with the implementing protocol. Should only be called by the Dispatcher and by protocols. Sends objects with the implementing protocol.

Parameters:
s - Sender object containing the object to be sent.
See Also:
Dispatcher, Sender

newSender

public abstract Sender newSender()
Creates a new sender. Returns a new protocol sender object.

Returns:
the sender for this protocol
See Also:
Sender

newReceiver

public abstract Receiver newReceiver()
Creates a new receiver.

Returns:
the receiver for this protocol.
See Also:
Receiver

doesInstanceMatch

public abstract boolean doesInstanceMatch(Object obj)
Checks if input object matches class type of implementing protocols messages. Returns true if the input object matches the class this is expecting.

Parameters:
obj - received object
Returns:
true if this receiver is receiving for the same class as obj.


Copyright © 2007 Sentilla Corporation. All Rights Reserved.