|
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.rmi.RmiConnection
public class RmiConnection
This is a helper class, helping a Java client to connect to xmlBlaster using RMI.
Please note that you don't need to use this wrapper, you can use the raw RMI interface as well. You can also hack your own little wrapper, which does exactly what you want.
There is a constructor for applets, and standalone Java clients.
If you need a failsafe client, you can invoke the xmlBlaster RMI methods through this class as well (for example use rmiConnection.publish() instead of the direct RMI server.publish()). If you want to connect from a servlet, please use the framework in xmlBlaster/src/java/org/xmlBlaster/protocol/http# Configure RMI plugin to load: ClientProtocolPlugin[RMI][1.0]=org.xmlBlaster.client.protocol.rmi.RmiConnection
Field Summary | |
---|---|
private I_AuthServer |
authServer
|
private I_XmlBlaster |
blasterServer
|
protected Address |
clientAddress
|
static int |
DEFAULT_REGISTRY_PORT
XmlBlaster RMI registry listen port is 1099, to access for bootstrapping |
private Global |
glob
|
private static java.util.logging.Logger |
log
|
private java.lang.String |
ME
|
private RmiUrl |
rmiUrl
|
private java.lang.String |
sessionId
|
private boolean |
verbose
|
Constructor Summary | |
---|---|
RmiConnection()
Called by plugin loader which calls init(Global, PluginInfo) thereafter. |
|
RmiConnection(Global glob)
RMI client access to xmlBlaster for normal client applications. |
|
RmiConnection(Global glob,
java.applet.Applet ap)
RMI client access to xmlBlaster for applets. |
Method Summary | |
---|---|
java.lang.String |
connect(java.lang.String connectQos)
Login to the server. |
void |
connectLowlevel(Address address)
Connect to RMI server. |
boolean |
disconnect(java.lang.String disconnectQos)
Logout from the server. |
java.lang.String[] |
erase(java.lang.String xmlKey,
java.lang.String qos)
|
MsgUnitRaw[] |
get(java.lang.String xmlKey,
java.lang.String qos)
|
java.lang.String |
getProtocol()
|
java.lang.String |
getType()
Enforced by I_Plugin |
java.lang.String |
getVersion()
Enforced by I_Plugin |
private I_XmlBlaster |
getXmlBlaster()
Accessing the xmlBlaster handle. |
void |
init(Global glob,
PluginInfo pluginInfo)
This method is called by the PluginManager (enforced by I_Plugin). |
boolean |
isLoggedIn()
|
private java.rmi.Remote |
lookup(java.lang.String addr)
Connect to RMI server. |
java.lang.String |
ping(java.lang.String str)
Check server. |
java.lang.String |
publish(MsgUnitRaw msgUnit)
Publish fault-tolerant the given message. |
java.lang.String[] |
publishArr(MsgUnitRaw[] msgUnitArr)
|
void |
publishOneway(MsgUnitRaw[] msgUnitArr)
RMI does not support oneway messages. |
I_ProgressListener |
registerProgressListener(I_ProgressListener listener)
Register a listener for to receive information about the progress of incoming data. |
void |
resetConnection()
Reset |
void |
setConnectReturnQos(ConnectReturnQos connectReturnQos)
Pass the driver the decrypted and parsed ConnectReturnQos directly after a connect. |
void |
shutdown()
Shut down. |
java.lang.String |
subscribe(java.lang.String xmlKey,
java.lang.String qos)
Enforced by I_XmlBlasterConnection interface (failsafe mode). |
java.lang.String[] |
unSubscribe(java.lang.String xmlKey,
java.lang.String qos)
Enforced by I_XmlBlasterConnection interface (failsafe mode) |
static 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 |
---|
private java.lang.String ME
private Global glob
private static java.util.logging.Logger log
private I_AuthServer authServer
private I_XmlBlaster blasterServer
private java.lang.String sessionId
protected Address clientAddress
private RmiUrl rmiUrl
public static final int DEFAULT_REGISTRY_PORT
private boolean verbose
Constructor Detail |
---|
public RmiConnection()
public RmiConnection(Global glob) throws XmlBlasterException
arg
- parameters given on command line
XmlBlasterException
public RmiConnection(Global glob, java.applet.Applet ap) throws XmlBlasterException
ap
- Applet handle
XmlBlasterException
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) throws XmlBlasterException
init
in interface I_Plugin
XmlBlasterException
I_Plugin.init(org.xmlBlaster.util.Global,org.xmlBlaster.util.plugin.PluginInfo)
public void connectLowlevel(Address address) throws XmlBlasterException
connectLowlevel
in interface I_XmlBlasterConnection
address
- Contains the remote address,
e.g. the host and port where the remote server listens
XmlBlasterException
- ErrorCode.COMMUNICATION* if the server is not reachable,
in this case we can poll for the server.private java.rmi.Remote lookup(java.lang.String addr) throws XmlBlasterException
XmlBlasterException
I_XmlBlasterConnection.connectLowlevel(Address)
public void resetConnection()
resetConnection
in interface I_XmlBlasterConnection
private I_XmlBlaster getXmlBlaster() throws XmlBlasterException
XmlBlasterException
public final java.lang.String getProtocol()
getProtocol
in interface I_XmlBlasterConnection
public java.lang.String connect(java.lang.String connectQos) throws XmlBlasterException
connect
in interface I_XmlBlasterConnection
connectQos
- The encrypted connect QoS
XmlBlasterException
- if login failspublic void setConnectReturnQos(ConnectReturnQos connectReturnQos)
I_XmlBlasterConnection
setConnectReturnQos
in interface I_XmlBlasterConnection
I_XmlBlasterConnection.setConnectReturnQos(ConnectReturnQos)
public boolean disconnect(java.lang.String disconnectQos)
disconnect
in interface I_XmlBlasterConnection
disconnectQos
- The QoS or null
public void shutdown() throws XmlBlasterException
shutdown
in interface I_XmlBlasterConnection
shutdown
in interface I_Plugin
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.public boolean isLoggedIn()
isLoggedIn
in interface I_XmlBlasterConnection
public final java.lang.String subscribe(java.lang.String xmlKey, java.lang.String qos) throws XmlBlasterException
subscribe
in interface I_XmlBlasterConnection
XmlBlasterException
public final java.lang.String[] unSubscribe(java.lang.String xmlKey, java.lang.String qos) throws XmlBlasterException
unSubscribe
in interface I_XmlBlasterConnection
XmlBlasterException
public final java.lang.String publish(MsgUnitRaw msgUnit) throws XmlBlasterException
publish
in interface I_XmlBlasterConnection
XmlBlasterException
public java.lang.String[] publishArr(MsgUnitRaw[] msgUnitArr) throws XmlBlasterException
publishArr
in interface I_XmlBlasterConnection
XmlBlasterException
public void publishOneway(MsgUnitRaw[] msgUnitArr) throws XmlBlasterException
publishOneway
in interface I_XmlBlasterConnection
XmlBlasterException
public final java.lang.String[] erase(java.lang.String xmlKey, java.lang.String qos) throws XmlBlasterException
erase
in interface I_XmlBlasterConnection
XmlBlasterException
public final MsgUnitRaw[] get(java.lang.String xmlKey, java.lang.String qos) throws XmlBlasterException
get
in interface I_XmlBlasterConnection
XmlBlasterException
public I_ProgressListener registerProgressListener(I_ProgressListener listener)
registerProgressListener
in interface I_XmlBlasterConnection
listener
- Your listener, pass 0 to unregister.
public java.lang.String ping(java.lang.String str) throws XmlBlasterException
ping
in interface I_XmlBlasterConnection
XmlBlasterException
public static java.lang.String usage()
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |