Interface INMSContext
  
  A INMSContext is the main interface in the simplified NMS API
introduced for NMS 2.0. This combines in a single object the functionality of
two separate objects from the NMS 1.x API: an IConnection and an ISession.
This is comparable to JMS 2.0 API that extended JMS 1.x API
    Inherited Members
    
      System.IDisposable.Dispose()
    
    
    
    
   
  
  Assembly: Apache.NMS.dll
  Syntax
  
    public interface INMSContext : IDisposable, IStartable, IStoppable
   
  Properties
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  AcknowledgementMode
  
  
  Declaration
  
    AcknowledgementMode AcknowledgementMode { get; }
   
  Property Value
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  ClientID
  
  
  Declaration
  
    string ClientID { get; set; }
   
  Property Value
  
    
      
        | Type | Description | 
    
    
      
        | System.String |  | 
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  ConsumerTransformer
  A Delegate that is called each time a Message is dispatched to allow the client to do
any necessary transformations on the received message before it is delivered.
The Session instance sets the delegate on each Consumer it creates.
Declaration
  
    ConsumerTransformerDelegate ConsumerTransformer { get; set; }
   
  Property Value
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  ProducerTransformer
  A delegate that is called each time a Message is sent from this Producer which allows
the application to perform any needed transformations on the Message before it is sent.
The Session instance sets the delegate on each Producer it creates.
Declaration
  
    ProducerTransformerDelegate ProducerTransformer { get; set; }
   
  Property Value
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  RequestTimeout
  
  
  Declaration
  
    TimeSpan RequestTimeout { get; set; }
   
  Property Value
  
    
      
        | Type | Description | 
    
    
      
        | System.TimeSpan |  | 
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Transacted
  
  
  Declaration
  
  Property Value
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  Methods
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Acknowledge()
  
  
  Declaration
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Close()
  Closes the session.  There is no need to close the producers and consumers
of a closed session.
Declaration
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Commit()
  If this is a transactional session then commit all message
send and acknowledgements for producers and consumers in this session
Declaration
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  CreateBrowser(IQueue)
  Creates a QueueBrowser object to peek at the messages on the specified queue.
Declaration
  
    IQueueBrowser CreateBrowser(IQueue queue)
   
  Parameters
  
  Returns
  
  Exceptions
  
    
      
        | Type | Condition | 
    
    
      
        | System.NotSupportedException | If the Prodiver does not support creation of Queue Browsers. | 
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  CreateBrowser(IQueue, String)
  Creates a QueueBrowser object to peek at the messages on the specified queue
using a message selector.
Declaration
  
    IQueueBrowser CreateBrowser(IQueue queue, string selector)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | IQueue | queue | A IQueue | 
      
        | System.String | selector | A System.String | 
    
  
  Returns
  
  Exceptions
  
    
      
        | Type | Condition | 
    
    
      
        | System.NotSupportedException | If the Prodiver does not support creation of Queue Browsers. | 
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  CreateBytesMessage()
  Creates a new binary message
Declaration
  
    IBytesMessage CreateBytesMessage()
   
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  CreateBytesMessage(Byte[])
  Creates a new binary message with the given body
Declaration
  
    IBytesMessage CreateBytesMessage(byte[] body)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Byte[] | body |  | 
    
  
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  CreateConsumer(IDestination)
  Creates a consumer of messages on a given destination
Declaration
  
    INMSConsumer CreateConsumer(IDestination destination)
   
  Parameters
  
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  CreateConsumer(IDestination, String)
  Creates a consumer of messages on a given destination with a selector
Declaration
  
    INMSConsumer CreateConsumer(IDestination destination, string selector)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | IDestination | destination |  | 
      
        | System.String | selector |  | 
    
  
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  CreateConsumer(IDestination, String, Boolean)
  Creates a consumer of messages on a given destination with a selector
Declaration
  
    INMSConsumer CreateConsumer(IDestination destination, string selector, bool noLocal)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | IDestination | destination |  | 
      
        | System.String | selector |  | 
      
        | System.Boolean | noLocal |  | 
    
  
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  CreateContext(AcknowledgementMode)
  
  
  Declaration
  
    INMSContext CreateContext(AcknowledgementMode acknowledgementMode)
   
  Parameters
  
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  CreateDurableConsumer(ITopic, String)
  
  
  Declaration
  
    INMSConsumer CreateDurableConsumer(ITopic destination, string name)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | ITopic | destination |  | 
      
        | System.String | name |  | 
    
  
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  CreateDurableConsumer(ITopic, String, String)
  
  
  Declaration
  
    INMSConsumer CreateDurableConsumer(ITopic destination, string name, string selector)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | ITopic | destination |  | 
      
        | System.String | name |  | 
      
        | System.String | selector |  | 
    
  
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  CreateDurableConsumer(ITopic, String, String, Boolean)
  Creates a named durable consumer of messages on a given destination with a selector
Declaration
  
    INMSConsumer CreateDurableConsumer(ITopic destination, string name, string selector, bool noLocal)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | ITopic | destination |  | 
      
        | System.String | name |  | 
      
        | System.String | selector |  | 
      
        | System.Boolean | noLocal |  | 
    
  
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  CreateMapMessage()
  Creates a new Map message which contains primitive key and value pairs
Declaration
  
    IMapMessage CreateMapMessage()
   
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  CreateMessage()
  Creates a new message with an empty body
Declaration
  
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  CreateObjectMessage(Object)
  Creates a new Object message containing the given .NET object as the body
Declaration
  
    IObjectMessage CreateObjectMessage(object body)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Object | body |  | 
    
  
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  CreateProducer()
  Creates a producer of messages
Declaration
  
    INMSProducer CreateProducer()
   
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  CreateSharedConsumer(ITopic, String)
  
  
  Declaration
  
    INMSConsumer CreateSharedConsumer(ITopic destination, string name)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | ITopic | destination |  | 
      
        | System.String | name |  | 
    
  
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  CreateSharedConsumer(ITopic, String, String)
  
  
  Declaration
  
    INMSConsumer CreateSharedConsumer(ITopic destination, string name, string selector)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | ITopic | destination |  | 
      
        | System.String | name |  | 
      
        | System.String | selector |  | 
    
  
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  CreateSharedDurableConsumer(ITopic, String)
  
  
  Declaration
  
    INMSConsumer CreateSharedDurableConsumer(ITopic destination, string name)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | ITopic | destination |  | 
      
        | System.String | name |  | 
    
  
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  CreateSharedDurableConsumer(ITopic, String, String)
  
  
  Declaration
  
    INMSConsumer CreateSharedDurableConsumer(ITopic destination, string name, string selector)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | ITopic | destination |  | 
      
        | System.String | name |  | 
      
        | System.String | selector |  | 
    
  
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  CreateStreamMessage()
  Creates a new stream message
Declaration
  
    IStreamMessage CreateStreamMessage()
   
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  CreateTemporaryQueue()
  Creates a temporary queue
Declaration
  
    ITemporaryQueue CreateTemporaryQueue()
   
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  CreateTemporaryTopic()
  Creates a temporary topic
Declaration
  
    ITemporaryTopic CreateTemporaryTopic()
   
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  CreateTextMessage()
  Creates a new text message with an empty body
Declaration
  
    ITextMessage CreateTextMessage()
   
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  CreateTextMessage(String)
  Creates a new text message with the given body
Declaration
  
    ITextMessage CreateTextMessage(string text)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.String | text |  | 
    
  
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  DeleteDestination(IDestination)
  Delete a destination (Queue, Topic, Temp Queue, Temp Topic).
Declaration
  
    void DeleteDestination(IDestination destination)
   
  Parameters
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  GetQueue(String)
  Returns the queue for the given name
Declaration
  
    IQueue GetQueue(string name)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.String | name |  | 
    
  
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  GetTopic(String)
  Returns the topic for the given name
Declaration
  
    ITopic GetTopic(string name)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.String | name |  | 
    
  
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  PurgeTempDestinations()
  For a long running Connection that creates many temp destinations
this method will close and destroy all previously created temp
destinations to reduce resource consumption.  This can be useful
when the Connection is pooled or otherwise used for long periods
of time.  Only locally created temp destinations should be removed
by this call.
NOTE: This is an optional operation and for NMS providers that
do not support this functionality the method should just return
without throwing any exceptions.
Declaration
  
    void PurgeTempDestinations()
   
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Recover()
  Stops all Message delivery in this session and restarts it again
with the oldest unabcknowledged message.  Messages that were delivered
but not acknowledge should have their redelivered property set.
This is an optional method that may not by implemented by all NMS
providers, if not implemented an Exception will be thrown.
Message redelivery is not requried to be performed in the original
order.  It is not valid to call this method on a Transacted Session.
Declaration
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Rollback()
  If this is a transactional session then rollback all message
send and acknowledgements for producers and consumers in this session
Declaration
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Unsubscribe(String)
  
  
  Declaration
  
    void Unsubscribe(string name)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.String | name |  | 
    
  
  Events
  
  
    |
    Improve this Doc
  
  
    View Source
  
  ConnectionInterruptedListener
  An asynchronous listener that is notified when a Fault tolerant connection
has been interrupted.
Declaration
  
    event ConnectionInterruptedListener ConnectionInterruptedListener
   
  Event Type
  
  
    |
    Improve this Doc
  
  
    View Source
  
  ConnectionResumedListener
  An asynchronous listener that is notified when a Fault tolerant connection
has been resumed.
Declaration
  
    event ConnectionResumedListener ConnectionResumedListener
   
  Event Type
  
  
    |
    Improve this Doc
  
  
    View Source
  
  ExceptionListener
  An asynchronous listener which can be notified if an error occurs
Declaration
  
    event ExceptionListener ExceptionListener
   
  Event Type
  
  
    |
    Improve this Doc
  
  
    View Source
  
  TransactionCommittedListener
  
  
  Declaration
  
    event SessionTxEventDelegate TransactionCommittedListener
   
  Event Type
  
  
    |
    Improve this Doc
  
  
    View Source
  
  TransactionRolledBackListener
  
  
  Declaration
  
    event SessionTxEventDelegate TransactionRolledBackListener
   
  Event Type
  
  
    |
    Improve this Doc
  
  
    View Source
  
  TransactionStartedListener
  
  
  Declaration
  
    event SessionTxEventDelegate TransactionStartedListener
   
  Event Type