if(((JBossSessionBean31MetaData) smd).isNoInterfaceBean() && businessInterface.equals(container.getBeanClass())) return createNoInterfaceBusinessObject(container, sessionId, businessInterface);
protected ViewType getViewType(SessionContainer container, Class<?> intf) { // try to see if we can pass the preconditions of LegacyStatefulBusinessObjectFactory? // a direct copy out of LegacyStatefulBusinessObjectFactory // less risky than rolling our own thing. Class<?>[] remoteInterfaces = ProxyFactoryHelper.getRemoteAndBusinessRemoteInterfaces(container); if(arrayContains(remoteInterfaces, intf)) return ViewType.REMOTE; Class<?>[] localInterfaces = ProxyFactoryHelper.getLocalAndBusinessLocalInterfaces(container); if(arrayContains(localInterfaces, intf)) return ViewType.LOCAL; // copied out of EJB3NoInterfaceDeployer JBossSessionBeanMetaData beanMetaData = container.getMetaData(); if(!(beanMetaData instanceof JBossSessionBean31MetaData)) return ViewType.UNKNOWN; JBossSessionBean31MetaData sessionBean31MetaData = (JBossSessionBean31MetaData) beanMetaData; if(!sessionBean31MetaData.isNoInterfaceBean()) return ViewType.UNKNOWN; // it could still be an unknown view, make sure it's the no-interface view if(intf.equals(container.getBeanClass())) return ViewType.NO_INTERFACE; return ViewType.UNKNOWN; }
protected <B> B createNoInterfaceView(SessionContainer container, Serializable sessionId, Class<B> intf) { Class<?> beanClass = container.getBeanClass(); String name = container.getDeploymentQualifiedName(); KernelControllerContext endpointContext = (KernelControllerContext) kernel.getController().getContext(name, null); AsyncMethodsMetaData asyncMethods = null; JBossEnterpriseBeanMetaData sessionBeanMetaData = container.getXml(); if (sessionBeanMetaData instanceof JBossSessionBean31MetaData) { asyncMethods = ((JBossSessionBean31MetaData) sessionBeanMetaData).getAsyncMethods(); } // create an invocation handler InvocationHandler invocationHandler = new NoInterfaceViewInvocationHandler(endpointContext, sessionId, intf, asyncMethods == null ? new AsyncMethodsMetaData() : asyncMethods); // Now create the proxy Object noInterfaceView = new JavassistProxyFactory().createProxy(new Class<?>[] {beanClass}, invocationHandler); return intf.cast(noInterfaceView); }