org.apache.camel.component.timer
Class TimerEndpoint

java.lang.Object
  extended by org.apache.camel.impl.DefaultEndpoint
      extended by org.apache.camel.component.timer.TimerEndpoint
All Implemented Interfaces:
CamelContextAware, Endpoint, IsSingleton, Service, HasId, ManagementAware<TimerEndpoint>

@ManagedResource(description="Managed Timer Endpoint")
public class TimerEndpoint
extends DefaultEndpoint
implements Service, ManagementAware<TimerEndpoint>

Represents a timer endpoint that can generate periodic inbound exchanges triggered by a timer.

Version:
$Revision: 948652 $

Constructor Summary
TimerEndpoint()
           
TimerEndpoint(String endpointUri)
           
TimerEndpoint(String endpointUri, Timer timer)
           
TimerEndpoint(String fullURI, TimerComponent component, String timerName)
           
 
Method Summary
 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
 String getCamelId()
           
 long getDelay()
           
 String getEndpointUri()
          Returns the string representation of the endpoint URI
 Object getManagedObject(TimerEndpoint object)
          Gets the managed object
 long getPeriod()
           
 Date getTime()
           
 Timer getTimer()
           
 String getTimerName()
           
 boolean isDaemon()
           
 boolean isFixedRate()
           
 boolean isSingleton()
          Whether this class supports being singleton or not.
 void setDaemon(boolean daemon)
           
 void setDelay(long delay)
           
 void setFixedRate(boolean fixedRate)
           
 void setPeriod(long period)
           
 void setTime(Date time)
           
 void setTimer(Timer timer)
           
 void setTimerName(String timerName)
           
 void start()
          Starts the service
 void stop()
          Stops the service
 
Methods inherited from class org.apache.camel.impl.DefaultEndpoint
configureProperties, createEndpointUri, createExchange, createExchange, createExchange, createPollingConsumer, equals, getCamelContext, getComponent, getEndpointKey, getExchangePattern, getExchangeType, getId, hashCode, isLenientProperties, isSynchronous, sanitizeUri, setCamelContext, setEndpointUri, setEndpointUriIfNotSpecified, setExchangePattern, setSynchronous, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TimerEndpoint

public TimerEndpoint()

TimerEndpoint

public TimerEndpoint(String fullURI,
                     TimerComponent component,
                     String timerName)

TimerEndpoint

public TimerEndpoint(String endpointUri,
                     Timer timer)

TimerEndpoint

public TimerEndpoint(String endpointUri)
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

Specified by:
createProducer in interface 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

Specified by:
createConsumer in interface Endpoint
Parameters:
processor - the given processor
Returns:
a newly created consumer
Throws:
Exception - can be thrown

getManagedObject

public Object getManagedObject(TimerEndpoint object)
Description copied from interface: ManagementAware
Gets the managed object

Specified by:
getManagedObject in interface ManagementAware<TimerEndpoint>
Parameters:
object - the object to be managed
Returns:
the managed object

start

public void start()
           throws Exception
Description copied from interface: Service
Starts the service

Specified by:
start in interface Service
Overrides:
start in class DefaultEndpoint
Throws:
Exception - is thrown if starting failed

stop

public void stop()
          throws Exception
Description copied from interface: Service
Stops the service

Specified by:
stop in interface Service
Overrides:
stop in class DefaultEndpoint
Throws:
Exception - is thrown if stopping failed

getTimerName

@ManagedAttribute(description="Timer Name")
public String getTimerName()

setTimerName

@ManagedAttribute(description="Timer Name")
public void setTimerName(String timerName)

isDaemon

@ManagedAttribute(description="Timer Daemon")
public boolean isDaemon()

setDaemon

@ManagedAttribute(description="Timer Daemon")
public void setDaemon(boolean daemon)

getDelay

@ManagedAttribute(description="Timer Delay")
public long getDelay()

setDelay

@ManagedAttribute(description="Timer Delay")
public void setDelay(long delay)

isFixedRate

@ManagedAttribute(description="Timer FixedRate")
public boolean isFixedRate()

setFixedRate

@ManagedAttribute(description="Timer FixedRate")
public void setFixedRate(boolean fixedRate)

getPeriod

@ManagedAttribute(description="Timer Period")
public long getPeriod()

setPeriod

@ManagedAttribute(description="Timer Period")
public void setPeriod(long period)

getTime

public Date getTime()

setTime

public void setTime(Date time)

isSingleton

@ManagedAttribute(description="Singleton")
public boolean isSingleton()
Description copied from interface: IsSingleton
Whether this class supports being singleton or not.

Specified by:
isSingleton in interface IsSingleton
Returns:
true to be a single shared instance, false to create new instances.

getTimer

public Timer getTimer()

setTimer

public void setTimer(Timer timer)

getCamelId

@ManagedAttribute(description="Camel id")
public String getCamelId()

getEndpointUri

@ManagedAttribute(description="Endpoint Uri")
public String getEndpointUri()
Description copied from interface: Endpoint
Returns the string representation of the endpoint URI

Specified by:
getEndpointUri in interface Endpoint
Overrides:
getEndpointUri in class DefaultEndpoint
Returns:
the endpoint URI


Apache CAMEL