org.codehaus.plexus.xmlrpc

Class DefaultXmlRpcComponent

public class DefaultXmlRpcComponent extends AbstractLogEnabled implements Contextualizable, Initializable, Startable, XmlRpcComponent

Version: $Id: DefaultXmlRpcComponent.java 2752 2005-10-24 10:41:24Z evenisse $

Author: Jason van Zyl

UNKNOWN: Handle XmlRpc.setDebug(boolean)

Field Summary
ListacceptedClients
Accepted Clients.
PlexusContainercontainer
ListdeniedClients
Denied Clients.
Listhandlers
Handlers.
booleanisInitialized
booleanisSecureServer
Secure server state.
Listlisteners
Message Listeners.
booleanparanoid
Paranoid state.
intport
The port to listen on.
StringsaxParserClass
SAX Parser class.
PropertiessystemProperties
A set of properties to configure SSL and JSSE
XmlRpcServerxmlRpcServer
The standalone xmlrpc server.
Method Summary
voidacceptClient(String address)
Add an IP address to the list of accepted clients.
voidaddMessageListener(XmlRpcMessageListener listener)
Add message listener.
voidcontextualize(Context context)
voiddenyClient(String address)
Add an IP address to the list of denied clients.
ObjectexecuteRpc(URL url, String methodName, Vector params)
Client's interface to XML-RPC.
StringgetClient(List list, int index)
voidinitialize()
voidmessageReceived(String message)
Message received.
voidregisterComponentHandler(String handlerName, String handlerRole)
Helper that registers a component as a handler with the specified handler name.
voidregisterHandler(Object handler)
Register an Object as a default handler for the service.
voidregisterHandler(String handlerName, Object handler)
Register an Object as a handler for the service.
voidregisterStartupHandlers()
Registers any handlers that were defined as part this component's configuration.
voidsetParanoid(boolean state)
Switch client filtering on/off.
voidsetSystemPropertiesFromConfiguration()
Create System properties using the key-value pairs in a given Configuration.
voidstart()
voidstop()
voidunregisterHandler(String handlerName)
Unregister a handler.

Field Detail

acceptedClients

private List acceptedClients
Accepted Clients.

container

private PlexusContainer container

deniedClients

private List deniedClients
Denied Clients.

handlers

private List handlers
Handlers.

isInitialized

private boolean isInitialized

isSecureServer

private boolean isSecureServer
Secure server state.

listeners

private List listeners
Message Listeners.

paranoid

private boolean paranoid
Paranoid state.

port

private int port
The port to listen on.

saxParserClass

private String saxParserClass
SAX Parser class.

systemProperties

private Properties systemProperties
A set of properties to configure SSL and JSSE

xmlRpcServer

private XmlRpcServer xmlRpcServer
The standalone xmlrpc server.

Method Detail

acceptClient

public void acceptClient(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.

Parameters: address The address to add to the list.

See Also: DefaultXmlRpcComponent DefaultXmlRpcComponent

addMessageListener

public void addMessageListener(XmlRpcMessageListener listener)
Add message listener.

contextualize

public void contextualize(Context context)

denyClient

public void denyClient(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.

Parameters: address The address to add to the list.

See Also: DefaultXmlRpcComponent DefaultXmlRpcComponent

executeRpc

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

Parameters: url A URL. methodName A String with the method name. params A Vector with the parameters.

Returns: An Object.

Throws: XmlRpcException IOException

getClient

private String getClient(List list, int index)

initialize

public void initialize()

messageReceived

public void messageReceived(String message)
Message received.

registerComponentHandler

private void registerComponentHandler(String handlerName, String handlerRole)
Helper that registers a component as a handler with the specified handler name.

Parameters: handlerName The name to register this handle as. handlerRole The role of the component serving as the handler.

Throws: Exception If the component could not be looked up.

registerHandler

public void registerHandler(Object handler)
Register an Object as a default handler for the service.

Parameters: handler The handler to use.

Throws: XmlRpcException IOException

registerHandler

public void registerHandler(String handlerName, Object handler)
Register an Object as a handler for the service.

Parameters: handlerName The name the handler is registered under. handler The handler to use.

Throws: XmlRpcException If an XmlRpcException occurs. IOException If an IOException occurs.

registerStartupHandlers

private void registerStartupHandlers()
Registers any handlers that were defined as part this component's configuration. A handler may be defined as a class (which will be instantiated) or as a role in which case it will be looked up.

Throws: Exception If there were errors registering a handler.

setParanoid

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

Parameters: state Whether to filter clients.

See Also: DefaultXmlRpcComponent DefaultXmlRpcComponent

setSystemPropertiesFromConfiguration

private void setSystemPropertiesFromConfiguration()
Create System properties using the key-value pairs in a given Configuration. This is used to set system properties and the URL https connection handler needed by JSSE to enable SSL between XMLRPC client and server.

start

public void start()

stop

public void stop()

unregisterHandler

public void unregisterHandler(String handlerName)
Unregister a handler.

Parameters: handlerName The name of the handler to unregister.