org.apache.activemq.tool
Class AbstractJmsClient

java.lang.Object
  extended by org.apache.activemq.tool.AbstractJmsClient
Direct Known Subclasses:
AbstractJmsMeasurableClient

public abstract class AbstractJmsClient
extends Object


Field Summary
protected  String clientName
           
protected  int destCount
           
protected  int destIndex
           
protected  ConnectionFactory factory
           
protected  Connection jmsConnection
           
protected  Session jmsSession
           
 
Constructor Summary
AbstractJmsClient(ConnectionFactory factory)
           
 
Method Summary
 boolean commitTxIfNecessary()
          Helper method that checks if session is transacted and whether to commit the tx based on commitAfterXMsgs property.
 Destination createCompositeDestination(int destIndex, int destCount)
           
protected  Destination createCompositeDestination(String name, int destIndex, int destCount)
           
 Destination[] createDestination(int destIndex, int destCount)
           
protected  Destination createDestination(String name)
           
abstract  JmsClientProperties getClient()
           
 String getClientName()
           
 Connection getConnection()
           
 int getDestCount()
           
 int getDestIndex()
           
 ConnectionFactory getFactory()
           
 Session getSession()
           
abstract  void setClient(JmsClientProperties client)
           
 void setClientName(String clientName)
           
 void setDestCount(int destCount)
           
 void setDestIndex(int destIndex)
           
 void setFactory(ConnectionFactory factory)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

factory

protected ConnectionFactory factory

jmsConnection

protected Connection jmsConnection

jmsSession

protected Session jmsSession

destCount

protected int destCount

destIndex

protected int destIndex

clientName

protected String clientName
Constructor Detail

AbstractJmsClient

public AbstractJmsClient(ConnectionFactory factory)
Method Detail

getClient

public abstract JmsClientProperties getClient()

setClient

public abstract void setClient(JmsClientProperties client)

getFactory

public ConnectionFactory getFactory()

setFactory

public void setFactory(ConnectionFactory factory)

getDestCount

public int getDestCount()

setDestCount

public void setDestCount(int destCount)

getDestIndex

public int getDestIndex()

setDestIndex

public void setDestIndex(int destIndex)

getClientName

public String getClientName()

setClientName

public void setClientName(String clientName)

getConnection

public Connection getConnection()
                         throws JMSException
Throws:
JMSException

getSession

public Session getSession()
                   throws JMSException
Throws:
JMSException

createDestination

public Destination[] createDestination(int destIndex,
                                       int destCount)
                                throws JMSException
Throws:
JMSException

createCompositeDestination

public Destination createCompositeDestination(int destIndex,
                                              int destCount)
                                       throws JMSException
Throws:
JMSException

createCompositeDestination

protected Destination createCompositeDestination(String name,
                                                 int destIndex,
                                                 int destCount)
                                          throws JMSException
Throws:
JMSException

createDestination

protected Destination createDestination(String name)
                                 throws JMSException
Throws:
JMSException

commitTxIfNecessary

public boolean commitTxIfNecessary()
                            throws JMSException
Helper method that checks if session is transacted and whether to commit the tx based on commitAfterXMsgs property.

Returns:
true if transaction was committed.
Throws:
JMSException - in case the call to JMS Session.commit() fails.


Copyright © 2005–2013 The Apache Software Foundation. All rights reserved.