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

Quick Search    Search Deep

org.miamm.soapmmil.test.simple
Class SimpleMIAMMService  view SimpleMIAMMService download SimpleMIAMMService.java

java.lang.Object
  extended byorg.miamm.soapmmil.MIAMMService
      extended byorg.miamm.soapmmil.test.simple.SimpleMIAMMService
All Implemented Interfaces:
SimpleMIAMMServiceConstants, org.miamm.soapmmil.SoapMMILConstants
Direct Known Subclasses:
SimpleMIAMMService_Alpha, SimpleMIAMMService_Bravo, SimpleMIAMMService_Charlie, SimpleMIAMMService_Zulu

public abstract class SimpleMIAMMService
extends org.miamm.soapmmil.MIAMMService
implements SimpleMIAMMServiceConstants, org.miamm.soapmmil.SoapMMILConstants

A less minimal implementation of SAXedMIAMMService.

All the services described in the package notes simple extend this class and implement the getID function, returning a single character representing their id

Version:
$Revision: 1.18 $
$Date: 2003/04/22 23:01:21 $

Nested Class Summary
 
Nested classes inherited from class org.miamm.soapmmil.MIAMMService
 
Field Summary
(package private)  boolean _hasStarted
           
(package private) static org.apache.log4j.Logger logger
           
 java.lang.String NAMESPACE_AWARE
           
 java.lang.String SIMPLE_TEST_STRING_DEFAULT
           
 java.lang.String SIMPLE_TEST_STRING_PROPERTY
           
 
Fields inherited from class org.miamm.soapmmil.MIAMMService
 
Fields inherited from interface org.miamm.soapmmil.test.simple.SimpleMIAMMServiceConstants
ALPHA_RECEIVER_PROPERTY, BRAVO_RECEIVER_PROPERTY, CHARLIE_RECEIVER_PROPERTY, ELEMENT_TAG_DREAM, ELEMENT_TAG_REALITY, ELEMENT_TAG_ROOT, ZULU_RECEIVER_PROPERTY
 
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
SimpleMIAMMService()
           
 
Method Summary
 void fireMessage(java.lang.String reality, java.lang.String dream)
          Send off a message that states what is to be the next reality and dream.
abstract  java.lang.Character getID()
          Return a single character that identifies this service.
protected  org.miamm.castor.headerblock.types.MsgContentType getMsgContentType(char character)
          Return the MsgContentType that the character maps to.
 void recogniseEvent(org.miamm.soapmmil.SoapmmilMessage message)
          Do the main work of this service.
 void restart()
          Reinitialise the 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, soapmmil
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SIMPLE_TEST_STRING_PROPERTY

public final java.lang.String SIMPLE_TEST_STRING_PROPERTY
See Also:
Constant Field Values

SIMPLE_TEST_STRING_DEFAULT

public final java.lang.String SIMPLE_TEST_STRING_DEFAULT
See Also:
Constant Field Values

NAMESPACE_AWARE

public final java.lang.String NAMESPACE_AWARE
See Also:
Constant Field Values

logger

static org.apache.log4j.Logger logger

_hasStarted

boolean _hasStarted
Constructor Detail

SimpleMIAMMService

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

getID

public abstract java.lang.Character getID()
Return a single character that identifies this service. Examples are 'a', 'b', 'c' :-)


start

public void start()
           throws org.miamm.soapmmil.MIAMMException
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()
             throws org.miamm.soapmmil.MIAMMException
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


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.


fireMessage

public void fireMessage(java.lang.String reality,
                        java.lang.String dream)
                 throws java.lang.Exception
Send off a message that states what is to be the next reality and dream. This covers the whole SoapMMIL outgoing-message procedure.


getMsgContentType

protected org.miamm.castor.headerblock.types.MsgContentType getMsgContentType(char character)
Return the MsgContentType that the character maps to. This function is specific to the Simple test; we assign the toy events such that:
 TOY_EVENT_A means the next character in the dream is 'a'
 TOY_EVENT_B means the next character in the dream is 'b'
 TOY_EVENT_C means the next charecter in the dream is 'c'
 TOY_EVENT_Z means anything not captured by the above