|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.rmi.server.RemoteObject java.rmi.server.RemoteServer java.rmi.server.UnicastRemoteObject org.xmlBlaster.client.protocol.rmi.RmiCallbackServer
public class 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 | |
---|---|
private CallbackAddress |
callbackAddress
|
private java.lang.String |
callbackRmiServerBindName
The name for the RMI registry |
private I_CallbackExtended |
client
|
static int |
DEFAULT_REGISTRY_PORT
XmlBlaster RMI registry listen port is 1099, to register callback server |
private Global |
glob
|
private static java.util.logging.Logger |
log
|
private java.lang.String |
loginName
|
private java.lang.String |
ME
|
private RmiUrl |
rmiUrl
|
Fields inherited from class java.rmi.server.RemoteObject |
---|
ref |
Constructor Summary | |
---|---|
RmiCallbackServer()
|
Method Summary | |
---|---|
private void |
bindToRegistry(I_XmlBlasterCallback callbackRmiServer)
Publish the RMI xmlBlaster server to rmi registry. |
void |
createCallbackServer(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 |
---|
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 java.lang.String callbackRmiServerBindName
public static final int DEFAULT_REGISTRY_PORT
private RmiUrl rmiUrl
private CallbackAddress callbackAddress
Constructor Detail |
---|
public RmiCallbackServer() throws java.rmi.RemoteException
java.rmi.RemoteException
Method Detail |
---|
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
glob
- 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(I_XmlBlasterCallback callbackRmiServer) throws XmlBlasterException
the
- BlasterCallback server
XmlBlasterException
- if the BlasterCallback server can't be created
id="CallbackCreationError"private void bindToRegistry(I_XmlBlasterCallback callbackRmiServer) throws XmlBlasterException
XmlBlasterException
- RMI registry error handlingpublic 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_CallbackServer
XmlBlasterException
public void shutdown()
shutdown
in interface I_CallbackServer
shutdown
in interface I_Plugin
public java.lang.String[] update(java.lang.String cbSessionId, MsgUnitRaw[] msgUnitArr) throws java.rmi.RemoteException, XmlBlasterException
update
in interface I_XmlBlasterCallback
msgUnitArr
- 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 I_XmlBlasterCallback
java.rmi.RemoteException
public java.lang.String ping(java.lang.String qos) throws java.rmi.RemoteException
ping
in interface I_XmlBlasterCallback
java.rmi.RemoteException
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 |