org.apache.camel.component.dataset
Class DataSetEndpoint

java.lang.Object
  extended by org.apache.camel.impl.DefaultEndpoint<Exchange>
      extended by org.apache.camel.component.mock.MockEndpoint
          extended by org.apache.camel.component.dataset.DataSetEndpoint
All Implemented Interfaces:
CamelContextAware, Endpoint<Exchange>, Service, BrowsableEndpoint<Exchange>

public class DataSetEndpoint
extends MockEndpoint
implements Service

Endpoint for DataSet.

Version:
$Revision: 42383 $

Constructor Summary
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<Exchange> 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
 PollingConsumer<Exchange> createPollingConsumer()
          Creates a new Polling Consumer so that the caller can poll message exchanges from the consumer using PollingConsumer.receive(), PollingConsumer.receiveNoWait() or PollingConsumer.receive(long) whenever it is ready to do so rather than using the Event Based Consumer returned by Endpoint.createConsumer(Processor)
 long getConsumeDelay()
           
 DataSet getDataSet()
           
 long getPreloadSize()
           
 long getProduceDelay()
           
 int getReceivedCounter()
           
protected  void performAssertions(Exchange actual)
           
protected  void reportProgress(Exchange actual, int receivedCount)
           
 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 setPreloadSize(long preloadSize)
          Sets how many messages should be preloaded (sent) before the route completes its initialisation
 void setProduceDelay(long produceDelay)
          Allows a delay to be specified which causes producers to pause - to simpulate slow producers
 void start()
          Starts the service
 void stop()
          Stops the service
protected  void waitForCompleteLatch()
           
 
Methods inherited from class org.apache.camel.component.mock.MockEndpoint
addPropertyChangeListener, allMessages, assertEquals, assertExchangeReceived, assertIsNotSatisfied, assertIsSatisfied, assertIsSatisfied, assertIsSatisfied, assertIsSatisfied, assertIsSatisfied, assertMessagesAscending, assertMessagesDescending, assertMessagesSorted, assertNoDuplicates, assertTrue, assertWait, await, await, createProducer, expectedBodiesReceived, expectedBodiesReceived, expectedBodiesReceivedInAnyOrder, expectedBodiesReceivedInAnyOrder, expectedHeaderReceived, expectedMessageCount, expectedMinimumMessageCount, expects, expectsAscending, expectsDescending, expectsMessageCount, expectsNoDuplicates, fail, getExchanges, getExpectedCount, getExpectedMinimumCount, getFailures, getReceivedExchanges, getReporter, getResultWaitTime, getSleepForEmptyTest, isSingleton, message, onExchange, removePropertyChangeListener, resolve, setExpectedMessageCount, setMinimumExpectedMessageCount, setReporter, setResultWaitTime, setSleepForEmptyTest, whenAnyExchangeReceived, whenExchangeReceived
 
Methods inherited from class org.apache.camel.impl.DefaultEndpoint
configureProperties, convertTo, createEndpointUri, createExchange, createExchange, createExchange, createExecutorService, equals, getCamelContext, getComponent, getContext, getEndpointUri, getExchangePattern, getExchangeType, getExecutorService, hashCode, isLenientProperties, setCamelContext, setContext, setEndpointUri, 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, getCamelContext, getContext, getEndpointUri, isLenientProperties, setCamelContext, setContext
 

Constructor Detail

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)

createPollingConsumer

public PollingConsumer<Exchange> createPollingConsumer()
                                                throws Exception
Description copied from interface: Endpoint
Creates a new Polling Consumer so that the caller can poll message exchanges from the consumer using PollingConsumer.receive(), PollingConsumer.receiveNoWait() or PollingConsumer.receive(long) whenever it is ready to do so rather than using the Event Based Consumer returned by Endpoint.createConsumer(Processor)

Specified by:
createPollingConsumer in interface Endpoint<Exchange>
Overrides:
createPollingConsumer in class DefaultEndpoint<Exchange>
Returns:
a newly created pull consumer
Throws:
Exception - if the pull consumer could not be created

createConsumer

public Consumer<Exchange> 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<Exchange>
Overrides:
createConsumer in class MockEndpoint
Returns:
a newly created consumer
Throws:
Exception

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

waitForCompleteLatch

protected void waitForCompleteLatch()
                             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 initialisation


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 simpulate slow producers


performAssertions

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

reportProgress

protected void reportProgress(Exchange actual,
                              int receivedCount)

assertMessageExpected

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

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


Copyright © 2008 IONA Open Source Community. All Rights Reserved.