org.apache.camel.component.jt400
Class Jt400DataQueueConsumer

java.lang.Object
  extended by org.apache.camel.impl.ServiceSupport
      extended by org.apache.camel.impl.PollingConsumerSupport
          extended by org.apache.camel.component.jt400.Jt400DataQueueConsumer
All Implemented Interfaces:
Consumer, PollingConsumer, Service, ShutdownableService

public class Jt400DataQueueConsumer
extends PollingConsumerSupport

PollingConsumer that polls a data queue for data


Field Summary
 
Fields inherited from class org.apache.camel.impl.PollingConsumerSupport
log
 
Constructor Summary
protected Jt400DataQueueConsumer(Jt400DataQueueEndpoint endpoint)
          Creates a new consumer instance
 
Method Summary
protected  void doStart()
           
protected  void doStop()
           
 Exchange receive()
          Waits until a message is available and then returns it.
 Exchange receive(long timeout)
          Receives an entry from a data queue and returns an Exchange to send this data If the endpoint's format is set to Jt400DataQueueEndpoint.Format.binary, the data queue entry's data will be received/sent as a byte[].
 Exchange receiveNoWait()
          Attempts to receive a message exchange immediately without waiting and returning null if a message exchange is not available yet.
 
Methods inherited from class org.apache.camel.impl.PollingConsumerSupport
getEndpoint, getExceptionHandler, handleException, setExceptionHandler, toString
 
Methods inherited from class org.apache.camel.impl.ServiceSupport
addChildService, doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspended, isSuspending, removeChildService, resume, shutdown, start, start, stop, suspend
 
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

Jt400DataQueueConsumer

protected Jt400DataQueueConsumer(Jt400DataQueueEndpoint endpoint)
Creates a new consumer instance

Method Detail

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

receive

public Exchange receive()
Description copied from interface: PollingConsumer
Waits until a message is available and then returns it. Warning that this method could block indefinitely if no messages are available.

Will return null if the consumer is not started

Returns:
the message exchange received.

receiveNoWait

public Exchange receiveNoWait()
Description copied from interface: PollingConsumer
Attempts to receive a message exchange immediately without waiting and returning null if a message exchange is not available yet.

Returns:
the message exchange if one is immediately available otherwise null

receive

public Exchange receive(long timeout)
Receives an entry from a data queue and returns an Exchange to send this data If the endpoint's format is set to Jt400DataQueueEndpoint.Format.binary, the data queue entry's data will be received/sent as a byte[]. If the endpoint's format is set to Jt400DataQueueEndpoint.Format.text, the data queue entry's data will be received/sent as a String.

Parameters:
timeout - time to wait when reading from data queue. A value of -1 indicates a blocking read.
Returns:
the message exchange if one iwas available within the timeout period, or null if the timeout expired


Apache CAMEL