org.apache.camel.impl
Class DefaultComponent<E extends Exchange>

java.lang.Object
  extended by org.apache.camel.impl.ServiceSupport
      extended by org.apache.camel.impl.DefaultComponent<E>
All Implemented Interfaces:
Component<E>, Service
Direct Known Subclasses:
BeanComponent, FileComponent, JMXComponent, LogComponent, MockComponent, SedaComponent, TimerComponent

public abstract class DefaultComponent<E extends Exchange>
extends ServiceSupport
implements Component<E>

Version:
$Revision: 563607 $

Constructor Summary
DefaultComponent()
           
DefaultComponent(CamelContext context)
           
 
Method Summary
 Endpoint<E> createEndpoint(String uri)
          Attempt to resolve an endpoint for the given URI if the component is capable of handling the URI
protected abstract  Endpoint<E> createEndpoint(String uri, String remaining, Map parameters)
          A factory method allowing derived components to create a new endpoint from the given URI, remaining path and optional parameters
protected  ScheduledExecutorService createExecutorService()
          A factory method to create a default thread pool and executor
protected  void doStart()
           
protected  void doStop()
           
 CamelContext getCamelContext()
          Returns the context
 ScheduledExecutorService getExecutorService()
           
 void setCamelContext(CamelContext context)
          The CamelContext is injected into the component when it is added to it
 void setExecutorService(ScheduledExecutorService executorService)
           
 
Methods inherited from class org.apache.camel.impl.ServiceSupport
addChildService, getThreadName, isStarted, isStopped, isStopping, nextThreadCounter, removeChildService, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultComponent

public DefaultComponent()

DefaultComponent

public DefaultComponent(CamelContext context)
Method Detail

createEndpoint

public Endpoint<E> createEndpoint(String uri)
                                            throws Exception
Description copied from interface: Component
Attempt to resolve an endpoint for the given URI if the component is capable of handling the URI

Specified by:
createEndpoint in interface Component<E extends Exchange>
Parameters:
uri - the URI to create
Returns:
a newly created endpoint or null if this component cannot create instances of the given uri
Throws:
Exception

getCamelContext

public CamelContext getCamelContext()
Description copied from interface: Component
Returns the context

Specified by:
getCamelContext in interface Component<E extends Exchange>
Returns:
the context of this component

setCamelContext

public void setCamelContext(CamelContext context)
Description copied from interface: Component
The CamelContext is injected into the component when it is added to it

Specified by:
setCamelContext in interface Component<E extends Exchange>

getExecutorService

public ScheduledExecutorService getExecutorService()

setExecutorService

public void setExecutorService(ScheduledExecutorService executorService)

createExecutorService

protected ScheduledExecutorService createExecutorService()
A factory method to create a default thread pool and executor


doStart

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

doStop

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

createEndpoint

protected abstract Endpoint<E> createEndpoint(String uri,
                                              String remaining,
                                              Map parameters)
                                                        throws Exception
A factory method allowing derived components to create a new endpoint from the given URI, remaining path and optional parameters

Parameters:
uri - the full URI of the endpoint
remaining - the remaining part of the URI without the query parameters or component prefix
parameters - the optional parameters passed in
Returns:
a newly created endpoint or null if the endpoint cannot be created based on the inputs
Throws:
Exception


Copyright © 2007 Apache Software Foundation. All Rights Reserved.