|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.dfki.lt.hog.Module
de.dfki.lt.hog.XmlRpcModule
public abstract class XmlRpcModule
Encapsulates all methods needed to communicate via XML-RPC with a remote module. This module is called a Handler in the XML-RPC API used, so, this convention is applied here. A handler must have a method which actually processes a request and a server for communication.
Field Summary | |
---|---|
static java.lang.String |
XMLRPC_HANDLER_METHOD
Key for a method name of a handler. |
static java.lang.String |
XMLRPC_HANDLER_NAME
Key for an object which handles an XmlRpc request |
static java.lang.String |
XMLRPC_SERVER_URL
Key for XML-RPC server URL in configuration file. |
protected static org.apache.log4j.Logger |
xmlRpcModuleLog
A logger for XmlRpcModule s |
Fields inherited from class de.dfki.lt.hog.Module |
---|
CONFIG_SEARCH_PATH_PROP, LINE_SEPARATOR, MODULE_DEPTH_PROP, MODULE_LANGUAGE_PROP, MODULE_NAME_PROP, MODULE_ROOTELEMENT_PROP, moduleLog, NO, NONE, ROOT, YES |
Constructor Summary | |
---|---|
XmlRpcModule()
|
Method Summary | |
---|---|
protected org.apache.xmlrpc.XmlRpcClient |
getXmlRpcClient()
Returns the XmlRpcClient of this
XmlRpcModule . |
java.lang.String |
getXmlRpcHandlerMethod()
Returns method name to which an XmlRpc request is past by a handler. |
java.lang.String |
getXmlRpcHandlerName()
Returns name of a class which can handle an XmlRpc request. |
java.lang.String |
getXmlRpcServerUrl()
Returns the URL of an XmlRpc server this XmlRpcModule
communicates with. |
protected void |
init(java.util.Properties xmlRpcModuleConfig)
Initializes basic field values like name, server URL and XMLRPC client, by a Properties object. |
abstract java.lang.String |
process(java.lang.String processString)
|
java.lang.String |
process(java.lang.String aHandlerCall,
java.util.Vector params)
Sends parameters to a remote module by an XmlRpcClient . |
abstract org.w3c.dom.Node |
processDOMTree(org.w3c.dom.Node domTree)
|
protected void |
setXmlRpcClient(org.apache.xmlrpc.XmlRpcClient aClient)
Sets the client for this XmlRpcModule |
protected void |
setXmlRpcHandlerMethod(java.lang.String aHandlerMethod)
Sets a method name to which an XmlRpc request is past by a handler |
protected void |
setXmlRpcHandlerName(java.lang.String aHandlerName)
Sets name name of a class which can handle an XmlRpc request. |
protected void |
setXmlRpcServerUrl(java.lang.String aServerUrl)
Sets the URL of an XmlRpc server this XmlRpcModule
communicates with. |
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.Module |
---|
getAbsolutOrRelativePath, getConfig, getFileProperty, getMoCoMan, getModuleDepth, getModuleLanguage, getModuleName, getModuleRootElement, getProperty, getProperty, searchConfigFile, searchConfigFile, setConfig, setMoCoMan, setModuleDepth, setModuleLanguage, setModuleName, setModuleRootElement, setProperty, shutdown, suitable |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String XMLRPC_SERVER_URL
public static final java.lang.String XMLRPC_HANDLER_NAME
public static final java.lang.String XMLRPC_HANDLER_METHOD
protected static org.apache.log4j.Logger xmlRpcModuleLog
XmlRpcModule
s
Constructor Detail |
---|
public XmlRpcModule()
Method Detail |
---|
protected org.apache.xmlrpc.XmlRpcClient getXmlRpcClient()
XmlRpcClient
of this
XmlRpcModule
.
protected void setXmlRpcClient(org.apache.xmlrpc.XmlRpcClient aClient)
XmlRpcModule
aClient
- XmlRpcClient
for this modulepublic java.lang.String getXmlRpcServerUrl()
XmlRpcModule
communicates with.
String
protected void setXmlRpcServerUrl(java.lang.String aServerUrl)
XmlRpcModule
communicates with.
aServerUrl
- an URL as String
public java.lang.String getXmlRpcHandlerName()
protected void setXmlRpcHandlerName(java.lang.String aHandlerName)
aHandlerName
- class namepublic java.lang.String getXmlRpcHandlerMethod()
protected void setXmlRpcHandlerMethod(java.lang.String aHandlerMethod)
aHandlerMethod
- method name for a handlerprotected void init(java.util.Properties xmlRpcModuleConfig) throws InitializationException
Properties
object.
First, init()
of Module
is called;
then all other field values are set by their corresponding
set
methods.
init
in class Module
xmlRpcModuleConfig
-
InitializationException
Module.init(java.util.Properties)
public void start(java.lang.String aModuleName)
XmlRpcClientInterface
XmlRpcModule
and could start an
adaptor via a shell or Python script, for example.
start
in interface XmlRpcClientInterface
aModuleName
- name of the module to startpublic java.lang.String process(java.lang.String aHandlerCall, java.util.Vector params)
XmlRpcClientInterface
XmlRpcClient
.
Calls therefore the execute
method of XmlRpcClient
.
process
in interface XmlRpcClientInterface
aHandlerCall
- name of a method which process params
remotelyparams
- paramters for remote methodpublic void shutdown(java.lang.String aModuleName)
XmlRpcClientInterface
shutdown
in interface XmlRpcClientInterface
aModuleName
- name of the module to shut downpublic abstract java.lang.String process(java.lang.String processString)
process
in class Module
public abstract org.w3c.dom.Node processDOMTree(org.w3c.dom.Node domTree)
processDOMTree
in class Module
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |