use of com.adaptris.core.Workflow in project interlok by adaptris.
the class JettyNoBacklogInterceptor method init.
@Override
public void init() throws CoreException {
Workflow w = parentWorkflow();
if (PoolingWorkflow.class.isAssignableFrom(w.getClass())) {
maxWorkers = ((PoolingWorkflow) w).poolSize();
}
log.trace("503 Server Error will be sent when there are {} messages in flight", maxWorkers);
}
use of com.adaptris.core.Workflow in project interlok by adaptris.
the class JmsConnectionErrorHandlerTest method createChannel.
private MockChannel createChannel(EmbeddedActiveMq mq, SharedConnection con, String destinationName) throws Exception {
MockChannel result = new MockChannel();
result.setUniqueId(mq.getName() + "_channel" + "_" + destinationName);
result.setConsumeConnection(con);
Workflow workflow = createWorkflow(mq, destinationName);
result.getWorkflowList().add(workflow);
return result;
}
use of com.adaptris.core.Workflow in project interlok by adaptris.
the class MockChannel method prepare.
@Override
public void prepare() throws CoreException {
if (eh == null) {
eh = new DefaultEventHandler();
}
eh.requestStart();
registerEventHandler(eh);
super.prepare();
registerActiveMsgErrorHandler(getMessageErrorHandler());
for (Workflow workflow : getWorkflowList()) {
if (workflow.getMessageErrorHandler() != null) {
workflow.registerActiveMsgErrorHandler(workflow.getMessageErrorHandler());
} else {
workflow.registerActiveMsgErrorHandler(getMessageErrorHandler());
}
}
}
use of com.adaptris.core.Workflow in project interlok by adaptris.
the class MessageNotificationCase method createChannel.
protected Channel createChannel(String uid, Workflow... workflows) {
Channel c = new Channel();
c.setUniqueId(uid);
for (Workflow w : workflows) {
c.getWorkflowList().add(w);
}
return c;
}
use of com.adaptris.core.Workflow in project interlok by adaptris.
the class AdapterManagerTest method testRegisterMBean.
@Test
public void testRegisterMBean() throws Exception {
String adapterName = this.getClass().getSimpleName() + "." + getName();
Adapter adapter = createAdapter(adapterName);
Channel channel = createChannel("c1");
Workflow workflow = createWorkflow("w1");
workflow.getInterceptors().add(new MessageMetricsInterceptor());
channel.getWorkflowList().add(workflow);
adapter.getChannelList().add(channel);
AdapterManager adapterManager = new AdapterManager(adapter);
List<BaseComponentMBean> mBeans = new ArrayList<BaseComponentMBean>();
mBeans.add(adapterManager);
mBeans.addAll(adapterManager.getAllDescendants());
try {
adapterManager.registerMBean();
assertTrue(JmxHelper.findMBeanServer().isRegistered(adapterManager.createObjectName()));
for (BaseComponentMBean baseMBean : adapterManager.getAllDescendants()) {
assertTrue(JmxHelper.findMBeanServer().isRegistered(baseMBean.createObjectName()));
}
adapterManager.unregisterMBean();
assertFalse(JmxHelper.findMBeanServer().isRegistered(adapterManager.createObjectName()));
for (BaseComponentMBean baseMBean : adapterManager.getAllDescendants()) {
assertFalse(JmxHelper.findMBeanServer().isRegistered(baseMBean.createObjectName()));
}
register(mBeans);
assertTrue(JmxHelper.findMBeanServer().isRegistered(adapterManager.createObjectName()));
for (BaseComponentMBean baseMBean : adapterManager.getAllDescendants()) {
assertTrue(JmxHelper.findMBeanServer().isRegistered(baseMBean.createObjectName()));
}
} finally {
}
}
Aggregations