xmlBlaster 2.2.0 API

org.xmlBlaster.client.dispatch
Class ClientDispatchConnection

java.lang.Object
  extended by org.xmlBlaster.util.dispatch.DispatchConnection
      extended by org.xmlBlaster.client.dispatch.ClientDispatchConnection
All Implemented Interfaces:
I_Timeout

public final class ClientDispatchConnection
extends DispatchConnection

Holding all necessary infos to establish callback connections and invoke their update().

Author:
xmlBlaster@marcelruff.info
See Also:
DispatchConnection

Field Summary
private  java.lang.String[] checkPointContext
           
private  MsgQueueEntry connectEntry
           
private  ConnectQosData connectQosData
           
private  ConnectReturnQos connectReturnQos
           
private  I_XmlBlasterConnection driver
           
private static java.util.logging.Logger log
           
private  java.lang.String ME
           
private  I_MsgSecurityInterceptor securityInterceptor
           
 
Fields inherited from class org.xmlBlaster.util.dispatch.DispatchConnection
address, connectionsHandler, glob, myId, physicalConnectionOk, PING_THREAD_NAME, previousBytesRead, previousBytesWritten, retryCounter, serverAcceptsRequests, state
 
Constructor Summary
ClientDispatchConnection(Global glob, ClientDispatchConnectionsHandler connectionsHandler, AddressBase address)
           
 
Method Summary
private  void connect(MsgQueueEntry entry)
          Encrypt and send a connect request, decrypt the returned data
 void connectLowlevel()
          Connect on protocol layer and try an initial low level ping.
private  void disconnect(MsgQueueEntry entry)
          Encrypt and send a disconnect request, decrypt the returned data
 java.lang.String doPing(java.lang.String data)
          Does the real ping to the remote server instance.
 void doSend(MsgQueueEntry[] msgArr_, boolean isAsyncMode)
          Send the messages to xmlBlaster.
private  void erase(MsgQueueEntry entry)
          Encrypt and send a erase request, decrypt the returned data
protected  boolean forcePingFailure()
           
private  void get(MsgQueueEntry entry)
          Encrypt and send a synchronous get request, decrypt the returned data
 java.lang.String getDriverName()
          A human readable name of the protocol plugin
private  java.lang.String getEncryptedConnectQos(ConnectQosData cqd)
          Remember the cqd in this.connectQosData and return the encrypted string.
 java.lang.String getName()
           
 void loadPlugin()
          Load the appropriate protocol driver, e.g the CORBA protocol plugin.
private  void publish(MsgQueueEntry[] msgArr_)
           
protected  void reconnect()
          On reconnect polling try to establish the connection.
 I_ProgressListener registerProgressListener(I_ProgressListener listener)
          Should be overwritten by extending classes.
 void resetConnection()
          Nothing to do here
private  void setCheckpointContext(ConnectReturnQos qr)
           
 void shutdown(boolean delayed)
          Stop all callback drivers of this client.
private  void subscribe(MsgQueueEntry entry)
          Encrypt and send a subscribe request, decrypt the returned data
 java.lang.String toXml(java.lang.String extraOffset)
          Dump state of this object into a XML ASCII string.
private  void unSubscribe(MsgQueueEntry entry)
          Encrypt and send a unSubscribe request, decrypt the returned data
 
Methods inherited from class org.xmlBlaster.util.dispatch.DispatchConnection
finalize, getAddress, getState, handleTransition, initialize, isAlive, isConnectionWasDown, isDead, isPolling, isUndef, ping, ping, send, setAddress, setConnectionWasDown, spanPingTimer, timeout
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static java.util.logging.Logger log

ME

private final java.lang.String ME

driver

private I_XmlBlasterConnection driver

securityInterceptor

private final I_MsgSecurityInterceptor securityInterceptor

connectQosData

private ConnectQosData connectQosData

connectReturnQos

private ConnectReturnQos connectReturnQos

checkPointContext

private java.lang.String[] checkPointContext

connectEntry

private MsgQueueEntry connectEntry
Constructor Detail

ClientDispatchConnection

public ClientDispatchConnection(Global glob,
                                ClientDispatchConnectionsHandler connectionsHandler,
                                AddressBase address)
                         throws XmlBlasterException
Parameters:
connectionsHandler - The DevliveryConnectionsHandler witch i belong to
aAddress - The address i shall connect to
Throws:
XmlBlasterException
Method Detail

getDriverName

public final java.lang.String getDriverName()
Description copied from class: DispatchConnection
A human readable name of the protocol plugin

Specified by:
getDriverName in class DispatchConnection

getName

public final java.lang.String getName()
Specified by:
getName in class DispatchConnection
Returns:
A nice name for logging

loadPlugin

public final void loadPlugin()
                      throws XmlBlasterException
Load the appropriate protocol driver, e.g the CORBA protocol plugin.

This method is called by our base class during initialization.

Specified by:
loadPlugin in class DispatchConnection
Throws:
XmlBlasterException

connectLowlevel

public final void connectLowlevel()
                           throws XmlBlasterException
Description copied from class: DispatchConnection
Connect on protocol layer and try an initial low level ping.

Specified by:
connectLowlevel in class DispatchConnection
Throws:
XmlBlasterException - with ErrorCode.COMMUNICATION* if server is not reachable or other exceptions on other errors
See Also:
DispatchConnection.connectLowlevel()

doSend

public void doSend(MsgQueueEntry[] msgArr_,
                   boolean isAsyncMode)
            throws XmlBlasterException
Send the messages to xmlBlaster.

Specified by:
doSend in class DispatchConnection
Parameters:
msgArr - The messages to send. msgArr[i].getReturnVal() will contain the returned QoS object or null for oneway operations
isAsyncMode - true if coming from queue
Throws:
XmlBlasterException

setCheckpointContext

private void setCheckpointContext(ConnectReturnQos qr)

publish

private void publish(MsgQueueEntry[] msgArr_)
              throws XmlBlasterException
Throws:
XmlBlasterException

subscribe

private void subscribe(MsgQueueEntry entry)
                throws XmlBlasterException
Encrypt and send a subscribe request, decrypt the returned data

Throws:
XmlBlasterException

unSubscribe

private void unSubscribe(MsgQueueEntry entry)
                  throws XmlBlasterException
Encrypt and send a unSubscribe request, decrypt the returned data

Throws:
XmlBlasterException

get

private void get(MsgQueueEntry entry)
          throws XmlBlasterException
Encrypt and send a synchronous get request, decrypt the returned data

Throws:
XmlBlasterException

erase

private void erase(MsgQueueEntry entry)
            throws XmlBlasterException
Encrypt and send a erase request, decrypt the returned data

Throws:
XmlBlasterException

getEncryptedConnectQos

private java.lang.String getEncryptedConnectQos(ConnectQosData cqd)
                                         throws XmlBlasterException
Remember the cqd in this.connectQosData and return the encrypted string.

Throws:
XmlBlasterException

connect

private void connect(MsgQueueEntry entry)
              throws XmlBlasterException
Encrypt and send a connect request, decrypt the returned data

Throws:
XmlBlasterException

disconnect

private void disconnect(MsgQueueEntry entry)
                 throws XmlBlasterException
Encrypt and send a disconnect request, decrypt the returned data

Throws:
XmlBlasterException

doPing

public final java.lang.String doPing(java.lang.String data)
                              throws XmlBlasterException
Description copied from class: DispatchConnection
Does the real ping to the remote server instance.

Specified by:
doPing in class DispatchConnection
Parameters:
data - QoS, never null
Returns:
ping return QoS, never null
Throws:
XmlBlasterException
See Also:
DispatchConnection.doPing(String)

resetConnection

public final void resetConnection()
Nothing to do here

Specified by:
resetConnection in class DispatchConnection

reconnect

protected final void reconnect()
                        throws XmlBlasterException
On reconnect polling try to establish the connection.

Specified by:
reconnect in class DispatchConnection
Throws:
XmlBlasterException

shutdown

public final void shutdown(boolean delayed)
                    throws XmlBlasterException
Stop all callback drivers of this client.

Overrides:
shutdown in class DispatchConnection
Throws:
XmlBlasterException

toXml

public final java.lang.String toXml(java.lang.String extraOffset)
Dump state of this object into a XML ASCII string.

Specified by:
toXml in class DispatchConnection
Parameters:
extraOffset - indenting of tags for nice output
Returns:
internal state as an XML ASCII string

registerProgressListener

public I_ProgressListener registerProgressListener(I_ProgressListener listener)
Description copied from class: DispatchConnection
Should be overwritten by extending classes.

Specified by:
registerProgressListener in class DispatchConnection

forcePingFailure

protected boolean forcePingFailure()
Specified by:
forcePingFailure in class DispatchConnection
Returns:
true if the implementation has to throw an exception in case the ping is invoked when there is an ongoing write or read operation on the same connection. Normally it shall give false on the callback and true on the client side. The client side shall give true because otherwise if such a situation arizes it will never go in polling and no reconnect will be triggered.

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.