org.apache.camel.component.dataset
Class DataSetEndpoint

java.lang.Object
  extended by org.apache.camel.support.ServiceSupport
      extended by org.apache.camel.impl.DefaultEndpoint
          extended by org.apache.camel.component.mock.MockEndpoint
              extended by org.apache.camel.component.dataset.DataSetEndpoint
All Implemented Interfaces:
CamelContextAware, Endpoint, IsSingleton, Service, ShutdownableService, BrowsableEndpoint, HasId, StatefulService, SuspendableService

public class DataSetEndpoint
extends MockEndpoint
implements Service

Endpoint for DataSet.

Version:

Field Summary
 
Fields inherited from class org.apache.camel.component.mock.MockEndpoint
copyOnExchange, reporter
 
Fields inherited from class org.apache.camel.support.ServiceSupport
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
 
Constructor Summary
DataSetEndpoint()
          Deprecated. 
DataSetEndpoint(String endpointUri, Component component, DataSet dataSet)
           
 
Method Summary
static void assertEquals(String description, Object expected, Object actual, Exchange exchange)
           
protected  void assertMessageExpected(long index, Exchange expected, Exchange actual)
           
 Consumer createConsumer(Processor processor)
          Creates a new Event Driven Consumer which consumes messages from the endpoint using the given processor
 Exchange createExchange(long messageIndex)
          Creates a message exchange for the given index in the DataSet
protected  ThroughputLogger createReporter()
           
protected  void doStart()
          Implementations override this method to support customized start/stop.
 long getConsumeDelay()
           
 DataSet getDataSet()
           
 long getInitialDelay()
           
 int getMinRate()
           
 long getPreloadSize()
           
 long getProduceDelay()
           
 int getReceivedCounter()
           
protected  void performAssertions(Exchange actual, Exchange copy)
          Performs the assertions on the incoming exchange.
 void reset()
           
 void setConsumeDelay(long consumeDelay)
          Allows a delay to be specified which causes consumers to pause - to simulate slow consumers
 void setDataSet(DataSet dataSet)
           
 void setInitialDelay(long initialDelay)
           
 void setMinRate(int minRate)
           
 void setPreloadSize(long preloadSize)
          Sets how many messages should be preloaded (sent) before the route completes its initialization
 void setProduceDelay(long produceDelay)
          Allows a delay to be specified which causes producers to pause - to simulate slow producers
protected  void waitForCompleteLatch(long timeout)
           
 
Methods inherited from class org.apache.camel.component.mock.MockEndpoint
addReceivedExchange, allMessages, assertEquals, assertExchangeReceived, assertIsNotSatisfied, assertIsNotSatisfied, assertIsSatisfied, assertIsSatisfied, assertIsSatisfied, assertIsSatisfied, assertIsSatisfied, assertIsSatisfied, assertMessagesAscending, assertMessagesDescending, assertMessagesSorted, assertNoDuplicates, assertTrue, assertWait, await, await, createProducer, doAssertIsSatisfied, expectedBodiesReceived, expectedBodiesReceived, expectedBodiesReceivedInAnyOrder, expectedBodiesReceivedInAnyOrder, expectedBodyReceived, expectedExchangePattern, expectedFileExists, expectedFileExists, expectedHeaderReceived, expectedHeaderValuesReceivedInAnyOrder, expectedHeaderValuesReceivedInAnyOrder, expectedMessageCount, expectedMessagesMatches, expectedMinimumMessageCount, expectedPropertyReceived, expects, expectsAscending, expectsAscending, expectsDescending, expectsDescending, expectsMessageCount, expectsNoDuplicates, expectsNoDuplicates, fail, getExchanges, getExpectedCount, getExpectedMinimumCount, getFailures, getReceivedExchanges, getReporter, getResultWaitTime, getSleepForEmptyTest, handle, isLenientProperties, isSingleton, message, onExchange, resetMocks, resolve, returnReplyBody, returnReplyHeader, setAssertPeriod, setAssertPeriod, setExpectedMessageCount, setMinimumExpectedMessageCount, setMinimumResultWaitTime, setReporter, setResultWaitTime, setRetainFirst, setRetainLast, setSleepForEmptyTest, waitForCompleteLatch, whenAnyExchangeReceived, whenExchangeReceived
 
Methods inherited from class org.apache.camel.impl.DefaultEndpoint
configureConsumer, configureProperties, createEndpointConfiguration, createEndpointUri, createExchange, createExchange, createExchange, createPollingConsumer, doStop, equals, getCamelContext, getComponent, getConsumerProperties, getEndpointConfiguration, getEndpointKey, getEndpointUri, getExchangePattern, getId, hashCode, isSynchronous, setCamelContext, setConsumerProperties, setEndpointConfiguration, setEndpointUri, setEndpointUriIfNotSpecified, setExchangePattern, setSynchronous, toString
 
Methods inherited from class org.apache.camel.support.ServiceSupport
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, 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
 
Methods inherited from interface org.apache.camel.Endpoint
configureProperties, createExchange, createExchange, createExchange, createPollingConsumer, getCamelContext, getEndpointConfiguration, getEndpointKey, getEndpointUri, setCamelContext
 

Constructor Detail

DataSetEndpoint

@Deprecated
public DataSetEndpoint()
Deprecated. 


DataSetEndpoint

public DataSetEndpoint(String endpointUri,
                       Component component,
                       DataSet dataSet)
Method Detail

assertEquals

public static void assertEquals(String description,
                                Object expected,
                                Object actual,
                                Exchange exchange)

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
Overrides:
createConsumer in class MockEndpoint
Parameters:
processor - the given processor
Returns:
a newly created consumer
Throws:
Exception - can be thrown

reset

public void reset()
Overrides:
reset in class MockEndpoint

getReceivedCounter

public int getReceivedCounter()
Overrides:
getReceivedCounter in class MockEndpoint

createExchange

public Exchange createExchange(long messageIndex)
                        throws Exception
Creates a message exchange for the given index in the DataSet

Throws:
Exception

getMinRate

public int getMinRate()

setMinRate

public void setMinRate(int minRate)

waitForCompleteLatch

protected void waitForCompleteLatch(long timeout)
                             throws InterruptedException
Overrides:
waitForCompleteLatch in class MockEndpoint
Throws:
InterruptedException

getDataSet

public DataSet getDataSet()

setDataSet

public void setDataSet(DataSet dataSet)

getPreloadSize

public long getPreloadSize()

setPreloadSize

public void setPreloadSize(long preloadSize)
Sets how many messages should be preloaded (sent) before the route completes its initialization


getConsumeDelay

public long getConsumeDelay()

setConsumeDelay

public void setConsumeDelay(long consumeDelay)
Allows a delay to be specified which causes consumers to pause - to simulate slow consumers


getProduceDelay

public long getProduceDelay()

setProduceDelay

public void setProduceDelay(long produceDelay)
Allows a delay to be specified which causes producers to pause - to simulate slow producers


getInitialDelay

public long getInitialDelay()

setInitialDelay

public void setInitialDelay(long initialDelay)

performAssertions

protected void performAssertions(Exchange actual,
                                 Exchange copy)
                          throws Exception
Description copied from class: MockEndpoint
Performs the assertions on the incoming exchange.

Overrides:
performAssertions in class MockEndpoint
Parameters:
actual - the actual exchange
copy - a copy of the exchange (only store this)
Throws:
Exception - can be thrown if something went wrong

assertMessageExpected

protected void assertMessageExpected(long index,
                                     Exchange expected,
                                     Exchange actual)
                              throws Exception
Throws:
Exception

createReporter

protected ThroughputLogger createReporter()

doStart

protected void doStart()
                throws Exception
Description copied from class: ServiceSupport
Implementations override this method to support customized start/stop.

Important: See ServiceSupport.doStop() for more details.

Overrides:
doStart in class DefaultEndpoint
Throws:
Exception
See Also:
ServiceSupport.doStop()


Apache CAMEL