protected Service createJcaService(MessageEndpointFactory endpointFactory,
JcaModel model,
InboundEndpoint endpoint) throws MuleException
{
String name = "JcaService#" + endpointFactory.hashCode();
Service service = new JcaService(muleContext);
service.setName(name);
((CompositeMessageSource) service.getMessageSource()).addSource(endpoint);
// Set endpointFactory rather than endpoint here, so we can obtain a
// new endpoint instance from factory for each incoming message in
// JcaComponet as reccomended by JCA specification
service.setComponent(new JcaComponent(endpointFactory, model.getEntryPointResolverSet(), service,
new DelegateWorkManager(bootstrapContext.getWorkManager())));
service.setModel(model);
muleContext.getRegistry().registerService(service);
return service;
}