|
xmlBlaster 1.6.2 client API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
org.xmlBlaster.client.protocol.rmi.RmiCallbackServer
Example for a RMI 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. A rmi-registry server is created automatically, if there is running already one, that is used.
-dispatch/callback/plugin/rmi/registryPort Specify a port number where rmiregistry listens.
Default is port 1099, the port 0 switches this feature off.
-dispatch/callback/plugin/rmi/hostname Specify a hostname where rmiregistry runs.
Default is the localhost.
Note: The security manager must be initialized properly before you use an instance of this class.
java -Djava.rmi.server.codebase=file:///${XMLBLASTER_HOME}/classes/ \
-Djava.security.policy=${XMLBLASTER_HOME}/config/xmlBlaster.policy \
-Djava.rmi.server.hostname=hostname.domainname
MyApp -dispatch/connection/plugin/rmi/registryPort 2079
| Field Summary | |
static int |
DEFAULT_REGISTRY_PORT
XmlBlaster RMI registry listen port is 1099, to register callback server |
| Fields inherited from class java.rmi.server.RemoteObject |
ref |
| Constructor Summary | |
RmiCallbackServer()
|
|
| Method Summary | |
void |
createCallbackServer(org.xmlBlaster.protocol.rmi.I_XmlBlasterCallback callbackRmiServer)
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. |
java.lang.String |
getType()
Enforced by I_Plugin |
java.lang.String |
getVersion()
Enforced by I_Plugin |
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 the callback server. |
java.lang.String |
ping(java.lang.String qos)
Ping to check if the xmlBlaster server is alive. |
void |
shutdown()
Shutdown the callback server. |
java.lang.String[] |
update(java.lang.String cbSessionId,
MsgUnitRaw[] msgUnitArr)
This is the callback method invoked from xmlBlaster informing the client in an asynchronous mode about new messages. |
void |
updateOneway(java.lang.String cbSessionId,
MsgUnitRaw[] msgUnitArr)
The oneway variant for better performance. |
| Methods inherited from class java.rmi.server.UnicastRemoteObject |
clone, exportObject, exportObject, exportObject, unexportObject |
| Methods inherited from class java.rmi.server.RemoteServer |
getClientHost, getLog, setLog |
| Methods inherited from class java.rmi.server.RemoteObject |
equals, getRef, hashCode, toString, toStub |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int DEFAULT_REGISTRY_PORT
| Constructor Detail |
public RmiCallbackServer()
throws java.rmi.RemoteException
| Method Detail |
public java.lang.String getType()
getType in interface I_Pluginpublic java.lang.String getVersion()
getVersion in interface I_Plugin
public void init(Global glob,
PluginInfo pluginInfo)
init in interface I_PluginI_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_CallbackServerglob - The global handle with your environment settingsname - The login name of the client, for logging onlycallbackAddress - The address configuration of this callback serverclient - Your implementation to receive the callback messages from xmlBlaster
XmlBlasterException
public void createCallbackServer(org.xmlBlaster.protocol.rmi.I_XmlBlasterCallback callbackRmiServer)
throws XmlBlasterException
XmlBlasterException - if the BlasterCallback server can't be created
id="CallbackCreationError"public final java.lang.String getCbProtocol()
I_CallbackServer
getCbProtocol in interface I_CallbackServer
public java.lang.String getCbAddress()
throws XmlBlasterException
I_CallbackServer
getCbAddress in interface I_CallbackServerXmlBlasterExceptionpublic void shutdown()
shutdown in interface I_CallbackServer
public java.lang.String[] update(java.lang.String cbSessionId,
MsgUnitRaw[] msgUnitArr)
throws java.rmi.RemoteException,
XmlBlasterException
update in interface org.xmlBlaster.protocol.rmi.I_XmlBlasterCallbackmsgUnitArr - Contains a MsgUnitRaw structs (your message) for CORBA
java.rmi.RemoteException
XmlBlasterException
public void updateOneway(java.lang.String cbSessionId,
MsgUnitRaw[] msgUnitArr)
throws java.rmi.RemoteException
updateOneway in interface org.xmlBlaster.protocol.rmi.I_XmlBlasterCallbackjava.rmi.RemoteException
public java.lang.String ping(java.lang.String qos)
throws java.rmi.RemoteException
ping in interface org.xmlBlaster.protocol.rmi.I_XmlBlasterCallbackjava.rmi.RemoteExceptionI_CallbackDriver.ping(String)
|
xmlBlaster 1.6.2 client API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||