org.codehaus.messenger
Class MessengerPoolSupport

java.lang.Object
  extended byorg.codehaus.messenger.MessengerPoolSupport
All Implemented Interfaces:
MessengerPool
Direct Known Subclasses:
DefaultMessengerPool, SimpleMessengerPool

public abstract class MessengerPoolSupport
extends java.lang.Object
implements MessengerPool

SimpleMessengerPool.java is a useful base class for implementation inheritence.

Version:
$Revision: 1.2 $
Author:
James Strachan

Constructor Summary
MessengerPoolSupport()
           
MessengerPoolSupport(SessionFactory factory)
           
 
Method Summary
 void close()
          Closes this connection and any related Messenger instances
protected  Messenger createMessenger()
          Factory method to create a new Messenger instances
 SessionFactory getFactory()
           
abstract  Messenger getMessenger()
          Creates a new Messenger instance, using a JMS session from the pool.
 void setFactory(SessionFactory factory)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessengerPoolSupport

public MessengerPoolSupport()

MessengerPoolSupport

public MessengerPoolSupport(SessionFactory factory)
Method Detail

getFactory

public SessionFactory getFactory()
Returns:

setFactory

public void setFactory(SessionFactory factory)
Parameters:
factory -

close

public void close()
           throws JMSException
Description copied from interface: MessengerPool
Closes this connection and any related Messenger instances

Specified by:
close in interface MessengerPool
Throws:
JMSException

getMessenger

public abstract Messenger getMessenger()
                                throws JMSException
Description copied from interface: MessengerPool
Creates a new Messenger instance, using a JMS session from the pool. To return the session back to the pull, call Messenger.close()

Specified by:
getMessenger in interface MessengerPool
Returns:
a new Messenger from the pool
Throws:
JMSException

createMessenger

protected Messenger createMessenger()
                             throws JMSException
Factory method to create a new Messenger instances

Returns:
Throws:
JMSException


Copyright © 2004 Protique, Ltd.. All Rights Reserved.