org.apache.camel.component.sjms
Class SjmsEndpoint

java.lang.Object
  extended by org.apache.camel.support.ServiceSupport
      extended by org.apache.camel.impl.DefaultEndpoint
          extended by org.apache.camel.component.sjms.SjmsEndpoint
All Implemented Interfaces:
org.apache.camel.CamelContextAware, org.apache.camel.Endpoint, org.apache.camel.IsSingleton, org.apache.camel.MultipleConsumersSupport, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.HasId, org.apache.camel.StatefulService, org.apache.camel.SuspendableService

@UriEndpoint(scheme="sjms",
             consumerClass=SjmsConsumer.class)
public class SjmsEndpoint
extends org.apache.camel.impl.DefaultEndpoint
implements org.apache.camel.MultipleConsumersSupport

A JMS Endpoint


Field Summary
protected  org.slf4j.Logger logger
           
 
Fields inherited from class org.apache.camel.support.ServiceSupport
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
 
Constructor Summary
SjmsEndpoint()
           
SjmsEndpoint(String uri, org.apache.camel.Component component)
           
 
Method Summary
 org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor)
           
 org.apache.camel.Producer createProducer()
           
protected  void doStart()
           
protected  void doStop()
           
 SessionAcknowledgementType getAcknowledgementMode()
          Returns the configured acknowledgementMode.
 SjmsComponent getComponent()
           
 ConnectionResource getConnectionResource()
           
 int getConsumerCount()
          Returns the number of consumer listeners for this endpoint.
 String getDestinationName()
           
 String getDurableSubscriptionId()
          Gets the durable subscription Id.
 KeyFormatStrategy getJmsKeyFormatStrategy()
           
 String getMessageSelector()
          Returns the JMS Message selector syntax used to refine the messages being consumed.
 String getNamedReplyTo()
          Returns the reply to destination name used for InOut producer endpoints.
 int getProducerCount()
          Returns the number of consumer listeners for this endpoint.
 long getResponseTimeOut()
          Returns the InOut response timeout.
 int getSessionCount()
          Deprecated. 
 org.apache.camel.spi.HeaderFilterStrategy getSjmsHeaderFilterStrategy()
           
 int getTransactionBatchCount()
          If transacted, returns the nubmer of messages to be processed before committing the transaction.
 long getTransactionBatchTimeout()
          Returns the timeout value for batch transactions.
 TransactionCommitStrategy getTransactionCommitStrategy()
          Gets the commit strategy.
 long getTtl()
          Returns the Time To Live set on this endpoint.
 boolean isMultipleConsumersSupported()
           
 boolean isPersistent()
          Use to determine if the enpoint has message persistence enabled or disabled.
 boolean isSingleton()
           
 boolean isSynchronous()
          Use to determine whether or not to process exchanges synchronously.
 boolean isTopic()
          Flag set by the endpoint used by consumers and producers to determine if the endpoint is a JMS Topic.
 boolean isTransacted()
          Use to determine if transactions are enabled or disabled.
 void setAcknowledgementMode(SessionAcknowledgementType acknowledgementMode)
          Sets the acknowledgementMode configured on this endpoint.
 void setConsumerCount(int consumerCount)
          Sets the number of consumer listeners used for this endpoint.
 void setDurableSubscriptionId(String durableSubscriptionId)
          Sets the durable subscription Id required for durable topics.
 void setMessageSelector(String messageSelector)
          Sets the JMS Message selector syntax.
 void setNamedReplyTo(String namedReplyTo)
          Sets the reply to destination name used for InOut producer endpoints.
 void setPersistent(boolean persistent)
          Flag used to enable/disable message persistence.
 void setProducerCount(int producerCount)
          Sets the number of producers used for this endpoint.
 void setResponseTimeOut(long responseTimeOut)
          Sets the amount of time we should wait before timing out a InOut response.
 void setSessionCount(int sessionCount)
          Deprecated. 
 void setSynchronous(boolean synchronous)
          Flag can be set to enable/disable synchronous exchange processing.
 void setTransacted(boolean transacted)
          Enable/disable flag for transactions
 void setTransactionBatchCount(int transactionBatchCount)
          If transacted sets the number of messages to process before committing a transaction.
 void setTransactionBatchTimeout(long transactionBatchTimeout)
          Sets timeout value for batch transactions.
 void setTransactionCommitStrategy(TransactionCommitStrategy transactionCommitStrategy)
          Sets the commit strategy.
 void setTtl(long ttl)
          Flag used to adjust the Time To Live value of produced messages.
 
Methods inherited from class org.apache.camel.impl.DefaultEndpoint
configureConsumer, configurePollingConsumer, configureProperties, createEndpointConfiguration, createEndpointUri, createExchange, createExchange, createExchange, createPollingConsumer, equals, getCamelContext, getConsumerProperties, getEndpointConfiguration, getEndpointKey, getEndpointUri, getExchangePattern, getId, hashCode, isLenientProperties, setCamelContext, setConsumerProperties, setEndpointConfiguration, setEndpointUri, setEndpointUriIfNotSpecified, setExchangePattern, setProperties, toString
 
Methods inherited from class org.apache.camel.support.ServiceSupport
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, resume, shutdown, start, stop, suspend
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.camel.Service
start, stop
 

Field Detail

logger

protected final org.slf4j.Logger logger
Constructor Detail

SjmsEndpoint

public SjmsEndpoint()

SjmsEndpoint

public SjmsEndpoint(String uri,
                    org.apache.camel.Component component)
Method Detail

getComponent

public SjmsComponent getComponent()
Overrides:
getComponent in class org.apache.camel.impl.DefaultEndpoint

doStart

protected void doStart()
                throws Exception
Overrides:
doStart in class org.apache.camel.impl.DefaultEndpoint
Throws:
Exception

doStop

protected void doStop()
               throws Exception
Overrides:
doStop in class org.apache.camel.impl.DefaultEndpoint
Throws:
Exception

createProducer

public org.apache.camel.Producer createProducer()
                                         throws Exception
Specified by:
createProducer in interface org.apache.camel.Endpoint
Throws:
Exception

createConsumer

public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor)
                                         throws Exception
Specified by:
createConsumer in interface org.apache.camel.Endpoint
Throws:
Exception

isMultipleConsumersSupported

public boolean isMultipleConsumersSupported()
Specified by:
isMultipleConsumersSupported in interface org.apache.camel.MultipleConsumersSupport

isSingleton

public boolean isSingleton()
Specified by:
isSingleton in interface org.apache.camel.IsSingleton

getDestinationName

public String getDestinationName()

getConnectionResource

public ConnectionResource getConnectionResource()

getSjmsHeaderFilterStrategy

public org.apache.camel.spi.HeaderFilterStrategy getSjmsHeaderFilterStrategy()

getJmsKeyFormatStrategy

public KeyFormatStrategy getJmsKeyFormatStrategy()

isSynchronous

public boolean isSynchronous()
Use to determine whether or not to process exchanges synchronously.

Overrides:
isSynchronous in class org.apache.camel.impl.DefaultEndpoint
Returns:
true if endoint is synchronous, otherwise false

setSynchronous

public void setSynchronous(boolean synchronous)
Flag can be set to enable/disable synchronous exchange processing.

Overrides:
setSynchronous in class org.apache.camel.impl.DefaultEndpoint
Parameters:
synchronous - true to process synchronously, default is true

getAcknowledgementMode

public SessionAcknowledgementType getAcknowledgementMode()
Returns the configured acknowledgementMode.

Returns:
the acknowledgementMode

setAcknowledgementMode

public void setAcknowledgementMode(SessionAcknowledgementType acknowledgementMode)
Sets the acknowledgementMode configured on this endpoint.

Parameters:
acknowledgementMode - default is SessionAcknowledgementType.AUTO_ACKNOWLEDGE

isTopic

public boolean isTopic()
Flag set by the endpoint used by consumers and producers to determine if the endpoint is a JMS Topic.

Returns:
the topic true if endpoint is a JMS Topic, default is false

getSessionCount

@Deprecated
public int getSessionCount()
Deprecated. 

Returns the number of Session instances expected on this endpoint.

Returns:
the sessionCount

setSessionCount

@Deprecated
public void setSessionCount(int sessionCount)
Deprecated. 

Sets the number of Session instances used for this endpoint. Value is ignored for endpoints that require a dedicated session such as a transacted or InOut endpoint.

Parameters:
sessionCount - the number of Session instances, default is 1

getProducerCount

public int getProducerCount()
Returns the number of consumer listeners for this endpoint.

Returns:
the producerCount

setProducerCount

public void setProducerCount(int producerCount)
Sets the number of producers used for this endpoint.

Parameters:
producerCount - the number of producers for this endpoint, default is 1

getConsumerCount

public int getConsumerCount()
Returns the number of consumer listeners for this endpoint.

Returns:
the consumerCount

setConsumerCount

public void setConsumerCount(int consumerCount)
Sets the number of consumer listeners used for this endpoint.

Parameters:
consumerCount - the number of consumers for this endpoint, default is 1

getTtl

public long getTtl()
Returns the Time To Live set on this endpoint.

Returns:
the ttl

setTtl

public void setTtl(long ttl)
Flag used to adjust the Time To Live value of produced messages.

Parameters:
ttl - a new TTL, default is -1 (disabled)

isPersistent

public boolean isPersistent()
Use to determine if the enpoint has message persistence enabled or disabled.

Returns:
true if persistent, otherwise false

setPersistent

public void setPersistent(boolean persistent)
Flag used to enable/disable message persistence.

Parameters:
persistent - true if persistent, default is true

getDurableSubscriptionId

public String getDurableSubscriptionId()
Gets the durable subscription Id.

Returns:
the durableSubscriptionId

setDurableSubscriptionId

public void setDurableSubscriptionId(String durableSubscriptionId)
Sets the durable subscription Id required for durable topics.

Parameters:
durableSubscriptionId - durable subscription Id or null

getResponseTimeOut

public long getResponseTimeOut()
Returns the InOut response timeout.

Returns:
the responseTimeOut

setResponseTimeOut

public void setResponseTimeOut(long responseTimeOut)
Sets the amount of time we should wait before timing out a InOut response.

Parameters:
responseTimeOut - response timeout

getMessageSelector

public String getMessageSelector()
Returns the JMS Message selector syntax used to refine the messages being consumed.

Returns:
the messageSelector

setMessageSelector

public void setMessageSelector(String messageSelector)
Sets the JMS Message selector syntax.

Parameters:
messageSelector - Message selector syntax or null

getTransactionBatchCount

public int getTransactionBatchCount()
If transacted, returns the nubmer of messages to be processed before committing the transaction.

Returns:
the transactionBatchCount

setTransactionBatchCount

public void setTransactionBatchCount(int transactionBatchCount)
If transacted sets the number of messages to process before committing a transaction.

Parameters:
transactionBatchCount - number of messages to process before committing, default is 1

getTransactionBatchTimeout

public long getTransactionBatchTimeout()
Returns the timeout value for batch transactions.

Returns:
long

setTransactionBatchTimeout

public void setTransactionBatchTimeout(long transactionBatchTimeout)
Sets timeout value for batch transactions.

Parameters:
transactionBatchTimeout -

getTransactionCommitStrategy

public TransactionCommitStrategy getTransactionCommitStrategy()
Gets the commit strategy.

Returns:
the transactionCommitStrategy

setTransactionCommitStrategy

public void setTransactionCommitStrategy(TransactionCommitStrategy transactionCommitStrategy)
Sets the commit strategy.

Parameters:
transactionCommitStrategy - commit strategy to use when processing transacted messages

isTransacted

public boolean isTransacted()
Use to determine if transactions are enabled or disabled.

Returns:
true if transacted, otherwise false

setTransacted

public void setTransacted(boolean transacted)
Enable/disable flag for transactions

Parameters:
transacted - true if transacted, otherwise false

getNamedReplyTo

public String getNamedReplyTo()
Returns the reply to destination name used for InOut producer endpoints.

Returns:
the namedReplyTo

setNamedReplyTo

public void setNamedReplyTo(String namedReplyTo)
Sets the reply to destination name used for InOut producer endpoints.

Parameters:
the - namedReplyTo the JMS reply to destination name


Apache Camel