org.apache.camel.component.dataset
Class DataSetEndpoint

java.lang.Object
  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, BrowsableEndpoint

public class DataSetEndpoint
extends MockEndpoint
implements Service

Endpoint for DataSet.

Version:
$Revision: 802532 $

Constructor Summary
DataSetEndpoint()
           
DataSetEndpoint(String endpointUri, Component component, DataSet dataSet)
           
DataSetEndpoint(String endpointUri, 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()
           
 long getConsumeDelay()
           
 DataSet getDataSet()
           
 int getMinRate()
           
 long getPreloadSize()
           
 long getProduceDelay()
           
 int getReceivedCounter()
           
protected  void performAssertions(Exchange actual)
           
 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 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
 void setReporter(Processor reporter)
          Sets a custom progress reporter
 void start()
          Starts the service
 void stop()
          Stops the service
protected  void waitForCompleteLatch(long timeout)
           
 
Methods inherited from class org.apache.camel.component.mock.MockEndpoint
allMessages, assertEquals, assertExchangeReceived, assertIsNotSatisfied, assertIsNotSatisfied, assertIsSatisfied, assertIsSatisfied, assertIsSatisfied, assertIsSatisfied, assertIsSatisfied, assertMessagesAscending, assertMessagesDescending, assertMessagesSorted, assertNoDuplicates, assertTrue, assertWait, await, await, createProducer, expectedBodiesReceived, expectedBodiesReceived, expectedBodiesReceivedInAnyOrder, expectedBodiesReceivedInAnyOrder, expectedBodyReceived, expectedFileExists, expectedFileExists, expectedHeaderReceived, expectedMessageCount, expectedMinimumMessageCount, expectedPropertyReceived, expects, expectsAscending, expectsAscending, expectsDescending, expectsDescending, expectsMessageCount, expectsNoDuplicates, expectsNoDuplicates, fail, getExchanges, getExpectedCount, getExpectedMinimumCount, getFailures, getReceivedExchanges, getReporter, getResultWaitTime, getSleepForEmptyTest, isSingleton, message, onExchange, resolve, setExpectedMessageCount, setMinimumExpectedMessageCount, setMinimumResultWaitTime, setResultWaitTime, setSleepForEmptyTest, waitForCompleteLatch, whenAnyExchangeReceived, whenExchangeReceived
 
Methods inherited from class org.apache.camel.impl.DefaultEndpoint
configureProperties, createEndpointUri, createExchange, createExchange, createExchange, createPollingConsumer, createScheduledExecutorService, equals, getCamelContext, getComponent, getEndpointKey, getEndpointUri, getExchangePattern, getExchangeType, getExecutorService, getScheduledExecutorService, hashCode, isLenientProperties, setCamelContext, setEndpointUri, setEndpointUriIfNotSpecified, setExchangePattern, setExecutorService, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.camel.Endpoint
configureProperties, createExchange, createExchange, createExchange, createPollingConsumer, getCamelContext, getEndpointKey, getEndpointUri, isLenientProperties, setCamelContext
 

Constructor Detail

DataSetEndpoint

public DataSetEndpoint()

DataSetEndpoint

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

DataSetEndpoint

public DataSetEndpoint(String endpointUri,
                       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


setReporter

public void setReporter(Processor reporter)
Sets a custom progress reporter

Overrides:
setReporter in class MockEndpoint

performAssertions

protected void performAssertions(Exchange actual)
                          throws Exception
Overrides:
performAssertions in class MockEndpoint
Throws:
Exception

assertMessageExpected

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

createReporter

protected ThroughputLogger createReporter()

start

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

Specified by:
start in interface Service
Throws:
Exception

stop

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

Specified by:
stop in interface Service
Throws:
Exception


Apache CAMEL