org.jboss.jms.client.delegate
Class DelegateSupport

java.lang.Object
  extended by org.jboss.jms.client.delegate.DelegateSupport
All Implemented Interfaces:
java.io.Serializable, Streamable
Direct Known Subclasses:
ClientBrowserDelegate, ClientClusteredConnectionFactoryDelegate, ClientConnectionDelegate, ClientConnectionFactoryDelegate, ClientConsumerDelegate, ClientProducerDelegate, ClientSessionDelegate

public abstract class DelegateSupport
extends java.lang.Object
implements Streamable, java.io.Serializable

Base class for all client-side delegate classes. Client-side delegate classes provide an empty implementation of the appropriate delegate interface. The classes are advised using JBoss AOP to provide the client side advice stack. The methods in the delegate class will never actually be invoked since they will either be handled in the advice stack or invoked on the server before reaching the delegate. The delegates are created on the server and serialized back to the client. When they arrive on the client, the init() method is called which causes the advices to be bound to the advised class.

Version:
$Revision: 3197 $ $Id: DelegateSupport.java 3197 2007-10-18 15:51:20Z timfox $
Author:
Tim Fox, Ovidiu Feodorov
See Also:
Serialized Form

Field Summary
protected  Client client
           
protected  java.lang.String id
           
protected  HierarchicalState state
           
protected  byte version
           
 
Constructor Summary
DelegateSupport()
           
DelegateSupport(java.lang.String id)
           
 
Method Summary
protected  java.lang.Object doInvoke(Client client, RequestSupport req)
           
protected  java.lang.Object doInvokeOneway(Client client, RequestSupport req)
           
 Client getClient()
           
 java.lang.String getID()
           
 java.lang.String getName()
           
 HierarchicalState getState()
           
 JMSException handleThrowable(java.lang.Throwable t)
           
 void read(java.io.DataInputStream in)
           
 void setState(HierarchicalState state)
           
 void synchronizeWith(DelegateSupport newDelegate)
          During HA events, delegates corresponding to new enpoints on the new server are created and the state of those delegates has to be transfered to the "failed" delegates.
 void write(java.io.DataOutputStream out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected java.lang.String id

state

protected transient HierarchicalState state

version

protected transient byte version

client

protected transient Client client
Constructor Detail

DelegateSupport

public DelegateSupport(java.lang.String id)

DelegateSupport

public DelegateSupport()
Method Detail

getName

public java.lang.String getName()

read

public void read(java.io.DataInputStream in)
          throws java.lang.Exception
Specified by:
read in interface Streamable
Throws:
java.lang.Exception

write

public void write(java.io.DataOutputStream out)
           throws java.lang.Exception
Specified by:
write in interface Streamable
Throws:
java.lang.Exception

getState

public HierarchicalState getState()

setState

public void setState(HierarchicalState state)

getID

public java.lang.String getID()

synchronizeWith

public void synchronizeWith(DelegateSupport newDelegate)
                     throws java.lang.Exception
During HA events, delegates corresponding to new enpoints on the new server are created and the state of those delegates has to be transfered to the "failed" delegates. For example, a "failed" connection delegate will have to assume the ID of the new connection endpoint, the new RemotingConnection instance, etc.

Throws:
java.lang.Exception

doInvoke

protected java.lang.Object doInvoke(Client client,
                                    RequestSupport req)
                             throws JMSException
Throws:
JMSException

doInvokeOneway

protected java.lang.Object doInvokeOneway(Client client,
                                          RequestSupport req)
                                   throws JMSException
Throws:
JMSException

handleThrowable

public JMSException handleThrowable(java.lang.Throwable t)

getClient

public Client getClient()


Copyright © 2006 JBoss Inc. All Rights Reserved.