org.fuin.jmsmvc4swing.jms
Class Subscriber

java.lang.Object
  extended by org.fuin.jmsmvc4swing.jms.Subscriber

public class Subscriber
extends java.lang.Object

Handles a single JMS topic subscription.


Constructor Summary
Subscriber(JmsJndiEnvironment env)
          Constructor.
 
Method Summary
 void close()
          Unsubscribes to the topic (closes the session).
 boolean isClosed()
          Returns if no JMS session is active.
 boolean isOpen()
          Returns if a JMS session is active.
 void open(java.lang.String topicName, java.lang.String methodName, java.lang.Long id, MessageType[] type, javax.jms.MessageListener listener)
          Subscribes to a topic with a selector based on the method arguments (Opens a session to the JMS provider).
 void open(java.lang.String topicName, java.lang.String methodName, java.lang.Long id, MessageType type, javax.jms.MessageListener listener)
          Subscribes to a topic with a selector based on the method arguments (Opens a session to the JMS provider).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Subscriber

public Subscriber(JmsJndiEnvironment env)
Constructor.

Parameters:
env - Environment to use.
Method Detail

open

public final void open(java.lang.String topicName,
                       java.lang.String methodName,
                       java.lang.Long id,
                       MessageType type,
                       javax.jms.MessageListener listener)
Subscribes to a topic with a selector based on the method arguments (Opens a session to the JMS provider).

Parameters:
topicName - Name of the topic to subscribe to.
methodName - Name of the method for creating the selector.
id - Id for creating the selector.
type - Type for creating the selector.
listener - Listener to handle the incoming messages.

open

public final void open(java.lang.String topicName,
                       java.lang.String methodName,
                       java.lang.Long id,
                       MessageType[] type,
                       javax.jms.MessageListener listener)
Subscribes to a topic with a selector based on the method arguments (Opens a session to the JMS provider).

Parameters:
topicName - Name of the topic to subscribe to.
methodName - Name of the method for creating the selector.
id - Id for creating the selector.
type - Types for creating the selector.
listener - Listener to handle the incoming messages.

isOpen

public final boolean isOpen()
Returns if a JMS session is active.

Returns:
If a subscription to a topic exists TRUE else FALSE.

isClosed

public final boolean isClosed()
Returns if no JMS session is active.

Returns:
If no subscription exists TRUE else FALSE.

close

public final void close()
Unsubscribes to the topic (closes the session).



Copyright © 2010 Future Invent Informationsmanagement GmbH. All Rights Reserved.