com.cometway.xml
Class MinRPCAgent

java.lang.Object
  extended by com.cometway.props.Props
      extended by com.cometway.ak.Agent
          extended by com.cometway.ak.ServiceAgent
              extended by com.cometway.ak.RequestAgent
                  extended by com.cometway.xml.XMLRequestAgent
                      extended by com.cometway.xml.MinRPCAgent
All Implemented Interfaces:
AgentInterface, RequestAgentInterface, HasStateMachineModel

public abstract class MinRPCAgent
extends XMLRequestAgent


Field Summary
protected static java.lang.String BASE64
           
protected static java.lang.String BOOLEAN
           
protected static java.lang.String DATETIME
           
protected static java.lang.String DEFAULTS
           
protected static java.lang.String DESCRIPTION
           
protected static java.lang.String DOUBLE
           
protected static java.lang.String ERROR
           
protected static java.lang.String INTEGER
           
protected static java.lang.String MESSAGE
           
protected static java.lang.String METHOD
           
protected static java.lang.String OPTIONAL
           
protected static java.lang.String REQUIRED
           
protected static java.lang.String RESPONSE
           
protected static java.lang.String RETURNS
           
protected static java.lang.String STACKTRACE
           
protected static java.lang.String STRING
           
protected static java.lang.String SYNTAX
           
 
Fields inherited from class com.cometway.xml.XMLRequestAgent
EOL
 
Fields inherited from class com.cometway.ak.Agent
agent_id, agentController, CREATING_STATE, debugReporter, DESTROYED_STATE, DESTROYING_STATE, errorReporter, FAILED_STATE, printlnReporter, props, RUNNING_STATE, STARTING_STATE, STOPPED_STATE, STOPPING_STATE, warningReporter
 
Constructor Summary
MinRPCAgent()
           
 
Method Summary
 void handleRequest(AgentRequest request)
          Respond to the specified request as appropriate.
protected  void registerMethod(java.lang.String method)
           
protected  void registerMethod(java.lang.String registeredMethod, java.lang.String localMethod)
           
abstract  void registerMethods()
           
 void start()
          Registers this instance with the service manager using the service_name property.
protected  void writeErrorResponse(AgentRequest request, java.lang.Exception e)
           
protected  void writeResponse(AgentRequest request)
           
protected  void writeSyntax(AgentRequest request)
           
 
Methods inherited from class com.cometway.xml.XMLRequestAgent
getResponseProps, loadPropsFromXMLFile, savePropsToXMLFile, sendAgentRequest, writeAutoIndent, writeElement, writeElement, writeElement, writeElement, writeEmptyElement, writeEmptyElement, writeEmptyElement, writeEndTag, writeProps, writeStartTag, writeStartTag, writeStartTag, writeXMLHeader
 
Methods inherited from class com.cometway.ak.ServiceAgent
stop
 
Methods inherited from class com.cometway.ak.Agent
currentStateEquals, debug, destroy, error, error, getAgentController, getDateTimeStr, getProps, getServiceImpl, getStateMachineModel, initProps, println, register, registerService, setAgentController, setProps, toString, unregister, unregisterService, warning, warning
 
Methods inherited from class com.cometway.props.Props
addListener, append, copy, copyFrom, copyTo, decrementInteger, dump, enableListeners, enumerateKeys, format, getBoolean, getByteArray, getCharacter, getDate, getDate, getDateString, getDouble, getFloat, getHexString, getInteger, getKeys, getLong, getNextKey, getProperty, getProperty, getPropsContainer, getSize, getString, getString, getTokens, getTokens, getTrimmedString, getVector, hasProperty, incrementInteger, insertProps, loadProps, notifyPropsChanged, notifyPropsChangedIgnore, notifyPropsChangedIgnore, parse, propertyMatchesRegEx, readFromFile, regExPropertyMatches, removeAll, removeListener, removeProperty, resumeNotify, saveProps, set, setBoolean, setCharacter, setDefault, setDouble, setFloat, setInteger, setLong, setProperty, setProperty, setProperty, setPropsContainer, suspendNotify, writeToFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STRING

protected static final java.lang.String STRING
See Also:
Constant Field Values

BOOLEAN

protected static final java.lang.String BOOLEAN
See Also:
Constant Field Values

INTEGER

protected static final java.lang.String INTEGER
See Also:
Constant Field Values

DOUBLE

protected static final java.lang.String DOUBLE
See Also:
Constant Field Values

DATETIME

protected static final java.lang.String DATETIME
See Also:
Constant Field Values

BASE64

protected static final java.lang.String BASE64
See Also:
Constant Field Values

SYNTAX

protected static final java.lang.String SYNTAX
See Also:
Constant Field Values

METHOD

protected static final java.lang.String METHOD
See Also:
Constant Field Values

DESCRIPTION

protected static final java.lang.String DESCRIPTION
See Also:
Constant Field Values

REQUIRED

protected static final java.lang.String REQUIRED
See Also:
Constant Field Values

OPTIONAL

protected static final java.lang.String OPTIONAL
See Also:
Constant Field Values

DEFAULTS

protected static final java.lang.String DEFAULTS
See Also:
Constant Field Values

RETURNS

protected static final java.lang.String RETURNS
See Also:
Constant Field Values

RESPONSE

protected static final java.lang.String RESPONSE
See Also:
Constant Field Values

ERROR

protected static final java.lang.String ERROR
See Also:
Constant Field Values

MESSAGE

protected static final java.lang.String MESSAGE
See Also:
Constant Field Values

STACKTRACE

protected static final java.lang.String STACKTRACE
See Also:
Constant Field Values
Constructor Detail

MinRPCAgent

public MinRPCAgent()
Method Detail

start

public void start()
Description copied from class: ServiceAgent
Registers this instance with the service manager using the service_name property.

Specified by:
start in interface AgentInterface
Overrides:
start in class ServiceAgent

registerMethods

public abstract void registerMethods()

registerMethod

protected void registerMethod(java.lang.String method)

registerMethod

protected void registerMethod(java.lang.String registeredMethod,
                              java.lang.String localMethod)

writeSyntax

protected void writeSyntax(AgentRequest request)

writeErrorResponse

protected void writeErrorResponse(AgentRequest request,
                                  java.lang.Exception e)

writeResponse

protected void writeResponse(AgentRequest request)
                      throws XMLParserException
Throws:
XMLParserException

handleRequest

public void handleRequest(AgentRequest request)
Description copied from interface: RequestAgentInterface
Respond to the specified request as appropriate.