Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.miamm.soapmmil.agents
Class ResponseReceivingService  view ResponseReceivingService download ResponseReceivingService.java

java.lang.Object
  extended byorg.miamm.soapmmil.MIAMMService
      extended byorg.miamm.soapmmil.agents.ResponseReceivingService
All Implemented Interfaces:
org.miamm.soapmmil.SoapMMILConstants

public class ResponseReceivingService
extends org.miamm.soapmmil.MIAMMService

For testing the request-response functionality in MIAMM. It recognises MsgContentType.WORD_GRAPH as a regular event, and MsgContentType.SEMANTIC_REPRESENTATION as a response, and MsgContentType.GOAL_REPRESENTATION

Version:
$Revision: 1.1 $
$Date: 2003/05/04 20:45:50 $

Nested Class Summary
 
Nested classes inherited from class org.miamm.soapmmil.MIAMMService
 
Field Summary
protected static org.miamm.soapmmil.SoapmmilMessage _lastResponseReceived
           
(package private) static org.apache.log4j.Logger _logger
           
protected static int _msgCount
           
protected static int _responseCount
           
protected static long _timeout
           
static org.miamm.castor.headerblock.types.MsgContentType NORMAL_EVENT_TYPE
           
static org.miamm.castor.headerblock.types.MsgContentType TRIGGER_AWAIT_1_TYPE
           
static org.miamm.castor.headerblock.types.MsgContentType TRIGGER_AWAIT_2_TYPE
           
 
Fields inherited from class org.miamm.soapmmil.MIAMMService
 
Fields inherited from interface org.miamm.soapmmil.SoapMMILConstants
ELEMENT_MISOH_BLOCK, LOG4J_PROPERTY, misohDescriptor, NAMESPACE_PREFIX_MIAMM, NAMESPACE_URI_MIAMM, PROPERTY_MIAMM_SMART_RECEIVER, PROPERTY_MIAMM_URLFILE
 
Constructor Summary
ResponseReceivingService()
           
 
Method Summary
private  void doAwait(org.miamm.castor.headerblock.types.MsgContentType type)
           
static org.miamm.soapmmil.SoapmmilMessage getLastResponse()
           
static int getMsgCount()
           
static java.lang.String getRequest1MsgId()
          This service assumes that it only sent two messages.
static java.lang.String getRequest2MsgId()
          This service assumes that it only sent two messages.
static int getResponseCount()
           
private static void incrementMsgCount()
           
private static void incrementResponseCount()
           
 void recogniseEvent(org.miamm.soapmmil.SoapmmilMessage message)
          Do the main work of this service.
static void reset()
           
 void restart()
          Reinitialise the service.
static void setTimeout(long timeout)
           
 org.miamm.soapmmil.MIAMMServiceEngine soapmmil()
          Exposes the soapmmil engine connected to this service.
 void start()
          Initialise the service.
 void stop()
          Stops the service and does any cleanup.
 
Methods inherited from class org.miamm.soapmmil.MIAMMService
getDebuggingId, getDumbOutgoingURL, getServiceName, getServiceTable, getSmartOutgoingURL, receiveMessage, recogniseEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_logger

static org.apache.log4j.Logger _logger

_msgCount

protected static int _msgCount

_responseCount

protected static int _responseCount

_timeout

protected static long _timeout

_lastResponseReceived

protected static org.miamm.soapmmil.SoapmmilMessage _lastResponseReceived

NORMAL_EVENT_TYPE

public static org.miamm.castor.headerblock.types.MsgContentType NORMAL_EVENT_TYPE

TRIGGER_AWAIT_1_TYPE

public static org.miamm.castor.headerblock.types.MsgContentType TRIGGER_AWAIT_1_TYPE

TRIGGER_AWAIT_2_TYPE

public static org.miamm.castor.headerblock.types.MsgContentType TRIGGER_AWAIT_2_TYPE
Constructor Detail

ResponseReceivingService

public ResponseReceivingService()
                         throws org.miamm.soapmmil.MIAMMException
Method Detail

recogniseEvent

public void recogniseEvent(org.miamm.soapmmil.SoapmmilMessage message)
                    throws org.miamm.soapmmil.MIAMMException
Description copied from class: org.miamm.soapmmil.MIAMMService
Do the main work of this service. This function is only called when the SoapMMIL detects an incoming message of a type that we explicitly allow.


doAwait

private void doAwait(org.miamm.castor.headerblock.types.MsgContentType type)

getRequest1MsgId

public static java.lang.String getRequest1MsgId()
This service assumes that it only sent two messages. We return the msgId for the default ficticious message.


getRequest2MsgId

public static java.lang.String getRequest2MsgId()
This service assumes that it only sent two messages. We return the msgId for the alternate message.


setTimeout

public static void setTimeout(long timeout)

soapmmil

public org.miamm.soapmmil.MIAMMServiceEngine soapmmil()
Exposes the soapmmil engine connected to this service. This is normally a no-no, but we need it for unit testing


incrementMsgCount

private static void incrementMsgCount()

incrementResponseCount

private static void incrementResponseCount()

reset

public static void reset()

getMsgCount

public static int getMsgCount()

getResponseCount

public static int getResponseCount()

getLastResponse

public static org.miamm.soapmmil.SoapmmilMessage getLastResponse()

start

public void start()
Description copied from class: org.miamm.soapmmil.MIAMMService
Initialise the service. This is called only once in the life-cycle of the service. This would also be the right time to register the types of messages we are interested in receiving. This does not guarantee that all messages of these types will come to the service, but that the only messages received by the service will be of these types.


restart

public void restart()
Description copied from class: org.miamm.soapmmil.MIAMMService
Reinitialise the service. I don't see why you wouldn't just call stop and then call start again, but who knows. FIXME: decide whether or not to keep this function


stop

public void stop()
Description copied from class: org.miamm.soapmmil.MIAMMService
Stops the service and does any cleanup. This would be a good time to save stuff to disk, for example