org.apache.camel.component.jms
Class JmsConsumer

java.lang.Object
  extended by org.apache.camel.impl.ServiceSupport
      extended by org.apache.camel.impl.DefaultConsumer
          extended by org.apache.camel.component.jms.JmsConsumer
All Implemented Interfaces:
Consumer, Service, ShutdownableService, SuspendableService

public class JmsConsumer
extends DefaultConsumer
implements SuspendableService

A Consumer which uses Spring's AbstractMessageListenerContainer implementations to consume JMS messages

Version:
$Revision: 16521 $

Field Summary
 
Fields inherited from class org.apache.camel.impl.DefaultConsumer
log
 
Constructor Summary
JmsConsumer(JmsEndpoint endpoint, Processor processor, AbstractMessageListenerContainer listenerContainer)
           
 
Method Summary
protected  void createMessageListener(JmsEndpoint endpoint, Processor processor)
           
protected  void createMessageListenerContainer()
           
protected  void doStart()
           
protected  void doStop()
           
 JmsEndpoint getEndpoint()
           
 EndpointMessageListener getEndpointMessageListener()
           
 AbstractMessageListenerContainer getListenerContainer()
           
 boolean isSuspended()
           
 void resume()
           
 void startListenerContainer()
          Starts the JMS listener container

Can be used to start this consumer later if it was configured to not auto startup.

 void suspend()
           
protected  void testConnectionOnStartup()
          Pre tests the connection before starting the listening.
 
Methods inherited from class org.apache.camel.impl.DefaultConsumer
getAsyncProcessor, getExceptionHandler, getProcessor, handleException, setExceptionHandler, toString
 
Methods inherited from class org.apache.camel.impl.ServiceSupport
addChildService, doShutdown, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, removeChildService, shutdown, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.camel.Service
start, stop
 

Constructor Detail

JmsConsumer

public JmsConsumer(JmsEndpoint endpoint,
                   Processor processor,
                   AbstractMessageListenerContainer listenerContainer)
Method Detail

getEndpoint

public JmsEndpoint getEndpoint()
Specified by:
getEndpoint in interface Consumer
Overrides:
getEndpoint in class DefaultConsumer

getListenerContainer

public AbstractMessageListenerContainer getListenerContainer()

getEndpointMessageListener

public EndpointMessageListener getEndpointMessageListener()

createMessageListener

protected void createMessageListener(JmsEndpoint endpoint,
                                     Processor processor)

createMessageListenerContainer

protected void createMessageListenerContainer()

startListenerContainer

public void startListenerContainer()
Starts the JMS listener container

Can be used to start this consumer later if it was configured to not auto startup.


testConnectionOnStartup

protected void testConnectionOnStartup()
                                throws FailedToCreateConsumerException
Pre tests the connection before starting the listening.

In case of connection failure the exception is thrown which prevents Camel from starting.

Throws:
FailedToCreateConsumerException - is thrown if testing the connection failed

doStart

protected void doStart()
                throws Exception
Overrides:
doStart in class DefaultConsumer
Throws:
Exception

doStop

protected void doStop()
               throws Exception
Overrides:
doStop in class DefaultConsumer
Throws:
Exception

suspend

public void suspend()
Specified by:
suspend in interface SuspendableService

resume

public void resume()
Specified by:
resume in interface SuspendableService

isSuspended

public boolean isSuspended()
Specified by:
isSuspended in interface SuspendableService


Copyright © 2007-2010 IONA Open Source Community. All Rights Reserved.