Search in sources :

Example 1 with ChannelList

use of com.adaptris.core.ChannelList in project interlok by adaptris.

the class BasicActiveMqConsumerTest method createDurableSubsAdapter.

private Adapter createDurableSubsAdapter(String adapterName, EmbeddedActiveMq activeMqBroker) throws Exception {
    Adapter adapter = new Adapter();
    adapter.setUniqueId(adapterName);
    Channel c = new Channel();
    JmsConnection conn = activeMqBroker.getJmsConnection(createVendorImpl());
    conn.setClientId(MY_CLIENT_ID);
    c.setConsumeConnection(conn);
    StandardWorkflow swf = new StandardWorkflow();
    PasConsumer pasConsumer = new PasConsumer().withTopic(new GuidGenerator().safeUUID());
    pasConsumer.setSubscriptionId(MY_SUBSCRIPTION_ID);
    swf.setConsumer(pasConsumer);
    c.getWorkflowList().add(swf);
    ChannelList cl = new ChannelList();
    cl.addChannel(c);
    adapter.setChannelList(cl);
    return adapter;
}
Also used : StandardWorkflow(com.adaptris.core.StandardWorkflow) PasConsumer(com.adaptris.core.jms.PasConsumer) MockChannel(com.adaptris.core.stubs.MockChannel) Channel(com.adaptris.core.Channel) Adapter(com.adaptris.core.Adapter) JmsConnection(com.adaptris.core.jms.JmsConnection) GuidGenerator(com.adaptris.util.GuidGenerator) ChannelList(com.adaptris.core.ChannelList)

Example 2 with ChannelList

use of com.adaptris.core.ChannelList in project interlok by adaptris.

the class ExampleChannelCase method createExampleXml.

@Override
protected String createExampleXml(Object object) throws Exception {
    String result = getExampleCommentHeader(object);
    ChannelList w = (ChannelList) object;
    result = result + configMarshaller.marshal(w);
    return result;
}
Also used : ChannelList(com.adaptris.core.ChannelList)

Example 3 with ChannelList

use of com.adaptris.core.ChannelList in project interlok by adaptris.

the class LifecycleHelperTest method testLifecycle.

@Test
public void testLifecycle() throws Exception {
    StateManagedComponent stateManaged = new NullService();
    ComponentLifecycle noState = new ChannelList();
    try {
        initAndStart(stateManaged);
        initAndStart(noState);
        initAndStart(null);
        stopAndClose(null);
    } finally {
        stopAndClose(stateManaged);
        stopAndClose(noState);
    }
}
Also used : NullService(com.adaptris.core.NullService) ComponentLifecycle(com.adaptris.core.ComponentLifecycle) StateManagedComponent(com.adaptris.core.StateManagedComponent) ChannelList(com.adaptris.core.ChannelList) Test(org.junit.Test)

Example 4 with ChannelList

use of com.adaptris.core.ChannelList in project interlok by adaptris.

the class ExampleErrorHandlerCase method retrieveObjectForSampleConfig.

@Override
protected Object retrieveObjectForSampleConfig() {
    Adapter result = new Adapter();
    result.setUniqueId("dummy-adapter");
    ProcessingExceptionHandler meh = createForExamples();
    result.setMessageErrorHandler(meh);
    result.setEventHandler(new StubEventHandler());
    result.setChannelList(new ChannelList());
    return result;
}
Also used : ProcessingExceptionHandler(com.adaptris.core.ProcessingExceptionHandler) StubEventHandler(com.adaptris.core.stubs.StubEventHandler) Adapter(com.adaptris.core.Adapter) ChannelList(com.adaptris.core.ChannelList)

Example 5 with ChannelList

use of com.adaptris.core.ChannelList in project interlok by adaptris.

the class RetryFromJettyTest method retrieveObjectForSampleConfig.

@Override
protected Object retrieveObjectForSampleConfig() {
    Adapter result = null;
    try {
        RetryFromJetty fmr = new RetryFromJetty();
        fmr.setConnection(new EmbeddedConnection());
        fmr.setRetryStore(new InMemoryRetryStore());
        result = new Adapter();
        result.setFailedMessageRetrier(fmr);
        result.setChannelList(new ChannelList());
        result.setEventHandler(new StubEventHandler());
        result.setUniqueId(UUID.randomUUID().toString());
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
    return result;
}
Also used : StubEventHandler(com.adaptris.core.stubs.StubEventHandler) EmbeddedConnection(com.adaptris.core.http.jetty.EmbeddedConnection) Adapter(com.adaptris.core.Adapter) ChannelList(com.adaptris.core.ChannelList) InterlokException(com.adaptris.interlok.InterlokException) ConfiguredException(com.adaptris.core.services.exception.ConfiguredException)

Aggregations

ChannelList (com.adaptris.core.ChannelList)5 Adapter (com.adaptris.core.Adapter)3 StubEventHandler (com.adaptris.core.stubs.StubEventHandler)2 Channel (com.adaptris.core.Channel)1 ComponentLifecycle (com.adaptris.core.ComponentLifecycle)1 NullService (com.adaptris.core.NullService)1 ProcessingExceptionHandler (com.adaptris.core.ProcessingExceptionHandler)1 StandardWorkflow (com.adaptris.core.StandardWorkflow)1 StateManagedComponent (com.adaptris.core.StateManagedComponent)1 EmbeddedConnection (com.adaptris.core.http.jetty.EmbeddedConnection)1 JmsConnection (com.adaptris.core.jms.JmsConnection)1 PasConsumer (com.adaptris.core.jms.PasConsumer)1 ConfiguredException (com.adaptris.core.services.exception.ConfiguredException)1 MockChannel (com.adaptris.core.stubs.MockChannel)1 InterlokException (com.adaptris.interlok.InterlokException)1 GuidGenerator (com.adaptris.util.GuidGenerator)1 Test (org.junit.Test)1