/** * 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); } }
/** * 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 :
break; case JAXRPC_EJB21 : handler = new InvocationHandlerEJB21(); break; case JAXRPC_MDB21 :
/** * 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); } }
/** * 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 :
/** * 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); } }
/** * 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; }