org.jboss.jms.client.delegate
Class ClientSessionDelegate

java.lang.Object
  extended by org.jboss.jms.client.delegate.DelegateSupport
      extended by org.jboss.jms.client.delegate.ClientSessionDelegate
All Implemented Interfaces:
java.io.Serializable, Closeable, SessionDelegate, SessionEndpoint, Streamable

public class ClientSessionDelegate
extends DelegateSupport
implements SessionDelegate

The client-side Session delegate class.

Version:
$Revision: 3238 $ $Id: ClientSessionDelegate.java 3238 2007-10-21 23:29:00Z timfox $
Author:
Tim Fox, Ovidiu Feodorov, Clebert Suconic
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jboss.jms.client.delegate.DelegateSupport
client, id, state, version
 
Constructor Summary
ClientSessionDelegate()
           
ClientSessionDelegate(java.lang.String objectID, int dupsOKBatchSize)
           
 
Method Summary
 void acknowledgeAll()
          This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.
 void acknowledgeDeliveries(java.util.List acks)
          Acknowledge a list of deliveries
 boolean acknowledgeDelivery(Ack ack)
          Acknowledge a delivery
 void addAsfMessage(MessageProxy m, java.lang.String consumerID, java.lang.String queueName, int maxDeliveries, SessionDelegate connectionConsumerSession, boolean shouldAck)
          This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.
 void addTemporaryDestination(JBossDestination destination)
          Add a temporary destination.
 void cancelDeliveries(java.util.List cancels)
          Cancel a list of deliveries.
 void cancelDelivery(Cancel cancel)
          Cancel a delivery
 void close()
          Close the instance
 long closing(long sequence)
          Tell the instance to prepare to close
 void commit()
          This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.
 BrowserDelegate createBrowserDelegate(JBossDestination queue, java.lang.String messageSelector)
           
 BytesMessageProxy createBytesMessage()
          This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.
 ConsumerDelegate createConsumerDelegate(JBossDestination destination, java.lang.String selector, boolean noLocal, java.lang.String subscriptionName, boolean connectionConsumer, boolean started)
           
 MapMessageProxy createMapMessage()
          This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.
 MessageProxy createMessage()
          This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.
 ObjectMessageProxy createObjectMessage()
          This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.
 ObjectMessageProxy createObjectMessage(java.io.Serializable object)
          This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.
 ProducerDelegate createProducerDelegate(JBossDestination destination)
          This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.
 JBossQueue createQueue(java.lang.String queueName)
          Creates a queue identity given a Queue name.
 StreamMessageProxy createStreamMessage()
          This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.
 TextMessageProxy createTextMessage()
          This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.
 TextMessageProxy createTextMessage(java.lang.String text)
          This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.
 JBossTopic createTopic(java.lang.String topicName)
          Creates a topic identity given a Queue name.
 void deleteTemporaryDestination(JBossDestination destination)
          Delete a temporary destination
 int getAcknowledgeMode()
          This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.
 int getDupsOKBatchSize()
           
 MessageListener getMessageListener()
          This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.
 boolean getTransacted()
          This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.
 javax.transaction.xa.XAResource getXAResource()
          This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.
 boolean postDeliver()
          This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.
 void preDeliver(DeliveryInfo deliveryInfo)
          This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.
 void read(java.io.DataInputStream in)
           
 void recover()
          This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.
 void recoverDeliveries(java.util.List acks, java.lang.String sessionID)
          Send delivery info to the server so the delivery lists can be repopulated.
 void redeliver()
          This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.
 void redeliver(java.util.List ackInfos)
          This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.
 void rollback()
          This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.
 void run()
          This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.
 void send(JBossMessage m, boolean checkForDuplicates)
          Send a message
 void setMessageListener(MessageListener listener)
          This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.
 void setState(HierarchicalState state)
           
 void synchronizeWith(DelegateSupport nd)
          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.
 java.lang.String toString()
           
 void unsubscribe(java.lang.String subscriptionName)
          Unsubscribe the client from the durable subscription specified by subscriptionName
 void write(java.io.DataOutputStream out)
           
 
Methods inherited from class org.jboss.jms.client.delegate.DelegateSupport
doInvoke, doInvokeOneway, getClient, getID, getName, getState, handleThrowable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClientSessionDelegate

public ClientSessionDelegate(java.lang.String objectID,
                             int dupsOKBatchSize)

ClientSessionDelegate

public ClientSessionDelegate()
Method Detail

synchronizeWith

public void synchronizeWith(DelegateSupport nd)
                     throws java.lang.Exception
Description copied from class: DelegateSupport
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.

Overrides:
synchronizeWith in class DelegateSupport
Throws:
java.lang.Exception

setState

public void setState(HierarchicalState state)
Overrides:
setState in class DelegateSupport

close

public void close()
           throws JMSException
Description copied from interface: Closeable
Close the instance

Specified by:
close in interface Closeable
Throws:
JMSException

closing

public long closing(long sequence)
             throws JMSException
Description copied from interface: Closeable
Tell the instance to prepare to close

Specified by:
closing in interface Closeable
Throws:
JMSException

acknowledgeDelivery

public boolean acknowledgeDelivery(Ack ack)
                            throws JMSException
Description copied from interface: SessionEndpoint
Acknowledge a delivery

Specified by:
acknowledgeDelivery in interface SessionEndpoint
Throws:
JMSException

acknowledgeDeliveries

public void acknowledgeDeliveries(java.util.List acks)
                           throws JMSException
Description copied from interface: SessionEndpoint
Acknowledge a list of deliveries

Specified by:
acknowledgeDeliveries in interface SessionEndpoint
Throws:
JMSException

acknowledgeAll

public void acknowledgeAll()
                    throws JMSException
This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.

Specified by:
acknowledgeAll in interface SessionDelegate
Throws:
JMSException

addTemporaryDestination

public void addTemporaryDestination(JBossDestination destination)
                             throws JMSException
Description copied from interface: SessionEndpoint
Add a temporary destination.

Specified by:
addTemporaryDestination in interface SessionEndpoint
Throws:
JMSException

redeliver

public void redeliver()
               throws JMSException
This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.

Throws:
JMSException

commit

public void commit()
            throws JMSException
This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.

Specified by:
commit in interface SessionDelegate
Throws:
JMSException

createBrowserDelegate

public BrowserDelegate createBrowserDelegate(JBossDestination queue,
                                             java.lang.String messageSelector)
                                      throws JMSException
Specified by:
createBrowserDelegate in interface SessionEndpoint
Throws:
JMSException

createBytesMessage

public BytesMessageProxy createBytesMessage()
                                     throws JMSException
This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.

Specified by:
createBytesMessage in interface SessionDelegate
Throws:
JMSException

createConsumerDelegate

public ConsumerDelegate createConsumerDelegate(JBossDestination destination,
                                               java.lang.String selector,
                                               boolean noLocal,
                                               java.lang.String subscriptionName,
                                               boolean connectionConsumer,
                                               boolean started)
                                        throws JMSException
Specified by:
createConsumerDelegate in interface SessionEndpoint
Throws:
JMSException

createMapMessage

public MapMessageProxy createMapMessage()
                                 throws JMSException
This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.

Specified by:
createMapMessage in interface SessionDelegate
Throws:
JMSException

createMessage

public MessageProxy createMessage()
                           throws JMSException
This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.

Specified by:
createMessage in interface SessionDelegate
Throws:
JMSException

createObjectMessage

public ObjectMessageProxy createObjectMessage()
                                       throws JMSException
This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.

Specified by:
createObjectMessage in interface SessionDelegate
Throws:
JMSException

createObjectMessage

public ObjectMessageProxy createObjectMessage(java.io.Serializable object)
                                       throws JMSException
This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.

Specified by:
createObjectMessage in interface SessionDelegate
Throws:
JMSException

createProducerDelegate

public ProducerDelegate createProducerDelegate(JBossDestination destination)
                                        throws JMSException
This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.

Specified by:
createProducerDelegate in interface SessionDelegate
Throws:
JMSException

createQueue

public JBossQueue createQueue(java.lang.String queueName)
                       throws JMSException
Description copied from interface: SessionEndpoint
Creates a queue identity given a Queue name. Does NOT create the physical queue. The physical creation of queues is an administrative task and is not to be initiated by the JMS API, with the exception of temporary queues.

Specified by:
createQueue in interface SessionEndpoint
Throws:
JMSException

createStreamMessage

public StreamMessageProxy createStreamMessage()
                                       throws JMSException
This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.

Specified by:
createStreamMessage in interface SessionDelegate
Throws:
JMSException

createTextMessage

public TextMessageProxy createTextMessage()
                                   throws JMSException
This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.

Specified by:
createTextMessage in interface SessionDelegate
Throws:
JMSException

createTextMessage

public TextMessageProxy createTextMessage(java.lang.String text)
                                   throws JMSException
This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.

Specified by:
createTextMessage in interface SessionDelegate
Throws:
JMSException

createTopic

public JBossTopic createTopic(java.lang.String topicName)
                       throws JMSException
Description copied from interface: SessionEndpoint
Creates a topic identity given a Queue name. Does NOT create the physical topic. The physical creation of topics is an administrative task and is not to be initiated by the JMS API, with the exception of temporary topics.

Specified by:
createTopic in interface SessionEndpoint
Throws:
JMSException

deleteTemporaryDestination

public void deleteTemporaryDestination(JBossDestination destination)
                                throws JMSException
Description copied from interface: SessionEndpoint
Delete a temporary destination

Specified by:
deleteTemporaryDestination in interface SessionEndpoint
Throws:
JMSException

getMessageListener

public MessageListener getMessageListener()
                                   throws JMSException
This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.

Specified by:
getMessageListener in interface SessionDelegate
Throws:
JMSException

postDeliver

public boolean postDeliver()
                    throws JMSException
This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.

Specified by:
postDeliver in interface SessionDelegate
Throws:
JMSException

preDeliver

public void preDeliver(DeliveryInfo deliveryInfo)
                throws JMSException
This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.

Specified by:
preDeliver in interface SessionDelegate
Throws:
JMSException

recover

public void recover()
             throws JMSException
This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.

Specified by:
recover in interface SessionDelegate
Throws:
JMSException

redeliver

public void redeliver(java.util.List ackInfos)
               throws JMSException
This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.

Specified by:
redeliver in interface SessionDelegate
Throws:
JMSException

rollback

public void rollback()
              throws JMSException
This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.

Specified by:
rollback in interface SessionDelegate
Throws:
JMSException

run

public void run()
This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.

Specified by:
run in interface SessionDelegate

setMessageListener

public void setMessageListener(MessageListener listener)
                        throws JMSException
This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.

Specified by:
setMessageListener in interface SessionDelegate
Throws:
JMSException

unsubscribe

public void unsubscribe(java.lang.String subscriptionName)
                 throws JMSException
Description copied from interface: SessionEndpoint
Unsubscribe the client from the durable subscription specified by subscriptionName

Specified by:
unsubscribe in interface SessionEndpoint
Parameters:
subscriptionName - the Name of the durable subscription to unsubscribe from
Throws:
JMSException - if the unsubscribe fails

getXAResource

public javax.transaction.xa.XAResource getXAResource()
This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.

Specified by:
getXAResource in interface SessionDelegate

getAcknowledgeMode

public int getAcknowledgeMode()
This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.

Specified by:
getAcknowledgeMode in interface SessionDelegate

getTransacted

public boolean getTransacted()
This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.

Specified by:
getTransacted in interface SessionDelegate

addAsfMessage

public void addAsfMessage(MessageProxy m,
                          java.lang.String consumerID,
                          java.lang.String queueName,
                          int maxDeliveries,
                          SessionDelegate connectionConsumerSession,
                          boolean shouldAck)
This invocation should either be handled by the client-side interceptor chain or by the server-side endpoint.

Specified by:
addAsfMessage in interface SessionDelegate

send

public void send(JBossMessage m,
                 boolean checkForDuplicates)
          throws JMSException
Description copied from interface: SessionEndpoint
Send a message

Specified by:
send in interface SessionEndpoint
Parameters:
m - The message to send
Throws:
JMSException

cancelDeliveries

public void cancelDeliveries(java.util.List cancels)
                      throws JMSException
Description copied from interface: SessionEndpoint
Cancel a list of deliveries.

Specified by:
cancelDeliveries in interface SessionEndpoint
Throws:
JMSException

cancelDelivery

public void cancelDelivery(Cancel cancel)
                    throws JMSException
Description copied from interface: SessionEndpoint
Cancel a delivery

Specified by:
cancelDelivery in interface SessionEndpoint
Throws:
JMSException

recoverDeliveries

public void recoverDeliveries(java.util.List acks,
                              java.lang.String sessionID)
                       throws JMSException
Description copied from interface: SessionEndpoint
Send delivery info to the server so the delivery lists can be repopulated. Used only in failover.

Specified by:
recoverDeliveries in interface SessionEndpoint
Throws:
JMSException

read

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

write

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

getDupsOKBatchSize

public int getDupsOKBatchSize()

toString

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


Copyright © 2006 JBoss Inc. All Rights Reserved.