org.codehaus.plexus.xmlrpc
Class DefaultXmlRpcComponent

java.lang.Object
  extended by org.codehaus.plexus.logging.AbstractLogEnabled
      extended by org.codehaus.plexus.xmlrpc.DefaultXmlRpcComponent
All Implemented Interfaces:
org.codehaus.plexus.logging.LogEnabled, org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable, org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable, org.codehaus.plexus.personality.plexus.lifecycle.phase.Startable, XmlRpcComponent

public class DefaultXmlRpcComponent
extends org.codehaus.plexus.logging.AbstractLogEnabled
implements org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable, org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable, org.codehaus.plexus.personality.plexus.lifecycle.phase.Startable, XmlRpcComponent

Version:
$Id: DefaultXmlRpcComponent.java 2752 2005-10-24 10:41:24Z evenisse $
Author:
Jason van Zyl

Field Summary
 
Fields inherited from interface org.codehaus.plexus.xmlrpc.XmlRpcComponent
ROLE
 
Constructor Summary
DefaultXmlRpcComponent()
           
 
Method Summary
 void acceptClient(java.lang.String address)
          Add an IP address to the list of accepted clients.
 void addMessageListener(XmlRpcMessageListener listener)
          Add message listener.
 void contextualize(org.codehaus.plexus.context.Context context)
           
 void denyClient(java.lang.String address)
          Add an IP address to the list of denied clients.
 java.lang.Object executeRpc(java.net.URL url, java.lang.String methodName, java.util.Vector params)
          Client's interface to XML-RPC.
 void initialize()
           
 void messageReceived(java.lang.String message)
          Message received.
 void registerHandler(java.lang.Object handler)
          Register an Object as a default handler for the service.
 void registerHandler(java.lang.String handlerName, java.lang.Object handler)
          Register an Object as a handler for the service.
 void setParanoid(boolean state)
          Switch client filtering on/off.
 void start()
           
 void stop()
           
 void unregisterHandler(java.lang.String handlerName)
          Unregister a handler.
 
Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultXmlRpcComponent

public DefaultXmlRpcComponent()
Method Detail

contextualize

public void contextualize(org.codehaus.plexus.context.Context context)
                   throws org.codehaus.plexus.context.ContextException
Specified by:
contextualize in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable
Throws:
org.codehaus.plexus.context.ContextException

initialize

public void initialize()
                throws org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException
Specified by:
initialize in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable
Throws:
org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException

start

public void start()
           throws org.codehaus.plexus.personality.plexus.lifecycle.phase.StartingException
Specified by:
start in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Startable
Throws:
org.codehaus.plexus.personality.plexus.lifecycle.phase.StartingException

stop

public void stop()
          throws org.codehaus.plexus.personality.plexus.lifecycle.phase.StoppingException
Specified by:
stop in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Startable
Throws:
org.codehaus.plexus.personality.plexus.lifecycle.phase.StoppingException

registerHandler

public void registerHandler(java.lang.Object handler)
                     throws org.apache.xmlrpc.XmlRpcException,
                            java.io.IOException
Register an Object as a default handler for the service.

Specified by:
registerHandler in interface XmlRpcComponent
Parameters:
handler - The handler to use.
Throws:
org.apache.xmlrpc.XmlRpcException
java.io.IOException

registerHandler

public void registerHandler(java.lang.String handlerName,
                            java.lang.Object handler)
                     throws org.apache.xmlrpc.XmlRpcException,
                            java.io.IOException
Register an Object as a handler for the service.

Specified by:
registerHandler in interface XmlRpcComponent
Parameters:
handlerName - The name the handler is registered under.
handler - The handler to use.
Throws:
org.apache.xmlrpc.XmlRpcException - If an XmlRpcException occurs.
java.io.IOException - If an IOException occurs.

unregisterHandler

public void unregisterHandler(java.lang.String handlerName)
                       throws org.apache.xmlrpc.XmlRpcException
Unregister a handler.

Specified by:
unregisterHandler in interface XmlRpcComponent
Parameters:
handlerName - The name of the handler to unregister.
Throws:
org.apache.xmlrpc.XmlRpcException

executeRpc

public java.lang.Object executeRpc(java.net.URL url,
                                   java.lang.String methodName,
                                   java.util.Vector params)
                            throws java.lang.Exception
Client's interface to XML-RPC. The return type is Object which you'll need to cast to whatever you are expecting.

Specified by:
executeRpc in interface XmlRpcComponent
Parameters:
url - A URL.
methodName - A String with the method name.
params - A Vector with the parameters.
Returns:
An Object.
Throws:
org.apache.xmlrpc.XmlRpcException
java.io.IOException
java.lang.Exception

setParanoid

public void setParanoid(boolean state)
Switch client filtering on/off.

Specified by:
setParanoid in interface XmlRpcComponent
Parameters:
state - Whether to filter clients.
See Also:
acceptClient(java.lang.String), denyClient(java.lang.String)

acceptClient

public void acceptClient(java.lang.String address)
Add an IP address to the list of accepted clients. The parameter can contain '*' as wildcard character, e.g. "192.168.*.*". You must call setParanoid(true) in order for this to have any effect.

Specified by:
acceptClient in interface XmlRpcComponent
Parameters:
address - The address to add to the list.
See Also:
denyClient(java.lang.String), setParanoid(boolean)

denyClient

public void denyClient(java.lang.String address)
Add an IP address to the list of denied clients. The parameter can contain '*' as wildcard character, e.g. "192.168.*.*". You must call setParanoid(true) in order for this to have any effect.

Specified by:
denyClient in interface XmlRpcComponent
Parameters:
address - The address to add to the list.
See Also:
acceptClient(java.lang.String), setParanoid(boolean)

addMessageListener

public void addMessageListener(XmlRpcMessageListener listener)
Add message listener.

Specified by:
addMessageListener in interface XmlRpcComponent

messageReceived

public void messageReceived(java.lang.String message)
Message received.

Specified by:
messageReceived in interface XmlRpcComponent


Copyright © 2001-2010 Codehaus. All Rights Reserved.