net.officefloor.plugin.jms.server
Class JmsServerManagedObjectSource

java.lang.Object
  extended by net.officefloor.frame.spi.managedobject.source.impl.AbstractAsyncManagedObjectSource<D,F>
      extended by net.officefloor.frame.spi.managedobject.source.impl.AbstractManagedObjectSource<None,JmsServerManagedObjectSource.JmsServerFlows>
          extended by net.officefloor.plugin.jms.server.JmsServerManagedObjectSource
All Implemented Interfaces:
javax.jms.ServerSessionPool, ManagedObjectSource<None,JmsServerManagedObjectSource.JmsServerFlows>

public class JmsServerManagedObjectSource
extends AbstractManagedObjectSource<None,JmsServerManagedObjectSource.JmsServerFlows>
implements javax.jms.ServerSessionPool

JMS Server ManagedObjectSource.

Author:
Daniel Sagenschneider

Nested Class Summary
static class JmsServerManagedObjectSource.JmsServerFlows
          Provides the flow instances.
 
Nested classes/interfaces inherited from class net.officefloor.frame.spi.managedobject.source.impl.AbstractAsyncManagedObjectSource
AbstractAsyncManagedObjectSource.DependencyLabeller, AbstractAsyncManagedObjectSource.Labeller, AbstractAsyncManagedObjectSource.MetaDataContext<D extends Enum<D>,F extends Enum<F>>, AbstractAsyncManagedObjectSource.SpecificationContext
 
Field Summary
static String JMS_MAX_SERVER_SESSIONS
          Property name to obtain the maximum number of ServerSession instances.
static String JMS_MESSAGE_SELECTOR
          Property name to obtain the message selector.
 
Constructor Summary
JmsServerManagedObjectSource()
           
 
Method Summary
protected  ManagedObject getManagedObject()
          Synchronously obtains the ManagedObject.
 javax.jms.ServerSession getServerSession()
           
protected  void loadMetaData(AbstractAsyncManagedObjectSource.MetaDataContext<None,JmsServerManagedObjectSource.JmsServerFlows> context)
          Overridden to load meta-data.
protected  void loadSpecification(AbstractAsyncManagedObjectSource.SpecificationContext context)
          Overridden to load specifications.
protected  void returnJmsServerManagedObject(JmsServerManagedObject jmsServerManagedObject)
          Returns the JmsServerManagedObject to its pool.
 void runSession(JmsServerManagedObject managedObject)
          Runs the Session to obtain the Message.
 void start(ManagedObjectExecuteContext<JmsServerManagedObjectSource.JmsServerFlows> context)
           Called once after ManagedObjectSource.init(ManagedObjectSourceContext) to indicate this ManagedObjectSource should start execution.
 
Methods inherited from class net.officefloor.frame.spi.managedobject.source.impl.AbstractManagedObjectSource
sourceManagedObject
 
Methods inherited from class net.officefloor.frame.spi.managedobject.source.impl.AbstractAsyncManagedObjectSource
getMetaData, getSpecification, init, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JMS_MESSAGE_SELECTOR

public static final String JMS_MESSAGE_SELECTOR
Property name to obtain the message selector.

See Also:
Constant Field Values

JMS_MAX_SERVER_SESSIONS

public static final String JMS_MAX_SERVER_SESSIONS
Property name to obtain the maximum number of ServerSession instances.

See Also:
Constant Field Values
Constructor Detail

JmsServerManagedObjectSource

public JmsServerManagedObjectSource()
Method Detail

returnJmsServerManagedObject

protected void returnJmsServerManagedObject(JmsServerManagedObject jmsServerManagedObject)
Returns the JmsServerManagedObject to its pool.

Parameters:
jmsServerManagedObject - JmsServerManagedObject to be returned to pool.

runSession

public void runSession(JmsServerManagedObject managedObject)
Runs the Session to obtain the Message.

Parameters:
managedObject - JmsServerManagedObject.

loadSpecification

protected void loadSpecification(AbstractAsyncManagedObjectSource.SpecificationContext context)
Description copied from class: AbstractAsyncManagedObjectSource
Overridden to load specifications.

Specified by:
loadSpecification in class AbstractAsyncManagedObjectSource<None,JmsServerManagedObjectSource.JmsServerFlows>
Parameters:
context - Specifications.

loadMetaData

protected void loadMetaData(AbstractAsyncManagedObjectSource.MetaDataContext<None,JmsServerManagedObjectSource.JmsServerFlows> context)
                     throws Exception
Description copied from class: AbstractAsyncManagedObjectSource
Overridden to load meta-data.

Specified by:
loadMetaData in class AbstractAsyncManagedObjectSource<None,JmsServerManagedObjectSource.JmsServerFlows>
Parameters:
context - Meta-data.
Throws:
Exception - If fails to load the meta-data.

start

public void start(ManagedObjectExecuteContext<JmsServerManagedObjectSource.JmsServerFlows> context)
           throws Exception
Description copied from interface: ManagedObjectSource

Called once after ManagedObjectSource.init(ManagedObjectSourceContext) to indicate this ManagedObjectSource should start execution.

On invocation of this method, ProcessState instances may be invoked via the ManagedObjectExecuteContext.

Specified by:
start in interface ManagedObjectSource<None,JmsServerManagedObjectSource.JmsServerFlows>
Overrides:
start in class AbstractAsyncManagedObjectSource<None,JmsServerManagedObjectSource.JmsServerFlows>
Parameters:
context - ManagedObjectExecuteContext to use in starting this ManagedObjectSource.
Throws:
Exception - Should the ManagedObjectSource fail to start execution.

getManagedObject

protected ManagedObject getManagedObject()
                                  throws Throwable
Description copied from class: AbstractManagedObjectSource
Synchronously obtains the ManagedObject.

Specified by:
getManagedObject in class AbstractManagedObjectSource<None,JmsServerManagedObjectSource.JmsServerFlows>
Returns:
ManagedObject.
Throws:
Throwable - If fails to obtain the ManagedObject.

getServerSession

public javax.jms.ServerSession getServerSession()
                                         throws javax.jms.JMSException
Specified by:
getServerSession in interface javax.jms.ServerSessionPool
Throws:
javax.jms.JMSException


Copyright © 2005-2013. All Rights Reserved.