final DescriptorBasedEJBClientContextService service = new DescriptorBasedEJBClientContextService(ejbClientConfiguration, module.getClassLoader()); final String connectionRef = remotingReceiverConfiguration.getOutboundConnectionRef(); final ServiceName connectionDependencyService = AbstractOutboundConnectionService.OUTBOUND_CONNECTION_BASE_SERVICE_NAME.append(connectionRef); service.addRemotingConnectionDependency(serviceBuilder, connectionDependencyService); service.setChannelCreationOptions(connectionRef, channelCreationOpts); service.setConnectionCreationTimeout(connectionRef, remotingReceiverConfiguration.getConnectionTimeout()); if (passByValue != null) { final ServiceName localEjbReceiverServiceName = passByValue == true ? LocalEjbReceiver.BY_VALUE_SERVICE_NAME : LocalEjbReceiver.BY_REFERENCE_SERVICE_NAME; serviceBuilder.addDependency(localEjbReceiverServiceName, LocalEjbReceiver.class, service.getLocalEjbReceiverInjector()); } else { serviceBuilder.addDependency(LocalEjbReceiver.DEFAULT_LOCAL_EJB_RECEIVER_SERVICE_NAME, LocalEjbReceiver.class, service.getLocalEjbReceiverInjector());
@Override public synchronized void start(StartContext startContext) throws StartException { // setup the context with the receivers final EJBClientContext context; if (this.clientContextClassloader != null) { context = EJBClientContext.create(this.ejbClientConfiguration, this.clientContextClassloader); } else { context = EJBClientContext.create(this.ejbClientConfiguration); } // add the (optional) local EJB receiver final LocalEjbReceiver localEjbReceiver = this.localEjbReceiverInjectedValue.getOptionalValue(); if (localEjbReceiver != null) { context.registerEJBReceiver(localEjbReceiver); logger.debug("Added a local EJB receiver to descriptor based EJB client context named " + startContext.getController().getName()); } // now process the remoting receivers this.registerRemotingEJBReceivers(startContext, context); // we now have a fully configured EJB client context for use this.ejbClientContext = context; }