org.jboss.jms.client.remoting
Class JMSRemotingConnection

java.lang.Object
  extended by org.jboss.jms.client.remoting.JMSRemotingConnection

public class JMSRemotingConnection
extends java.lang.Object

Encapsulates the state and behaviour from jboss remoting needed for a JMS connection. Each JMS connection maintains a single Client instance for invoking on the server.

Version:
$Revision: 3199 $ $Id: JMSRemotingConnection.java 3199 2007-10-18 21:27:48Z timfox $
Author:
Tim Fox, Ovidiu Feodorov

Field Summary
static java.lang.String CALLBACK_POLL_PERIOD_DEFAULT
           
protected  boolean failed
           
 
Constructor Summary
JMSRemotingConnection(java.lang.String serverLocatorURI, boolean clientPing, boolean strictTck)
           
 
Method Summary
 boolean addConnectionListener(ConsolidatedRemotingConnectionListener listener)
           
static void addInvokerCallbackHandler(java.lang.Object configurer, Client client, java.util.Map initialMetadata, InvokerLocator serverLocator, InvokerCallbackHandler invokerCallbackHandler)
          Configures and add the invokerCallbackHandler the right way (push or pull).
 void addPlainConnectionListener(ConnectionListener listener)
           
static java.util.Map createCallbackMetadata(boolean doPushCallbacks, java.util.Map metadata, InvokerLocator serverLocator)
          Build the configuration we need to use to make sure a callback server works the way we want.
 CallbackManager getCallbackManager()
           
 ConsolidatedRemotingConnectionListener getConnectionListener()
           
 Client getRemotingClient()
           
 boolean isFailed()
           
 boolean isStrictTck()
           
 ConsolidatedRemotingConnectionListener removeConnectionListener()
          May return null, if no connection listener was previously installed.
 void removePlainConnectionListener(ConnectionListener listener)
           
 void setFailed()
          Used by the FailoverCommandCenter to mark this remoting connection as "condemned", following a failure detected by either a failed invocation, or the ConnectionListener.
 void start()
           
 void stop()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CALLBACK_POLL_PERIOD_DEFAULT

public static final java.lang.String CALLBACK_POLL_PERIOD_DEFAULT
See Also:
Constant Field Values

failed

protected boolean failed
Constructor Detail

JMSRemotingConnection

public JMSRemotingConnection(java.lang.String serverLocatorURI,
                             boolean clientPing,
                             boolean strictTck)
                      throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

createCallbackMetadata

public static java.util.Map createCallbackMetadata(boolean doPushCallbacks,
                                                   java.util.Map metadata,
                                                   InvokerLocator serverLocator)
Build the configuration we need to use to make sure a callback server works the way we want.

Parameters:
doPushCallbacks - - whether the callback should be push or pull. For socket transport allow true push callbacks, with callback Connector. For http transport, simulate push callbacks.
metadata - - metadata that should be added to the metadata map being created. Can be null.
Returns:
a Map to be used when adding a listener to a client, thus enabling a callback server.

addInvokerCallbackHandler

public static void addInvokerCallbackHandler(java.lang.Object configurer,
                                             Client client,
                                             java.util.Map initialMetadata,
                                             InvokerLocator serverLocator,
                                             InvokerCallbackHandler invokerCallbackHandler)
                                      throws java.lang.Throwable
Configures and add the invokerCallbackHandler the right way (push or pull).

Parameters:
configurer - - passed for logging purposes only.
initialMetadata - - some initial metadata that we might want to pass along when registering invoker callback handler.
Throws:
java.lang.Throwable

start

public void start()
           throws java.lang.Throwable
Throws:
java.lang.Throwable

stop

public void stop()

getRemotingClient

public Client getRemotingClient()

getCallbackManager

public CallbackManager getCallbackManager()

isStrictTck

public boolean isStrictTck()

isFailed

public boolean isFailed()

setFailed

public void setFailed()
Used by the FailoverCommandCenter to mark this remoting connection as "condemned", following a failure detected by either a failed invocation, or the ConnectionListener.


addConnectionListener

public boolean addConnectionListener(ConsolidatedRemotingConnectionListener listener)
Returns:
true if the listener was correctly installed, or false if the add attepmt was ignored because there is already another listener installed.

addPlainConnectionListener

public void addPlainConnectionListener(ConnectionListener listener)

removePlainConnectionListener

public void removePlainConnectionListener(ConnectionListener listener)

getConnectionListener

public ConsolidatedRemotingConnectionListener getConnectionListener()

removeConnectionListener

public ConsolidatedRemotingConnectionListener removeConnectionListener()
May return null, if no connection listener was previously installed.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2006 JBoss Inc. All Rights Reserved.