break; case JAXRPC_EJB21 : handler = new InvocationHandlerEJB21(); break; case JAXRPC_MDB21 : handler = new InvocationHandlerMDB21(); break; case JAXWS_JSE : break; case JAXWS_EJB3 : handler = new InvocationHandlerEJB3(); break; case JAXWS_MDB3 : handler = new InvocationHandlerMDB3(); break; default :
public Context getJNDIContext(final Endpoint ep) throws NamingException { final EJBContainer ejb3Container = (EJBContainer)getEjb3Container(); return (Context)ejb3Container.getEnc().lookup(EJB3_JNDI_PREFIX); }
/** * Invokes EJB 3 endpoint. * * @param endpoint EJB 3 endpoint * @param wsInvocation web service invocation * @throws Exception if any error occurs */ public void invoke(final Endpoint endpoint, final Invocation wsInvocation) throws Exception { try { // prepare for invocation final ServiceEndpointContainer ejbContainer = this.getEjb3Container(); final InvocationContextCallback invocationCallback = new EJB3InvocationContextCallback(wsInvocation); final Class<?> implClass = ejbContainer.getServiceImplementationClass(); final Method seiMethod = wsInvocation.getJavaMethod(); final Method implMethod = this.getImplMethod(implClass, seiMethod); final Object[] args = wsInvocation.getArgs(); // invoke method final Object retObj = ejbContainer.invokeEndpoint(implMethod, args, invocationCallback); wsInvocation.setReturnValue(retObj); } catch (Throwable t) { this.log.error("Method invocation failed with exception: " + t.getMessage(), t); this.handleInvocationException(t); } }
/** * Invokes EJB 21 endpoint. * * @param endpoint EJB 21 endpoint * @param wsInvocation web service invocation * @throws Exception if any error occurs */ public void invoke(final Endpoint endpoint, final Invocation wsInvocation) throws Exception { final ObjectName ejb21Name = this.getEjb21ContainerName(endpoint); try { // prepare for invocation final org.jboss.invocation.Invocation jbossInvocation = this.getMBeanInvocation(wsInvocation); final String[] signature = {org.jboss.invocation.Invocation.class.getName()}; final Object[] args = new Object[] {jbossInvocation}; // invoke method final Object retObj = this.server.invoke(ejb21Name, "invoke", args, signature); wsInvocation.setReturnValue(retObj); } catch (Exception e) { this.log.error("Method invocation failed with exception: " + e.getMessage(), e); this.handleInvocationException(e); } }
final ServiceEndpointInterceptorEJB21 sepInterceptor = new ServiceEndpointInterceptorEJB21(); currentInterceptor.setNext(sepInterceptor); sepInterceptor.setNext(nextInterceptor); this.log.debug("Injecting EJB 21 service endpoint interceptor after: " + currentInterceptor.getClass().getName());
/** * Gets EJB 21 container name lazily. * * @param endpoint webservice endpoint * @return EJB21 container name */ private synchronized ObjectName getEjb21ContainerName(final Endpoint endpoint) { final boolean ejb21ContainerNotInitialized = this.ejb21ContainerName == null; if (ejb21ContainerNotInitialized) { this.ejb21ContainerName = ObjectNameFactory.create("jboss.j2ee:jndiName=" + this.jndiName + ",service=EJB"); final boolean ejb21NotRegistered = !this.server.isRegistered(this.ejb21ContainerName); if (ejb21NotRegistered) { throw new IllegalArgumentException("Cannot find service endpoint target: " + this.ejb21ContainerName); } // Inject the Service endpoint interceptor this.insertEJB21ServiceEndpointInterceptor(this.ejb21ContainerName, endpoint.getShortName()); } return this.ejb21ContainerName; }
break; case JAXRPC_EJB21 : handler = new InvocationHandlerEJB21(); break; case JAXRPC_MDB21 : handler = new InvocationHandlerMDB21(); break; case JAXWS_JSE : break; case JAXWS_EJB3 : handler = new InvocationHandlerEJB3(); break; case JAXWS_MDB3 : handler = new InvocationHandlerMDB3(); break; default :
/** * Invokes EJB 3 endpoint. * * @param endpoint EJB 3 endpoint * @param wsInvocation web service invocation * @throws Exception if any error occurs */ public void invoke(final Endpoint endpoint, final Invocation wsInvocation) throws Exception { try { // prepare for invocation final ServiceEndpointContainer ejbContainer = this.getEjb3Container(); final InvocationContextCallback invocationCallback = new EJB3InvocationContextCallback(wsInvocation); final Class<?> implClass = ejbContainer.getServiceImplementationClass(); final Method seiMethod = wsInvocation.getJavaMethod(); final Method implMethod = this.getImplMethod(implClass, seiMethod); final Object[] args = wsInvocation.getArgs(); // invoke method final Object retObj = ejbContainer.invokeEndpoint(implMethod, args, invocationCallback); wsInvocation.setReturnValue(retObj); } catch (Throwable t) { this.log.error("Method invocation failed with exception: " + t.getMessage(), t); this.handleInvocationException(t); } }
/** * Invokes EJB 21 endpoint. * * @param endpoint EJB 21 endpoint * @param wsInvocation web service invocation * @throws Exception if any error occurs */ public void invoke(final Endpoint endpoint, final Invocation wsInvocation) throws Exception { final ObjectName ejb21Name = this.getEjb21ContainerName(endpoint); try { // prepare for invocation final org.jboss.invocation.Invocation jbossInvocation = this.getMBeanInvocation(wsInvocation); final String[] signature = {org.jboss.invocation.Invocation.class.getName()}; final Object[] args = new Object[] {jbossInvocation}; // invoke method final Object retObj = this.server.invoke(ejb21Name, "invoke", args, signature); wsInvocation.setReturnValue(retObj); } catch (Exception e) { this.log.error("Method invocation failed with exception: " + e.getMessage(), e); this.handleInvocationException(e); } }
final ServiceEndpointInterceptorEJB21 sepInterceptor = new ServiceEndpointInterceptorEJB21(); currentInterceptor.setNext(sepInterceptor); sepInterceptor.setNext(nextInterceptor); this.log.debug("Injecting EJB 21 service endpoint interceptor after: " + currentInterceptor.getClass().getName());
public Context getJNDIContext(final Endpoint ep) throws NamingException { final EJBContainer ejb3Container = (EJBContainer)getEjb3Container(); return (Context)ejb3Container.getEnc().lookup(EJB3_JNDI_PREFIX); }
/** * Gets EJB 21 container name lazily. * * @param endpoint webservice endpoint * @return EJB21 container name */ private synchronized ObjectName getEjb21ContainerName(final Endpoint endpoint) { final boolean ejb21ContainerNotInitialized = this.ejb21ContainerName == null; if (ejb21ContainerNotInitialized) { this.ejb21ContainerName = ObjectNameFactory.create("jboss.j2ee:jndiName=" + this.jndiName + ",service=EJB"); final boolean ejb21NotRegistered = !this.server.isRegistered(this.ejb21ContainerName); if (ejb21NotRegistered) { throw new IllegalArgumentException("Cannot find service endpoint target: " + this.ejb21ContainerName); } // Inject the Service endpoint interceptor this.insertEJB21ServiceEndpointInterceptor(this.ejb21ContainerName, endpoint.getShortName()); } return this.ejb21ContainerName; }
break; case JAXRPC_EJB21 : handler = new InvocationHandlerEJB21(); break; case JAXRPC_MDB21 : handler = new InvocationHandlerMDB21(); break; case JAXWS_JSE : break; case JAXWS_EJB3 : handler = new InvocationHandlerEJB3(); break; case JAXWS_MDB3 : handler = new InvocationHandlerMDB3(); break; default :
/** * Invokes EJB 3 endpoint. * * @param endpoint EJB 3 endpoint * @param wsInvocation web service invocation * @throws Exception if any error occurs */ public void invoke(final Endpoint endpoint, final Invocation wsInvocation) throws Exception { try { // prepare for invocation final ServiceEndpointContainer ejbContainer = this.getEjb3Container(); final InvocationContextCallback invocationCallback = new EJB3InvocationContextCallback(wsInvocation); final Class<?> implClass = ejbContainer.getServiceImplementationClass(); final Method seiMethod = wsInvocation.getJavaMethod(); final Method implMethod = this.getImplMethod(implClass, seiMethod); final Object[] args = wsInvocation.getArgs(); // invoke method final Object retObj = ejbContainer.invokeEndpoint(implMethod, args, invocationCallback); wsInvocation.setReturnValue(retObj); } catch (Throwable t) { this.log.error("Method invocation failed with exception: " + t.getMessage(), t); this.handleInvocationException(t); } }
/** * Invokes EJB 21 endpoint. * * @param endpoint EJB 21 endpoint * @param wsInvocation web service invocation * @throws Exception if any error occurs */ public void invoke(final Endpoint endpoint, final Invocation wsInvocation) throws Exception { final ObjectName ejb21Name = this.getEjb21ContainerName(endpoint); try { // prepare for invocation final org.jboss.invocation.Invocation jbossInvocation = this.getMBeanInvocation(wsInvocation); final String[] signature = {org.jboss.invocation.Invocation.class.getName()}; final Object[] args = new Object[] {jbossInvocation}; // invoke method final Object retObj = this.server.invoke(ejb21Name, "invoke", args, signature); wsInvocation.setReturnValue(retObj); } catch (Exception e) { this.log.error("Method invocation failed with exception: " + e.getMessage(), e); this.handleInvocationException(e); } }
final ServiceEndpointInterceptorEJB21 sepInterceptor = new ServiceEndpointInterceptorEJB21(); currentInterceptor.setNext(sepInterceptor); sepInterceptor.setNext(nextInterceptor); this.log.debug("Injecting EJB 21 service endpoint interceptor after: " + currentInterceptor.getClass().getName());
public Context getJNDIContext(final Endpoint ep) throws NamingException { final EJBContainer ejb3Container = (EJBContainer)getEjb3Container(); return (Context)ejb3Container.getEnc().lookup(EJB3_JNDI_PREFIX); }
/** * Gets EJB 21 container name lazily. * * @param endpoint webservice endpoint * @return EJB21 container name */ private synchronized ObjectName getEjb21ContainerName(final Endpoint endpoint) { final boolean ejb21ContainerNotInitialized = this.ejb21ContainerName == null; if (ejb21ContainerNotInitialized) { this.ejb21ContainerName = ObjectNameFactory.create("jboss.j2ee:jndiName=" + this.jndiName + ",service=EJB"); final boolean ejb21NotRegistered = !this.server.isRegistered(this.ejb21ContainerName); if (ejb21NotRegistered) { throw new IllegalArgumentException("Cannot find service endpoint target: " + this.ejb21ContainerName); } // Inject the Service endpoint interceptor this.insertEJB21ServiceEndpointInterceptor(this.ejb21ContainerName, endpoint.getShortName()); } return this.ejb21ContainerName; }