service.setName(serviceName);
ChainedThreadingProfile threadingProfile = (ChainedThreadingProfile) muleContext.getDefaultServiceThreadingProfile();
threadingProfile.setDoThreading(true);
service.setThreadingProfile(threadingProfile);
final SimpleCallableJavaComponent component = new SimpleCallableJavaComponent(new Callable()
{
@Override
public Object onCall(MuleEventContext eventContext) throws Exception
{
System.out.println(Thread.currentThread().getName());
assertTrue(Thread.currentThread().getName().startsWith(serviceName));
latch.countDown();
return null;
}
});
component.setMuleContext(muleContext);
service.setComponent(component);
muleContext.getRegistry().registerService(service);
service.process(MuleTestUtils.getTestEvent("test",
getTestInboundEndpoint(MessageExchangePattern.ONE_WAY), muleContext));