org.jboss.jms.server.endpoint
Class ServerSessionEndpoint

java.lang.Object
  extended by org.jboss.jms.server.endpoint.ServerSessionEndpoint
All Implemented Interfaces:
Closeable, SessionEndpoint

public class ServerSessionEndpoint
extends java.lang.Object
implements SessionEndpoint

The server side representation of a JMS session. A user must not invoke methods of a session concurrently on different threads, however there are situations where multiple threads may access this object concurrently, for instance: - A session can be closed when it's connection is closed by the user which might be called on a different thread. - A session can be closed when the server determines the connection is dead. If the session represents a connection consumer's session then the connection consumer will farm off messages to different sessions obtained from a pool, these may then cancel/ack etc on different threads, but the acks/cancels/etc will end up back here on the connection consumer session instance.

Version:
$Revision: 3268 $ $Id: ServerSessionEndpoint.java 3268 2007-10-31 14:35:03Z timfox $
Author:
Ovidiu Feodorov, Tim Fox, Clebert Suconic

Method Summary
 void acknowledgeDeliveries(java.util.List acks)
          Acknowledge a list of deliveries
 boolean acknowledgeDelivery(Ack ack)
          Acknowledge a delivery
 void addTemporaryDestination(JBossDestination dest)
          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
 boolean collectDeliveries(java.util.Map map, boolean firstNode, java.lang.String queueName)
           
 BrowserDelegate createBrowserDelegate(JBossDestination jmsDestination, java.lang.String selector)
           
 ConsumerDelegate createConsumerDelegate(JBossDestination jmsDestination, java.lang.String selector, boolean noLocal, java.lang.String subscriptionName, boolean isCC, boolean autoFlowControl)
           
 JBossQueue createQueue(java.lang.String name)
          Creates a queue identity given a Queue name.
 JBossTopic createTopic(java.lang.String name)
          Creates a topic identity given a Queue name.
 void deleteTemporaryDestination(JBossDestination dest)
          Delete a temporary destination
 void deliverAnyWaitingDeliveries(java.lang.String queueName)
           
 ServerConnectionEndpoint getConnectionEndpoint()
           
 void recoverDeliveries(java.util.List deliveryRecoveryInfos, java.lang.String oldSessionID)
          Send delivery info to the server so the delivery lists can be repopulated.
 void replicateDeliveryResponseReceived(long deliveryID)
           
 void send(JBossMessage message, boolean checkForDuplicates)
          Send a message
 void send(JBossMessage message, boolean checkForDuplicates, long thisSequence)
           
 java.lang.String toString()
           
 void unsubscribe(java.lang.String subscriptionName)
          Unsubscribe the client from the durable subscription specified by subscriptionName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

createConsumerDelegate

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

createBrowserDelegate

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

createQueue

public JBossQueue createQueue(java.lang.String name)
                       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

createTopic

public JBossTopic createTopic(java.lang.String name)
                       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

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

send

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

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

send

public void send(JBossMessage message,
                 boolean checkForDuplicates,
                 long thisSequence)
          throws JMSException
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

cancelDelivery

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

Specified by:
cancelDelivery in interface SessionEndpoint
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

recoverDeliveries

public void recoverDeliveries(java.util.List deliveryRecoveryInfos,
                              java.lang.String oldSessionID)
                       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

addTemporaryDestination

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

Specified by:
addTemporaryDestination in interface SessionEndpoint
Throws:
JMSException

deleteTemporaryDestination

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

Specified by:
deleteTemporaryDestination in interface SessionEndpoint
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

getConnectionEndpoint

public ServerConnectionEndpoint getConnectionEndpoint()

toString

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

deliverAnyWaitingDeliveries

public void deliverAnyWaitingDeliveries(java.lang.String queueName)
                                 throws java.lang.Exception
Throws:
java.lang.Exception

collectDeliveries

public boolean collectDeliveries(java.util.Map map,
                                 boolean firstNode,
                                 java.lang.String queueName)
                          throws java.lang.Exception
Throws:
java.lang.Exception

replicateDeliveryResponseReceived

public void replicateDeliveryResponseReceived(long deliveryID)
                                       throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © 2006 JBoss Inc. All Rights Reserved.