org.apache.camel.component.direct
Class DirectEndpoint

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

@UriEndpoint(scheme="direct",
             consumerClass=DirectConsumer.class)
public class DirectEndpoint
extends DefaultEndpoint

Represents a direct endpoint that synchronously invokes the consumer of the endpoint when a producer sends a message to it.

Version:

Field Summary
 
Fields inherited from class org.apache.camel.support.ServiceSupport
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
 
Constructor Summary
DirectEndpoint()
           
DirectEndpoint(String endpointUri, Component component)
           
DirectEndpoint(String uri, Component component, Map<String,DirectConsumer> consumers)
           
 
Method Summary
 void addConsumer(DirectConsumer consumer)
           
 Consumer createConsumer(Processor processor)
          Creates a new Event Driven Consumer which consumes messages from the endpoint using the given processor
 Producer createProducer()
          Creates a new producer which is used send messages into the endpoint
 DirectConsumer getConsumer()
           
protected  String getKey()
           
 long getTimeout()
           
 boolean hasConsumer(DirectConsumer consumer)
           
 boolean isBlock()
           
 boolean isSingleton()
          Whether this class supports being singleton or not.
 void removeConsumer(DirectConsumer consumer)
           
 void setBlock(boolean block)
           
 void setTimeout(long timeout)
           
 
Methods inherited from class org.apache.camel.impl.DefaultEndpoint
configureConsumer, configurePollingConsumer, configureProperties, createEndpointConfiguration, createEndpointUri, createExchange, createExchange, createExchange, createPollingConsumer, doStart, doStop, equals, getCamelContext, getComponent, getConsumerProperties, getEndpointConfiguration, getEndpointKey, getEndpointUri, getExchangePattern, getId, hashCode, isLenientProperties, isSynchronous, setCamelContext, setConsumerProperties, setEndpointConfiguration, setEndpointUri, setEndpointUriIfNotSpecified, setExchangePattern, setProperties, setSynchronous, 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
 

Constructor Detail

DirectEndpoint

public DirectEndpoint()

DirectEndpoint

public DirectEndpoint(String endpointUri,
                      Component component)

DirectEndpoint

public DirectEndpoint(String uri,
                      Component component,
                      Map<String,DirectConsumer> consumers)
Method Detail

createProducer

public Producer createProducer()
                        throws Exception
Description copied from interface: Endpoint
Creates a new producer which is used send messages into the endpoint

Returns:
a newly created producer
Throws:
Exception - can be thrown

createConsumer

public Consumer createConsumer(Processor processor)
                        throws Exception
Description copied from interface: Endpoint
Creates a new Event Driven Consumer which consumes messages from the endpoint using the given processor

Parameters:
processor - the given processor
Returns:
a newly created consumer
Throws:
Exception - can be thrown

isSingleton

public boolean isSingleton()
Description copied from interface: IsSingleton
Whether this class supports being singleton or not.

Returns:
true to be a single shared instance, false to create new instances.

addConsumer

public void addConsumer(DirectConsumer consumer)

removeConsumer

public void removeConsumer(DirectConsumer consumer)

hasConsumer

public boolean hasConsumer(DirectConsumer consumer)

getConsumer

public DirectConsumer getConsumer()

isBlock

public boolean isBlock()

setBlock

public void setBlock(boolean block)

getTimeout

public long getTimeout()

setTimeout

public void setTimeout(long timeout)

getKey

protected String getKey()


Apache Camel