de.dfki.lt.hog
Class XmlRpcApplication

java.lang.Object
  extended by de.dfki.lt.hog.Application
      extended by de.dfki.lt.hog.XmlRpcApplication
All Implemented Interfaces:
XmlRpcClientInterface
Direct Known Subclasses:
SampleXmlRpcApplication

public abstract class XmlRpcApplication
extends Application
implements XmlRpcClientInterface

An XmlRpcApplication provides methods and fields for an application which uses the XML-RPC protocol to communicate with MoCoMan. These methods and fields are, among others, an XmlRpcClient, an URL to MoCoMan's XmlRpcServer, a handler name and handler method names. For all these fields, there are get and set methods to change and retrieve each of them.


Field Summary
static java.lang.String XMLRPC_HANDLER_METHOD
          Key for a handler method for XML-RPC calls in the properties of this XmlRpcApplications.
static java.lang.String XMLRPC_HANDLER_NAME
          Key for a handler for XML-RPC calls in the properties of this XmlRpcApplications.
static java.lang.String XMLRPC_SERVER_PORT
          Key for server port in the properties of this XmlRpcApplications.
static java.lang.String XMLRPC_SERVER_URL
          Key for server URL in the properties of this XmlRpcApplications.
 
Fields inherited from class de.dfki.lt.hog.Application
applicationLog, DATABASE_URI, DATABASE_USER
 
Constructor Summary
XmlRpcApplication()
           
 
Method Summary
 org.apache.xmlrpc.XmlRpcClient getXmlRpcApplicationClient()
          Returns the XML-RPC client of this XmlRpcApplications.
 java.lang.String[] getXmlRpcHandlerMethods()
          Returns an array of names of possible methods for XML-RPC calls.
 java.lang.String getXmlRpcHandlerName()
          Returns the name of the handler of XML-RPC calls.
 int getXmlRpcServerPort()
          Returns the port of the server which answers XML-RPC calls.
protected  java.lang.String getXmlRpcServerUrl()
          Returns the URL of the server which answers XML-RPC calls.
 void init(java.util.Properties xmlRpcApplProps)
          Initializes field values with values from configuration.
 java.lang.String process(java.lang.String aMethodName, java.util.Vector params)
          Sends parameters to a remote module by an XmlRpcClient.
 void setXmlRpcApplicationClient(org.apache.xmlrpc.XmlRpcClient aClient)
          Sets an XML-RPC client for this XmlRpcApplications.
 void setXmlRpcServerPort(int aPort)
          Sets a port to a server for XML-RPC calls
 void shutdown(java.lang.String aModuleName)
          Shutsdown a remote module.
 void start(java.lang.String aModuleName)
          Starts a remote adaptor to communicate with.
 
Methods inherited from class de.dfki.lt.hog.Application
getConfig, getDatabaseUri, getDatabaseUser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XMLRPC_SERVER_URL

public static final java.lang.String XMLRPC_SERVER_URL
Key for server URL in the properties of this XmlRpcApplications.

See Also:
Constant Field Values

XMLRPC_SERVER_PORT

public static final java.lang.String XMLRPC_SERVER_PORT
Key for server port in the properties of this XmlRpcApplications.

See Also:
Constant Field Values

XMLRPC_HANDLER_NAME

public static final java.lang.String XMLRPC_HANDLER_NAME
Key for a handler for XML-RPC calls in the properties of this XmlRpcApplications.

See Also:
Constant Field Values

XMLRPC_HANDLER_METHOD

public static final java.lang.String XMLRPC_HANDLER_METHOD
Key for a handler method for XML-RPC calls in the properties of this XmlRpcApplications.

See Also:
Constant Field Values
Constructor Detail

XmlRpcApplication

public XmlRpcApplication()
Method Detail

init

public void init(java.util.Properties xmlRpcApplProps)
Description copied from class: Application
Initializes field values with values from configuration.

Overrides:
init in class Application

getXmlRpcApplicationClient

public org.apache.xmlrpc.XmlRpcClient getXmlRpcApplicationClient()
Returns the XML-RPC client of this XmlRpcApplications.

Returns:
an XML-RPC client

setXmlRpcApplicationClient

public void setXmlRpcApplicationClient(org.apache.xmlrpc.XmlRpcClient aClient)
Sets an XML-RPC client for this XmlRpcApplications.

Parameters:
aClient - a new XML-RPC client for this XmlRpcApplications.

getXmlRpcServerUrl

protected java.lang.String getXmlRpcServerUrl()
Returns the URL of the server which answers XML-RPC calls.

Returns:
server URL

getXmlRpcServerPort

public int getXmlRpcServerPort()
Returns the port of the server which answers XML-RPC calls.

Returns:
server port

setXmlRpcServerPort

public void setXmlRpcServerPort(int aPort)
Sets a port to a server for XML-RPC calls

Parameters:
aPort - a new port

getXmlRpcHandlerName

public java.lang.String getXmlRpcHandlerName()
Returns the name of the handler of XML-RPC calls.

Returns:
a handler name for XML-RPC

getXmlRpcHandlerMethods

public java.lang.String[] getXmlRpcHandlerMethods()
Returns an array of names of possible methods for XML-RPC calls.

Returns:
names of methods for XML-RPC

shutdown

public void shutdown(java.lang.String aModuleName)
Description copied from interface: XmlRpcClientInterface
Shutsdown a remote module.

Specified by:
shutdown in interface XmlRpcClientInterface
Parameters:
aModuleName - name of the module to shut down

process

public java.lang.String process(java.lang.String aMethodName,
                                java.util.Vector params)
Description copied from interface: XmlRpcClientInterface
Sends parameters to a remote module by an XmlRpcClient. Calls therefore the execute method of XmlRpcClient.

Specified by:
process in interface XmlRpcClientInterface
Parameters:
aMethodName - name of a method which process params remotely
params - paramters for remote method

start

public void start(java.lang.String aModuleName)
Description copied from interface: XmlRpcClientInterface
Starts a remote adaptor to communicate with. This method must be implemented by each class derived from XmlRpcModule and could start an adaptor via a shell or Python script, for example.

Specified by:
start in interface XmlRpcClientInterface
Parameters:
aModuleName - name of the module to start