org.jboss.jms.client.p2p
Class P2PSessionDelegate

java.lang.Object
  extended byorg.jboss.jms.client.p2p.P2PSessionDelegate
All Implemented Interfaces:
Lifecycle (src) , SessionDelegate (src)

public class P2PSessionDelegate
extends java.lang.Object
implements SessionDelegate (src)

The p2p session


Constructor Summary
P2PSessionDelegate(P2PConnectionDelegate (src)  connection, boolean transaction, int acknowledgeMode)
           
 
Method Summary
 void acknowledge(Message (src)  message, boolean acknowledge)
          Acknowledge a message
 void close()
          Close the delegate
 void closing()
          Notify about to close
 void commit()
          Commit a session
 BrowserDelegate (src) createBrowser(Queue (src)  queue, java.lang.String selector)
          Create a queue browser
 BytesMessage (src) createBytesMessage()
          Create a bytes message
 ConsumerDelegate (src) createConsumer(Destination (src)  destination, java.lang.String subscription, java.lang.String selector, boolean noLocal)
          Create a consumer
 MapMessage (src) createMapMessage()
          Create a map message
 Message (src) createMessage()
          Create a message
 ObjectMessage (src) createObjectMessage(java.io.Serializable object)
          Create an object message
 ProducerDelegate (src) createProducer(Destination (src)  destination)
          Create a producer
 StreamMessage (src) createStreamMessage()
          Create a stream message
 Destination (src) createTempDestination(int type)
          Create a temporary destination
 TextMessage (src) createTextMessage(java.lang.String text)
          Create a text message
 Destination (src) getDestination(java.lang.String name)
          Retrieve a destination
 XAResource (src) getXAResource()
          Retrieve the XAResource for this session
 void recover()
          Recover a session
 void rollback()
          Rollback a session
 void run()
          Run the session listener
 void setMessageListener(MessageListener (src)  listener)
          Set the session's message listener
 void unsubscribe(java.lang.String name)
          Unsubscribe the name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

P2PSessionDelegate

public P2PSessionDelegate(P2PConnectionDelegate (src)  connection,
                          boolean transaction,
                          int acknowledgeMode)
                   throws JMSException (src) 
Method Detail

close

public void close()
           throws JMSException (src) 
Description copied from interface: Lifecycle (src)
Close the delegate

Specified by:
close in interface Lifecycle (src)
Throws:
JMSException (src) - for any error

closing

public void closing()
             throws JMSException (src) 
Description copied from interface: Lifecycle (src)
Notify about to close

Specified by:
closing in interface Lifecycle (src)
Throws:
JMSException (src) - for any error

commit

public void commit()
            throws JMSException (src) 
Description copied from interface: SessionDelegate (src)
Commit a session

Specified by:
commit in interface SessionDelegate (src)
Throws:
JMSException (src) - for any error

createBrowser

public BrowserDelegate (src)  createBrowser(Queue (src)  queue,
                                     java.lang.String selector)
                              throws JMSException (src) 
Description copied from interface: SessionDelegate (src)
Create a queue browser

Specified by:
createBrowser in interface SessionDelegate (src)
Parameters:
queue - the queue
selector - the message selector
Returns:
the browser
Throws:
JMSException (src) - for any error

createBytesMessage

public BytesMessage (src)  createBytesMessage()
                                throws JMSException (src) 
Description copied from interface: SessionDelegate (src)
Create a bytes message

Specified by:
createBytesMessage in interface SessionDelegate (src)
Returns:
the message
Throws:
JMSException (src) - for any error

createConsumer

public ConsumerDelegate (src)  createConsumer(Destination (src)  destination,
                                       java.lang.String subscription,
                                       java.lang.String selector,
                                       boolean noLocal)
                                throws JMSException (src) 
Description copied from interface: SessionDelegate (src)
Create a consumer

Specified by:
createConsumer in interface SessionDelegate (src)
Parameters:
destination - the destination
subscription - the subscription name
selector - the message selector
noLocal - the no local flag
Returns:
the consumer
Throws:
JMSException (src) - for any error

createMapMessage

public MapMessage (src)  createMapMessage()
                            throws JMSException (src) 
Description copied from interface: SessionDelegate (src)
Create a map message

Specified by:
createMapMessage in interface SessionDelegate (src)
Returns:
the message
Throws:
JMSException (src) - for any error

createMessage

public Message (src)  createMessage()
                      throws JMSException (src) 
Description copied from interface: SessionDelegate (src)
Create a message

Specified by:
createMessage in interface SessionDelegate (src)
Returns:
the message
Throws:
JMSException (src) - for any error

createObjectMessage

public ObjectMessage (src)  createObjectMessage(java.io.Serializable object)
                                  throws JMSException (src) 
Description copied from interface: SessionDelegate (src)
Create an object message

Specified by:
createObjectMessage in interface SessionDelegate (src)
Parameters:
object - the object
Returns:
the message
Throws:
JMSException (src) - for any error

createProducer

public ProducerDelegate (src)  createProducer(Destination (src)  destination)
                                throws JMSException (src) 
Description copied from interface: SessionDelegate (src)
Create a producer

Specified by:
createProducer in interface SessionDelegate (src)
Parameters:
destination - the destination
Returns:
the producer
Throws:
JMSException (src) - for any error

createStreamMessage

public StreamMessage (src)  createStreamMessage()
                                  throws JMSException (src) 
Description copied from interface: SessionDelegate (src)
Create a stream message

Specified by:
createStreamMessage in interface SessionDelegate (src)
Returns:
the message
Throws:
JMSException (src) - for any error

createTempDestination

public Destination (src)  createTempDestination(int type)
                                  throws JMSException (src) 
Description copied from interface: SessionDelegate (src)
Create a temporary destination

Specified by:
createTempDestination in interface SessionDelegate (src)
Parameters:
type - the type of temporary destination
Returns:
the temporary destination
Throws:
JMSException (src) - for any error

createTextMessage

public TextMessage (src)  createTextMessage(java.lang.String text)
                              throws JMSException (src) 
Description copied from interface: SessionDelegate (src)
Create a text message

Specified by:
createTextMessage in interface SessionDelegate (src)
Parameters:
text - the text
Returns:
the message
Throws:
JMSException (src) - for any error

getDestination

public Destination (src)  getDestination(java.lang.String name)
                           throws JMSException (src) 
Description copied from interface: SessionDelegate (src)
Retrieve a destination

Specified by:
getDestination in interface SessionDelegate (src)
Parameters:
name - the implementation dependent name
Returns:
the destination
Throws:
JMSException (src) - for any error

getXAResource

public XAResource (src)  getXAResource()
Description copied from interface: SessionDelegate (src)
Retrieve the XAResource for this session

Specified by:
getXAResource in interface SessionDelegate (src)
Returns:
the XAResource

recover

public void recover()
             throws JMSException (src) 
Description copied from interface: SessionDelegate (src)
Recover a session

Specified by:
recover in interface SessionDelegate (src)
Throws:
JMSException (src) - for any error

rollback

public void rollback()
              throws JMSException (src) 
Description copied from interface: SessionDelegate (src)
Rollback a session

Specified by:
rollback in interface SessionDelegate (src)
Throws:
JMSException (src) - for any error

run

public void run()
Description copied from interface: SessionDelegate (src)
Run the session listener

Specified by:
run in interface SessionDelegate (src)

setMessageListener

public void setMessageListener(MessageListener (src)  listener)
                        throws JMSException (src) 
Description copied from interface: SessionDelegate (src)
Set the session's message listener

Specified by:
setMessageListener in interface SessionDelegate (src)
Parameters:
listener - the message listener
Throws:
JMSException (src) - for any error

unsubscribe

public void unsubscribe(java.lang.String name)
                 throws JMSException (src) 
Description copied from interface: SessionDelegate (src)
Unsubscribe the name

Specified by:
unsubscribe in interface SessionDelegate (src)
Parameters:
name - the name of the subscription
Throws:
JMSException (src) - for any error

acknowledge

public void acknowledge(Message (src)  message,
                        boolean acknowledge)
Description copied from interface: SessionDelegate (src)
Acknowledge a message

Specified by:
acknowledge in interface SessionDelegate (src)
Parameters:
message - the message to acknowledge
acknowledge - true for acknowledge, false for a Nack