public void start() { Dispatcher.singleton.registerTarget(oid, target); }
public void stop() { Dispatcher.singleton.unregisterTarget(oid); } }
public void init(Endpoint ep) { String ejbName = ep.getShortName(); ArchiveDeployment dep = (ArchiveDeployment)ep.getService().getDeployment(); String nameStr = "jboss.j2ee:name=" + ejbName + ",service=EJB3,jar=" + dep.getSimpleName(); if (dep.getParent() != null) { nameStr += ",ear=" + dep.getParent().getSimpleName(); } objectName = ObjectNameFactory.create(nameStr.toString()); Dispatcher dispatcher = Dispatcher.singleton; if (dispatcher.getRegistered(objectName.getCanonicalName()) == null) throw new WebServiceException("Cannot find service endpoint target: " + objectName); }
public static void unregisterClusteredObject(Object object) { try { ClassProxy proxy = (ClassProxy) object; InstanceAdvisor advisor = proxy._getInstanceAdvisor(); String oid = (String) advisor.getMetaData().getMetaData(Dispatcher.DISPATCHER, Dispatcher.OID); InstanceAdvised registeredObject = (InstanceAdvised) Dispatcher.singleton.getRegistered(oid); if (registeredObject == null) throw new NotRegisteredException(oid.toString() + " is not registered"); Dispatcher.singleton.unregisterTarget(oid); advisor = registeredObject._getInstanceAdvisor(); Map families = (Map) advisor.getMetaData().getMetaData(CLUSTERED_REMOTING, CLUSTER_FAMILIES); Iterator it = families.values().iterator(); while (it.hasNext()) { HATarget target = (HATarget) it.next(); target.destroy(); } } catch (Exception ignored) { log.trace("Ignored exception unregistering a clustered object", ignored); } } }
public Object invoke(Invocation invocation) throws Throwable { if (isLocal()) { Object oid = invocation.getMetaData(Dispatcher.DISPATCHER, Dispatcher.OID); if (Dispatcher.singleton.isRegistered(oid)) { InvocationResponse response = Dispatcher.singleton.invoke(invocation); invocation.setResponseContextInfo(response.getContextInfo()); return response.getResponse(); } } return invocation.invokeNext(); }
public void init(Endpoint ep) { String ejbName = ep.getShortName(); ArchiveDeployment dep = (ArchiveDeployment)ep.getService().getDeployment(); String nameStr = "jboss.j2ee:name=" + ejbName + ",service=EJB3,jar=" + dep.getSimpleName(); if (dep.getParent() != null) { nameStr += ",ear=" + dep.getParent().getSimpleName(); } objectName = ObjectNameFactory.create(nameStr.toString()); Dispatcher dispatcher = Dispatcher.singleton; if (dispatcher.getRegistered(objectName.getCanonicalName()) == null) throw new WebServiceException("Cannot find service endpoint target: " + objectName); }
public void init(Endpoint ep) { String ejbName = ep.getShortName(); ArchiveDeployment dep = (ArchiveDeployment)ep.getService().getDeployment(); String nameStr = "jboss.j2ee:name=" + ejbName + ",service=EJB3,jar=" + dep.getSimpleName(); if (dep.getParent() != null) { nameStr += ",ear=" + dep.getParent().getSimpleName(); } objectName = ObjectNameFactory.create(nameStr.toString()); Dispatcher dispatcher = Dispatcher.singleton; if (dispatcher.getRegistered(objectName.getCanonicalName()) == null) throw new WebServiceException("Cannot find service endpoint target: " + objectName); }
/** * Registers this Container with Remoting / AOP Dispatcher */ protected void registerWithAopDispatcher() { String registrationName = this.getObjectName().getCanonicalName(); ClassProxy classProxy = new InvokableContextClassProxyHack(this); // So that Remoting layer can reference this container easily. Dispatcher.singleton.registerTarget(registrationName, classProxy); // Log log.debug("Registered " + this + " with " + Dispatcher.class.getName() + " via " + InvokableContextClassProxyHack.class.getSimpleName() + " at key " + registrationName); }
public void stop() throws Exception { super.stop(); Util.unbind(ctx, jndiName + PROXY_FACTORY_NAME); Dispatcher.singleton.unregisterTarget(jndiName + PROXY_FACTORY_NAME); } }
public void init(Endpoint ep) { String ejbName = ep.getShortName(); ArchiveDeployment dep = (ArchiveDeployment)ep.getService().getDeployment(); String nameStr = "jboss.j2ee:name=" + ejbName + ",service=EJB3,jar=" + dep.getSimpleName(); if (dep.getParent() != null) { nameStr += ",ear=" + dep.getParent().getSimpleName(); } objectName = ObjectNameFactory.create(nameStr.toString()); Dispatcher dispatcher = Dispatcher.singleton; if (dispatcher.getRegistered(objectName.getCanonicalName()) == null) throw new WebServiceException("Cannot find service endpoint target: " + objectName); }
/** * Create a remoting DelegatingComponentDispatcher proxy. * * @return the proxy * @throws Exception */ protected DelegatingComponentDispatcher createDispatcherProxy() throws Exception { // The interceptors ArrayList<Interceptor> interceptors = new ArrayList<Interceptor>(); interceptors.add(SecurityClientInterceptor.singleton); interceptors.add(MergeMetaDataInterceptor.singleton); interceptors.add(InvokeRemoteInterceptor.singleton); Class<?>[] ifaces = {DelegatingComponentDispatcher.class}; DelegatingComponentDispatcher delegate = new DelegatingComponentDispatcherImpl(this, this.dispatcher); String dispatchName = "ProfileService-" + this.dispatchName; Dispatcher.singleton.registerTarget(dispatchName, delegate); return (DelegatingComponentDispatcher) Remoting.createRemoteProxy(dispatchName, getClass().getClassLoader(), ifaces, locator, interceptors, "ProfileService"); }
public void stop() throws Exception { Dispatcher.singleton.unregisterTarget(dispatchName); String mvDispatchName = dispatchName+".ManagementView"; Dispatcher.singleton.unregisterTarget(mvDispatchName); InitialContext ctx = new InitialContext(); Util.unbind(ctx, jndiName); log.debug("Unbound ProfileService proxy"); if(mgtViewJndiName != null && mgtViewJndiName.length() > 0) { Util.unbind(ctx, mgtViewJndiName); log.debug("Unbound ManagementView proxy"); } if(deployMgrJndiName != null && deployMgrJndiName.length() > 0) { Util.unbind(ctx, deployMgrJndiName); log.debug("Unbound DeploymentManager proxy"); } // if(createEjb3Links) { Util.unbind(ctx, "SecureProfileService/remote"); Util.unbind(ctx, "SecureManagementView/remote"); Util.unbind(ctx, "SecureDeploymentManager/remote"); log.debug("Unbound links back to secure ejb names"); } } }
public void invoke(Endpoint ep, Invocation epInv) throws Exception { try { Dispatcher dispatcher = Dispatcher.singleton; StatelessContainer container = (StatelessContainer)dispatcher.getRegistered(objectName.getCanonicalName()); Class beanClass = container.getBeanClass(); Method method = getImplMethod(beanClass, epInv.getJavaMethod()); Object[] args = epInv.getArgs(); MethodInfo info = container.getMethodInfo(method); EJBContainerInvocation<StatelessContainer, StatelessBeanContext> ejb3Inv = new EJBContainerInvocation<StatelessContainer, StatelessBeanContext>(info); ejb3Inv.setAdvisor(container); ejb3Inv.setArguments(args); ejb3Inv.setContextCallback(new CallbackImpl(epInv)); Object retObj = ejb3Inv.invokeNext(); epInv.setReturnValue(retObj); } catch (Throwable th) { handleInvocationException(th); } }
Dispatcher.singleton.registerTarget(dispatchName, psProxySecure); Dispatcher.singleton.registerTarget(mvDispatchName, mgtViewSecure); mgtViewProxy = Remoting.createRemoteProxy(mvDispatchName, loader, mvIfaces, locator, proxyInterceptors, "ProfileService"); log.debug("Created ManagementView proxy"); Dispatcher.singleton.registerTarget(dmDispatchName, deployMgrSecure); deployMgrProxy = Remoting.createRemoteProxy(dmDispatchName, loader, dmIfaces, locator, proxyInterceptors, "DeploymentManager"); log.debug("Created DeploymentManager proxy");
protected void lockedStop() throws Exception { try { Dispatcher.singleton.unregisterTarget(getObjectName().getCanonicalName()); } catch (Exception ignore) { log.debug("Dispatcher unregister target failed", ignore); } // Deregister with Remoting Dispatcher.singleton.unregisterTarget(this.getName()); // Unbind applicable JNDI Entries JndiSessionRegistrarBase jndiRegistrar = this.getJndiRegistrar(); if (jndiRegistrar != null) { jndiRegistrar.unbindEjb(this.getInitialContext(), this.getMetaData()); } super.lockedStop(); }
public void invoke(Endpoint ep, Invocation wsInv) throws Exception { try { Dispatcher dispatcher = Dispatcher.singleton; StatelessContainer container = (StatelessContainer)dispatcher.getRegistered(objectName.getCanonicalName()); Class beanClass = container.getBeanClass(); Method method = getImplMethod(beanClass, wsInv.getJavaMethod()); Object[] args = wsInv.getArgs(); MethodInfo info = container.getMethodInfo(method); EJBContainerInvocation<StatelessContainer, StatelessBeanContext> jbInv = new EJBContainerInvocation<StatelessContainer, StatelessBeanContext>(info); jbInv.setAdvisor(container); jbInv.setArguments(args); jbInv.setContextCallback(new CallbackImpl(wsInv)); Object retObj = jbInv.invokeNext(); wsInv.setReturnValue(retObj); } catch (Throwable th) { handleInvocationException(th); } }
public void start() throws Exception { Dispatcher.singleton.registerTarget(jndiName + PROXY_FACTORY_NAME, this); Class[] interfaces = {ProxyFactory.class}; Object factoryProxy = Remoting.createPojiProxy(jndiName + PROXY_FACTORY_NAME, interfaces, ProxyRemotingUtils.getDefaultClientBinding()); try { Util.rebind(ctx, jndiName + PROXY_FACTORY_NAME, factoryProxy); } catch (NamingException e) { NamingException namingException = new NamingException("Could not bind remote producer factory into JNDI under jndiName: " + ctx.getNameInNamespace() + "/" + jndiName + PROXY_FACTORY_NAME); namingException.setRootCause(e); throw namingException; } super.start(); }
public void invoke(Endpoint ep, Invocation epInv) throws Exception { try { Dispatcher dispatcher = Dispatcher.singleton; StatelessContainer container = (StatelessContainer)dispatcher.getRegistered(objectName.getCanonicalName()); Class beanClass = container.getBeanClass(); Method method = getImplMethod(beanClass, epInv.getJavaMethod()); Object[] args = epInv.getArgs(); MethodInfo info = container.getMethodInfo(method); EJBContainerInvocation<StatelessContainer, StatelessBeanContext> ejb3Inv = new EJBContainerInvocation<StatelessContainer, StatelessBeanContext>(info); ejb3Inv.setAdvisor(container); ejb3Inv.setArguments(args); ejb3Inv.setContextCallback(new CallbackImpl(epInv)); Object retObj = ejb3Inv.invokeNext(); epInv.setReturnValue(retObj); } catch (Throwable th) { handleInvocationException(th); } }
Dispatcher.singleton.registerTarget(objectId, obj); advisor = proxy._getInstanceAdvisor(); advisor.insertInterceptor(new ForwardingInterceptor(obj)); Dispatcher.singleton.registerTarget(objectId, proxy);
public void invoke(Endpoint ep, Invocation epInv) throws Exception { try { Dispatcher dispatcher = Dispatcher.singleton; StatelessContainer container = (StatelessContainer)dispatcher.getRegistered(objectName.getCanonicalName()); Class beanClass = container.getBeanClass(); Method method = getImplMethod(beanClass, epInv.getJavaMethod()); Object[] args = epInv.getArgs(); MethodInfo info = container.getMethodInfo(method); EJBContainerInvocation<StatelessContainer, StatelessBeanContext> ejb3Inv = new EJBContainerInvocation<StatelessContainer, StatelessBeanContext>(info); ejb3Inv.setAdvisor(container); ejb3Inv.setArguments(args); ejb3Inv.setContextCallback(new CallbackImpl(epInv)); Object retObj = ejb3Inv.invokeNext(); epInv.setReturnValue(retObj); } catch (Throwable th) { handleInvocationException(th); } }