com.jxml.qare.qhome
Class P2PRequest

java.lang.Object
  |
  +--com.jxml.qare.qhome.SDO
        |
        +--com.jxml.qare.qhome.MessageAgent
              |
              +--com.jxml.qare.qhome.P2PRequest
All Implemented Interfaces:
Item

public abstract class P2PRequest
extends MessageAgent

This is the base class for all P2P request messages


Fields inherited from class com.jxml.qare.qhome.MessageAgent
inbox, orginatingSession, sourceESDO
 
Constructor Summary
P2PRequest()
           
 
Method Summary
 void eval(Map properties, List args, ClassLoader cl)
          P2P request messages are not displayed in inbox.
 void forward(DBSystem.Row toSystem)
          Forward this p2p request on to other systems.
 boolean forwardable()
          Returns true if hopsRemaining > 0.
 String getAction()
          This method specifies the action defined by all P2P request messages.
abstract  QSchemaFactory getFactory()
          This method is overidden by the various application classes for P2P requests.
abstract  int maxHops()
          This method is overidden by the various application classes for P2P requests.
abstract  void process(DBSession.Row qSession)
          This method is overidden by the various application classes for P2P requests.
 void reply(P2PResponse response)
          Send a response back to the original requestor
 DBPendingMessage.Row send(DBInbox.Row inbox, DBSystem.Row toSystem)
          Opens a new session and sends this object as a message.
abstract  int timeout()
          This method is overidden by the various application classes for P2P requests.
 
Methods inherited from class com.jxml.qare.qhome.MessageAgent
lastSend, lastSend, process, send, send, send, send, send, send, send, signed
 
Methods inherited from class com.jxml.qare.qhome.SDO
createInboxMsg, createInboxMsg, exceptionTraceString, getFactoryClassName, getQDoc, getSchema, toXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

P2PRequest

public P2PRequest()
Method Detail

timeout

public abstract int timeout()
This method is overidden by the various application classes for P2P requests. Returns the timeout value in millis. May not return -1, as a timeout is required for p2p requests.
Overrides:
timeout in class MessageAgent

maxHops

public abstract int maxHops()
This method is overidden by the various application classes for P2P requests. Returns the number of times a message can be sent or forwarded. (Must return a value greater than 1.)

getFactory

public abstract QSchemaFactory getFactory()
This method is overidden by the various application classes for P2P requests. The schema factory returned by this method is used to process the persistant form of the application's p2p request messages.
Overrides:
getFactory in class SDO

process

public abstract void process(DBSession.Row qSession)
                      throws Exception
This method is overidden by the various application classes for P2P requests. This method is invoked when a p2p request arrives on a system.

getAction

public final String getAction()
This method specifies the action defined by all P2P request messages.
Overrides:
getAction in class SDO

eval

public final void eval(Map properties,
                       List args,
                       ClassLoader cl)
                throws Exception
P2P request messages are not displayed in inbox.
Overrides:
eval in class SDO

send

public final DBPendingMessage.Row send(DBInbox.Row inbox,
                                       DBSystem.Row toSystem)
                                throws Exception
Opens a new session and sends this object as a message.
Returns:
the pending message(PendingMsg) which holds this object.

forwardable

public final boolean forwardable()
Returns true if hopsRemaining > 0.

forward

public final void forward(DBSystem.Row toSystem)
                   throws Exception
Forward this p2p request on to other systems.

reply

public final void reply(P2PResponse response)
                 throws Exception
Send a response back to the original requestor