@Test public void testProcessAsync() throws Exception { String adapterName = this.getClass().getSimpleName() + "." + getName(); Adapter adapter = createAdapter(adapterName); AdapterManager adapterManager = new AdapterManager(adapter); Channel channel = createChannel("c1"); ChannelManager channelManager = new ChannelManager(channel, adapterManager); StandardWorkflow workflow = createWorkflow("w1"); MockMessageProducer mockProducer = new MockMessageProducer(); workflow.setProducer(mockProducer); WorkflowManager realWorkflowManager = new WorkflowManager(workflow, channelManager); adapterManager.createObjectName(); ObjectName workflowObj = realWorkflowManager.createObjectName(); channelManager.createObjectName(); List<BaseComponentMBean> mBeans = new ArrayList<BaseComponentMBean>(); mBeans.add(adapterManager); mBeans.addAll(adapterManager.getAllDescendants()); String msgUniqueId = new GuidGenerator().getUUID(); SerializableMessage msg = createSM(msgUniqueId); try { register(mBeans); MessageProcessor workflowManagerProxy = JMX.newMBeanProxy(mBeanServer, workflowObj, MessageProcessor.class); adapterManager.requestStart(); workflowManagerProxy.processAsync(msg); assertEquals(1, mockProducer.getMessages().size()); AdaptrisMessage procMsg = mockProducer.getMessages().get(0); assertEquals(msgUniqueId, procMsg.getUniqueId()); assertEquals(PAYLOAD, procMsg.getContent()); assertEquals(PAYLOAD_ENCODING, procMsg.getContentEncoding()); assertTrue(procMsg.headersContainsKey(METADATA_KEY)); assertEquals(METADATA_VALUE, procMsg.getMetadataValue(METADATA_KEY)); } finally { adapter.requestClose(); } }
@Override public void processAsync(SerializableMessage msgToProcess) throws InterlokException { DefaultSerializableMessageTranslator translator = new DefaultSerializableMessageTranslator(); managedWorkflow.onAdaptrisMessage(toAdaptrisMessage(msgToProcess, translator)); }
WorkflowManager extends ComponentManagerImpl<Workflow> implements WorkflowManagerMBean, WorkflowRuntimeManager { @Override public void processAsync(SerializableMessage msgToProcess) throws InterlokException { DefaultSerializableMessageTranslator translator = new DefaultSerializableMessageTranslator(); managedWorkflow.onAdaptrisMessage(toAdaptrisMessage(msgToProcess, translator)); } }
WorkflowManager extends ComponentManagerImpl<Workflow> implements WorkflowManagerMBean, WorkflowRuntimeManager { @Override public void processAsync(SerializableMessage msgToProcess) throws InterlokException { DefaultSerializableMessageTranslator translator = new DefaultSerializableMessageTranslator(); managedWorkflow.onAdaptrisMessage(toAdaptrisMessage(msgToProcess, translator)); } private  WorkflowManager();  WorkflowManager(Workflow w, ChannelManager owner);   WorkflowManager(Workflow w, ChannelManager owner, boolean skipBackRefs); }
WorkflowManager extends ComponentManagerImpl<Workflow> implements WorkflowManagerMBean, WorkflowRuntimeManager { @Override public void processAsync(SerializableMessage msgToProcess) throws InterlokException { DefaultSerializableMessageTranslator translator = new DefaultSerializableMessageTranslator(); managedWorkflow.onAdaptrisMessage(toAdaptrisMessage(msgToProcess, translator)); } private  WorkflowManager();  WorkflowManager(Workflow w, ChannelManager owner);   WorkflowManager(Workflow w, ChannelManager owner, boolean skipBackRefs); @Override ObjectName createObjectName(); @Override Workflow getWrappedComponent(); @Override long requestStartTime(); @Override long requestStopTime(); @Override @Deprecated SerializableAdaptrisMessage injectMessageWithReply(SerializableAdaptrisMessage msgToProcess); @Override @Deprecated boolean injectMessage(SerializableAdaptrisMessage msgToProcess); @Override void processAsync(SerializableMessage msgToProcess); @Override SerializableMessage process(SerializableMessage msgToProcess); @Override boolean equals(Object o); @Override String toString(); @Override int hashCode(); @Override ChannelManager getParent(); @Override String getParentId(); @Override ObjectName getParentObjectName(); @Override Collection<ObjectName> getChildRuntimeInfoComponents(); @Override boolean addChildJmxComponent(ChildRuntimeInfoComponent comp); @Override boolean removeChildJmxComponent(ChildRuntimeInfoComponent comp); @Override String createObjectHierarchyString(); @Override Collection<BaseComponentMBean> getAllDescendants(); @Override void registerMBean(); @Override void unregisterMBean(); @Override MBeanNotificationInfo[] getNotificationInfo(); }
WorkflowManager extends ComponentManagerImpl<Workflow> implements WorkflowManagerMBean, WorkflowRuntimeManager { @Override public void processAsync(SerializableMessage msgToProcess) throws InterlokException { DefaultSerializableMessageTranslator translator = new DefaultSerializableMessageTranslator(); managedWorkflow.onAdaptrisMessage(toAdaptrisMessage(msgToProcess, translator)); } private  WorkflowManager();  WorkflowManager(Workflow w, ChannelManager owner);   WorkflowManager(Workflow w, ChannelManager owner, boolean skipBackRefs); @Override ObjectName createObjectName(); @Override Workflow getWrappedComponent(); @Override long requestStartTime(); @Override long requestStopTime(); @Override @Deprecated SerializableAdaptrisMessage injectMessageWithReply(SerializableAdaptrisMessage msgToProcess); @Override @Deprecated boolean injectMessage(SerializableAdaptrisMessage msgToProcess); @Override void processAsync(SerializableMessage msgToProcess); @Override SerializableMessage process(SerializableMessage msgToProcess); @Override boolean equals(Object o); @Override String toString(); @Override int hashCode(); @Override ChannelManager getParent(); @Override String getParentId(); @Override ObjectName getParentObjectName(); @Override Collection<ObjectName> getChildRuntimeInfoComponents(); @Override boolean addChildJmxComponent(ChildRuntimeInfoComponent comp); @Override boolean removeChildJmxComponent(ChildRuntimeInfoComponent comp); @Override String createObjectHierarchyString(); @Override Collection<BaseComponentMBean> getAllDescendants(); @Override void registerMBean(); @Override void unregisterMBean(); @Override MBeanNotificationInfo[] getNotificationInfo();  }