xmlBlaster 2.2.0 client 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
 
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
 void connectLowlevel()
          Connect on protocol layer and try an initial low level ping.
 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.
protected  boolean forcePingFailure()
           
 java.lang.String getDriverName()
          A human readable name of the protocol plugin
 java.lang.String getName()
           
 void loadPlugin()
          Load the appropriate protocol driver, e.g the CORBA protocol plugin.
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
 void shutdown(boolean delayed)
          Stop all callback drivers of this client.
 java.lang.String toXml(java.lang.String extraOffset)
          Dump state of this object into a XML ASCII string.
 
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
 

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

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 client API

Copyright © 1999-2014 The xmlBlaster.org contributers.