xmlBlaster 2.2.0 API

org.xmlBlaster.protocol.xmlrpc
Class XmlRpcDriver

java.lang.Object
  extended by org.xmlBlaster.protocol.xmlrpc.XmlRpcDriver
All Implemented Interfaces:
I_Driver, XmlRpcDriverMBean, I_AdminPlugin, I_AdminService, I_AdminUsage, I_Plugin

public class XmlRpcDriver
extends java.lang.Object
implements I_Driver, XmlRpcDriverMBean

XmlRpc driver class to invoke the xmlBlaster server over HTTP XMLRPC.

This driver needs to be registered in xmlBlaster.properties and will be started on xmlBlaster startup, for example:

 ProtocolPlugin[XMLRPC][1.0]=org.xmlBlaster.protocol.xmlrpc.XmlRpcDriver
 CbProtocolPlugin[XMLRPC][1.0]=org.xmlBlaster.protocol.xmlrpc.CallbackXmlRpcDriver
 
The variable plugin/xmlrpc/port (default 8080) sets the http web server port, you may change it in xmlBlaster.properties or on command line:
 java -jar lib/xmlBlaster.jar  -plugin/xmlrpc/port 9080
 
The interface I_Driver is needed by xmlBlaster to instantiate and shutdown this driver implementation.

Author:
xmlBlaster@marcelruff.info
See Also:
The protocol.xmlrpc requirement, Configuring SSL with XmlRpc

Field Summary
private  AddressServer addressServer
          Our configuration
private  I_Authenticate authenticate
          The singleton handle for this xmlBlaster server
protected  ContextNode contextNode
           
static int DEFAULT_HTTP_PORT
           
private  Global glob
           
protected  boolean isActive
           
private static java.util.logging.Logger log
           
protected  java.lang.Object mbeanHandle
          My JMX registration, can be done optionally by implementing classes
private  java.lang.String ME
           
private  PluginInfo pluginInfo
           
private  org.apache.xmlrpc.webserver.WebServer webServer
          The xml-rpc HTTP web server
private  I_XmlBlaster xmlBlasterImpl
          The singleton handle for this xmlBlaster server
private  XmlRpcUrl xmlRpcUrl
          The URL which clients need to use to access this server
 
Constructor Summary
XmlRpcDriver()
           
 
Method Summary
 void activate()
          Activate xmlBlaster access through this protocol.
 void deActivate()
          Deactivate xmlBlaster access (standby), no clients can connect.
 AddressServer getAddressServer()
          The server configuration of this plugin
 java.lang.String getEnvPrefix()
           
 java.lang.String getName()
          Get a human readable name of this driver.
 java.lang.String getProtocolId()
          Access the xmlBlaster internal name of the protocol driver.
 java.lang.String getRawAddress()
          Get the address how to access this driver.
 java.lang.String getType()
          Enforced by I_Plugin
 java.lang.String getUsageUrl()
           
 java.lang.String getVersion()
          Enforced by I_Plugin
private  void init(Global glob, AddressServer addressServer, I_Authenticate authenticate, I_XmlBlaster xmlBlasterImpl)
          Start xmlBlaster XMLRPC access.
 void init(Global glob, PluginInfo pluginInfo)
          This method is called by the PluginManager (enforced by I_Plugin).
 boolean isActive()
          JMX
 boolean isShutdown()
          JMX
 void setUsageUrl(java.lang.String url)
           
 void shutdown()
          Instructs XMLRPC driver to shut down.
 java.lang.String usage()
          Command line usage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ME

private java.lang.String ME

glob

private Global glob

pluginInfo

private PluginInfo pluginInfo

log

private static java.util.logging.Logger log

authenticate

private I_Authenticate authenticate
The singleton handle for this xmlBlaster server


xmlBlasterImpl

private I_XmlBlaster xmlBlasterImpl
The singleton handle for this xmlBlaster server


DEFAULT_HTTP_PORT

public static final int DEFAULT_HTTP_PORT
See Also:
Constant Field Values

webServer

private org.apache.xmlrpc.webserver.WebServer webServer
The xml-rpc HTTP web server


xmlRpcUrl

private XmlRpcUrl xmlRpcUrl
The URL which clients need to use to access this server


addressServer

private AddressServer addressServer
Our configuration


mbeanHandle

protected java.lang.Object mbeanHandle
My JMX registration, can be done optionally by implementing classes


contextNode

protected ContextNode contextNode

isActive

protected boolean isActive
Constructor Detail

XmlRpcDriver

public XmlRpcDriver()
Method Detail

getName

public java.lang.String getName()
Get a human readable name of this driver.

Enforced by interface I_Driver.

Specified by:
getName in interface I_Driver

getProtocolId

public java.lang.String getProtocolId()
Access the xmlBlaster internal name of the protocol driver.

Specified by:
getProtocolId in interface I_Driver
Returns:
"XMLRPC"

getType

public java.lang.String getType()
Enforced by I_Plugin

Specified by:
getType in interface I_AdminPlugin
Specified by:
getType in interface I_Plugin
Returns:
For example "IOR"

getVersion

public java.lang.String getVersion()
Enforced by I_Plugin

Specified by:
getVersion in interface I_AdminPlugin
Specified by:
getVersion in interface I_Plugin
Returns:
For example "1.0"

init

public void init(Global glob,
                 PluginInfo pluginInfo)
          throws XmlBlasterException
This method is called by the PluginManager (enforced by I_Plugin).

Specified by:
init in interface I_Plugin
Throws:
XmlBlasterException
See Also:
I_Plugin.init(org.xmlBlaster.util.Global,org.xmlBlaster.util.plugin.PluginInfo)

getRawAddress

public java.lang.String getRawAddress()
Get the address how to access this driver.

Specified by:
getRawAddress in interface I_Driver
Specified by:
getRawAddress in interface XmlRpcDriverMBean
Returns:
"http://server.mars.universe:8080/"

init

private void init(Global glob,
                  AddressServer addressServer,
                  I_Authenticate authenticate,
                  I_XmlBlaster xmlBlasterImpl)
           throws XmlBlasterException
Start xmlBlaster XMLRPC access.

Enforced by interface I_Driver.

Parameters:
glob - Global handle to access logging, property and commandline args
authenticate - Handle to access authentication server
xmlBlasterImpl - Handle to access xmlBlaster core
Throws:
XmlBlasterException

getAddressServer

public AddressServer getAddressServer()
The server configuration of this plugin


activate

public void activate()
              throws XmlBlasterException
Activate xmlBlaster access through this protocol.

Specified by:
activate in interface I_Driver
Specified by:
activate in interface I_AdminService
Throws:
XmlBlasterException

deActivate

public void deActivate()
Deactivate xmlBlaster access (standby), no clients can connect.

Specified by:
deActivate in interface I_Driver
Specified by:
deActivate in interface I_AdminService

shutdown

public void shutdown()
              throws XmlBlasterException
Instructs XMLRPC driver to shut down.

Enforced by interface I_Driver.

Specified by:
shutdown in interface I_AdminPlugin
Specified by:
shutdown in interface I_Plugin
Throws:
XmlBlasterException - if an exception occurs. The exception is handled by the RunLevelManager depending on how the plugin has been configured with the action:

<action do='STOP' onShutdownRunlevel='2' sequence='5' onFail='resource.configuration.pluginFailed'> If onFail is defined to something, the RunLevelManager will stop.


getEnvPrefix

public java.lang.String getEnvPrefix()

usage

public java.lang.String usage()
Command line usage.

Enforced by interface I_Driver.

Specified by:
usage in interface I_Driver
Specified by:
usage in interface I_AdminUsage
Returns:
a human readable usage help string

getUsageUrl

public java.lang.String getUsageUrl()
Specified by:
getUsageUrl in interface I_AdminUsage
Returns:
A link for JMX usage

setUsageUrl

public void setUsageUrl(java.lang.String url)
Specified by:
setUsageUrl in interface I_AdminUsage

isActive

public boolean isActive()
JMX

Specified by:
isActive in interface I_AdminService
Returns:
true if active
See Also:
I_AdminService.isActive()

isShutdown

public boolean isShutdown()
JMX

Specified by:
isShutdown in interface I_AdminPlugin
Returns:
true if down
See Also:
I_AdminPlugin.isShutdown()

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.