|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xmlBlaster.client.protocol.xmlrpc.XmlRpcCallbackServer
public class XmlRpcCallbackServer
Example for a XmlRpc callback implementation.
You can use this default callback handling with your clients, but if you need other handling of callbacks, take a copy of this Callback implementation and add your own code. The xmlBlaster callback client call the update() from XmlRpcCallbackImpl which delegates it to this update() method.-dispatch/callback/plugin/xmlrpc/port Specify a port number where xmlrpc callback webserver listens. Default is port 8081, the port 0 switches this feature off. -dispatch/callback/plugin/xmlrpc/hostname Specify a hostname where xmlrp callback server runs. Default is the localhost.If the callback server can't be established because of the port is not free, this driver loops and tries with a port number one higher until it finds a free port to listen for callbacks.
Nested Class Summary | |
---|---|
private class |
XmlRpcCallbackServer.CbRunner
|
Field Summary | |
---|---|
CallbackAddress |
callbackAddress
|
private I_CallbackExtended |
client
|
static int |
DEFAULT_CALLBACK_PORT
XmlBlaster XMLRPC callback web server listen port is 8081 |
private Global |
glob
|
private static java.util.logging.Logger |
log
|
private java.lang.String |
loginName
|
private java.lang.String |
ME
|
protected PluginInfo |
pluginInfo
|
private XmlRpcCallbackServer.CbRunner |
singleChRunner
|
private org.apache.xmlrpc.webserver.WebServer |
webServer
|
private XmlRpcUrl |
xmlRpcUrlCallback
Holds the XmlRpc URL string of the callback server |
Constructor Summary | |
---|---|
XmlRpcCallbackServer()
You must call initialize after constructing me |
Method Summary | |
---|---|
private void |
createCallbackServer(boolean useCDATA)
Building a Callback server, using the tie approach. |
java.lang.String |
getCbAddress()
Returns the current callback address. |
java.lang.String |
getCbProtocol()
Returns the 'well known' protocol type. |
private XmlScriptSerializer |
getSerializer()
|
java.lang.String |
getType()
Enforced by I_Plugin |
java.lang.String |
getVersion()
Enforced by I_Plugin |
private XmlRpcConnection |
getXmlRpcConnection()
|
void |
init(Global glob,
PluginInfo pluginInfo)
This method is called by the PluginManager (enforced by I_Plugin). |
void |
initialize(Global glob,
java.lang.String name,
CallbackAddress callbackAddress,
I_CallbackExtended client)
Construct a persistently named object. |
java.lang.String |
ping(java.lang.String str)
Ping to check if the callback server is alive. |
void |
postInitialize()
|
void |
shutdown()
Shutdown the callback server. |
java.lang.String |
update(java.lang.String cbSessionId,
java.lang.String updateKey,
byte[] content,
java.lang.String updateQos)
The update method. |
void |
updateOneway(java.lang.String cbSessionId,
java.lang.String updateKey,
byte[] content,
java.lang.String updateQos)
The 'oneway' update method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.lang.String ME
private Global glob
private static java.util.logging.Logger log
private I_CallbackExtended client
private java.lang.String loginName
private XmlRpcUrl xmlRpcUrlCallback
public static final int DEFAULT_CALLBACK_PORT
public CallbackAddress callbackAddress
private org.apache.xmlrpc.webserver.WebServer webServer
protected PluginInfo pluginInfo
private XmlRpcCallbackServer.CbRunner singleChRunner
Constructor Detail |
---|
public XmlRpcCallbackServer()
Method Detail |
---|
private XmlRpcConnection getXmlRpcConnection()
private XmlScriptSerializer getSerializer()
public java.lang.String getType()
getType
in interface I_Plugin
public java.lang.String getVersion()
getVersion
in interface I_Plugin
public void init(Global glob, PluginInfo pluginInfo)
init
in interface I_Plugin
I_Plugin.init(org.xmlBlaster.util.Global,org.xmlBlaster.util.plugin.PluginInfo)
public void initialize(Global glob, java.lang.String name, CallbackAddress callbackAddress, I_CallbackExtended client) throws XmlBlasterException
initialize
in interface I_CallbackServer
client
- Your implementation of I_CallbackExtended, or null if you don't want any updates.glob
- The global handle with your environment settingsname
- The login name of the client, for logging onlycallbackAddress
- The address configuration of this callback server
XmlBlasterException
public void postInitialize() throws XmlBlasterException
XmlBlasterException
private void createCallbackServer(boolean useCDATA) throws XmlBlasterException
the
- BlasterCallback server
XmlBlasterException
- if the BlasterCallback server can't be created
id="CallbackCreationError"public java.lang.String getCbProtocol()
getCbProtocol
in interface I_CallbackServer
public java.lang.String getCbAddress() throws XmlBlasterException
getCbAddress
in interface I_CallbackServer
XmlBlasterException
public void shutdown()
shutdown
in interface I_CallbackServer
shutdown
in interface I_Plugin
public java.lang.String update(java.lang.String cbSessionId, java.lang.String updateKey, byte[] content, java.lang.String updateQos) throws XmlBlasterException
XmlBlasterException
public void updateOneway(java.lang.String cbSessionId, java.lang.String updateKey, byte[] content, java.lang.String updateQos)
public java.lang.String ping(java.lang.String str)
I_CallbackDriver.ping(String)
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |