org.fuin.jmsmvc4swing.base
Class JmsJndiEnvironmentImpl

java.lang.Object
  extended by org.fuin.jmsmvc4swing.base.JmsJndiEnvironmentImpl
All Implemented Interfaces:
JmsJndiEnvironment

public final class JmsJndiEnvironmentImpl
extends java.lang.Object
implements JmsJndiEnvironment

Default environment for using JMS and JNDI.


Field Summary
static java.lang.String CONTEXT
          Prefix for all topic names.
 
Constructor Summary
JmsJndiEnvironmentImpl(javax.naming.Context context, java.lang.String topicConnectionFactoryKey)
          Constructor with all necessary data.
 
Method Summary
 void close()
          Close the JMS connection to the provider.
 javax.jms.TopicConnection getConnection()
          Returns the JMS provider connection.
 javax.naming.Context getContext()
          Return the naming context.
 javax.jms.Topic getTopic(java.lang.String name)
          Creates a topic for a given name.
 boolean isOpen()
          Returns the information if the connection to the JMS provider is active.
 void open()
          Create a connection to the JMS provider and start it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTEXT

public static final java.lang.String CONTEXT
Prefix for all topic names.

See Also:
Constant Field Values
Constructor Detail

JmsJndiEnvironmentImpl

public JmsJndiEnvironmentImpl(javax.naming.Context context,
                              java.lang.String topicConnectionFactoryKey)
Constructor with all necessary data.

Parameters:
context - Naming context.
topicConnectionFactoryKey - Key used to lookup a topic connection factory with JNDI.
Method Detail

open

public final void open()
Create a connection to the JMS provider and start it.

Specified by:
open in interface JmsJndiEnvironment

isOpen

public final boolean isOpen()
Returns the information if the connection to the JMS provider is active.

Specified by:
isOpen in interface JmsJndiEnvironment
Returns:
If the connection is open and started TRUE else FALSE.

close

public final void close()
Close the JMS connection to the provider.

Specified by:
close in interface JmsJndiEnvironment

getTopic

public final javax.jms.Topic getTopic(java.lang.String name)
Creates a topic for a given name.

Specified by:
getTopic in interface JmsJndiEnvironment
Parameters:
name - Name of the topic to create.
Returns:
New topic instance.

getConnection

public final javax.jms.TopicConnection getConnection()
Returns the JMS provider connection. Do only use if isOpen() returns TRUE!

Specified by:
getConnection in interface JmsJndiEnvironment
Returns:
Active connection.

getContext

public final javax.naming.Context getContext()
Return the naming context.

Specified by:
getContext in interface JmsJndiEnvironment
Returns:
Naming context.


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