org.apache.camel.impl
Class DefaultConsumer

java.lang.Object
  extended by org.apache.camel.impl.ServiceSupport
      extended by org.apache.camel.impl.DefaultConsumer
All Implemented Interfaces:
Consumer, Service, ShutdownableService
Direct Known Subclasses:
CacheConsumer, CometdConsumer, CxfConsumer, CxfRsConsumer, DataSetConsumer, DirectConsumer, EventConsumer, HttpConsumer, HttpConsumer, IrcConsumer, JavaSpaceConsumer, JmsConsumer, LoadBalancerConsumer, MinaConsumer, NettyConsumer, QuartzConsumer, QuickfixConsumer, RestletConsumer, RmiConsumer, ScheduledPollConsumer, SmppConsumer, SnmpTrapConsumer, SpringIntegrationConsumer, StreamConsumer, TimerConsumer, XmppConsumer

public class DefaultConsumer
extends ServiceSupport
implements Consumer

A default consumer useful for implementation inheritance.

Version:
$Revision: 19985 $

Field Summary
protected  org.apache.commons.logging.Log log
           
 
Constructor Summary
DefaultConsumer(Endpoint endpoint, Processor processor)
           
 
Method Summary
protected  void doStart()
           
protected  void doStop()
           
 AsyncProcessor getAsyncProcessor()
          Provides an AsyncProcessor interface to the configured processor on the consumer.
 Endpoint getEndpoint()
          Gets the endpoint this Consumer consumes from.
 ExceptionHandler getExceptionHandler()
           
 Processor getProcessor()
           
protected  void handleException(Throwable t)
          Handles the given exception using the getExceptionHandler()
 void setExceptionHandler(ExceptionHandler exceptionHandler)
           
 String 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
 

Field Detail

log

protected final transient org.apache.commons.logging.Log log
Constructor Detail

DefaultConsumer

public DefaultConsumer(Endpoint endpoint,
                       Processor processor)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

getEndpoint

public Endpoint getEndpoint()
Description copied from interface: Consumer
Gets the endpoint this Consumer consumes from.

Specified by:
getEndpoint in interface Consumer
Returns:
the endpoint

getProcessor

public Processor getProcessor()

getAsyncProcessor

public AsyncProcessor getAsyncProcessor()
Provides an AsyncProcessor interface to the configured processor on the consumer. If the processor does not implement the interface, it will be adapted so that it does.


getExceptionHandler

public ExceptionHandler getExceptionHandler()

setExceptionHandler

public void setExceptionHandler(ExceptionHandler exceptionHandler)

doStop

protected void doStop()
               throws Exception
Specified by:
doStop in class ServiceSupport
Throws:
Exception

doStart

protected void doStart()
                throws Exception
Specified by:
doStart in class ServiceSupport
Throws:
Exception

handleException

protected void handleException(Throwable t)
Handles the given exception using the getExceptionHandler()

Parameters:
t - the exception to handle


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