public JBossSessionBean31DescriptorAdaptor(JBossSessionBean31MetaData sessionBeanMetaData, DeploymentUnit deploymentUnit, EjbReferenceResolver resolver) { super(sessionBeanMetaData, deploymentUnit, resolver); if (sessionBeanMetaData.isNoInterfaceBean()) { getLocalBusinessInterfaces().add(new JBossBussinessInterfaceDescriptorAdaptor<T>(sessionBeanMetaData.getEjbClass(), sessionBeanMetaData.getEjbName(), deploymentUnit, resolver)); this.localJndiName = getJndiName(sessionBeanMetaData); this.noInterfaceView = true; } else { this.localJndiName = null; this.noInterfaceView = false; } singleton = sessionBeanMetaData.isSingleton(); }
public JBossSessionBean31DescriptorAdaptor(JBossSessionBean31MetaData sessionBeanMetaData, DeploymentUnit deploymentUnit, EjbReferenceResolver resolver) { super(sessionBeanMetaData, deploymentUnit, resolver); if (sessionBeanMetaData.isNoInterfaceBean()) { getLocalBusinessInterfaces().add(new JBossBussinessInterfaceDescriptorAdaptor<T>(sessionBeanMetaData.getEjbClass(), sessionBeanMetaData.getEjbName(), deploymentUnit, resolver)); this.localJndiName = getJndiName(sessionBeanMetaData); this.noInterfaceView = true; } else { this.localJndiName = null; this.noInterfaceView = true; } }
BusinessLocalsMetaData businessLocals = this.sessionBean31MetaData.getBusinessLocals(); if (businessLocals != null) BusinessRemotesMetaData businessRemotes = this.sessionBean31MetaData.getBusinessRemotes(); if (businessRemotes != null) isValidBusinessInterface = this.sessionBean31MetaData.isNoInterfaceBean() && this.beanClassName.equals(businessInterface.getName());
if (sessionBean31.isNoInterfaceBean()) String ejbClassName = sessionBean31.getEjbClass();
ConcurrentMethodsMetaData concurrentMethods = sessionBean.getConcurrentMethods(); if(concurrentMethods == null) if (sessionBean.isSingleton() && declaringClass != null && !sessionBean.getEjbClass().equals(declaringClass)) LockType lockType = sessionBean.getLockType(declaringClass); if (lockType == null) if (sessionBean.isSingleton() && declaringClass != null && !sessionBean.getEjbClass().equals(declaringClass)) lockType = sessionBean.getLockType(declaringClass); if (lockType == null)
if(((JBossSessionBean31MetaData) smd).isNoInterfaceBean() && businessInterface.equals(container.getBeanClass())) return createNoInterfaceBusinessObject(container, sessionId, businessInterface);
asyncMethods = session31.getAsyncMethods(); if (asyncMethods == null)
/** * @see org.jboss.ejb3.metadata.MetaDataBridge#retrieveAnnotation(java.lang.Class, java.lang.Object, java.lang.ClassLoader) */ @Override public <A extends Annotation> A retrieveAnnotation(Class<A> annotationClass, JBossEnterpriseBeanMetaData metaData, ClassLoader classLoader) { if (annotationClass == null || annotationClass.equals(AccessTimeout.class) == false) { return null; } // only session beans and that too of type JBossSessionBean31MetaData if (metaData.isSession() == false || (metaData instanceof JBossSessionBean31MetaData) == false) { return null; } JBossSessionBean31MetaData sessionBean = (JBossSessionBean31MetaData) metaData; AccessTimeoutMetaData accessTimeoutMetaData = sessionBean.getAccessTimeout(); if (accessTimeoutMetaData == null) { return null; } AccessTimeout accessTimeout = new AccessTimeoutImpl(accessTimeoutMetaData.getTimeout(), accessTimeoutMetaData .getUnit()); return annotationClass.cast(accessTimeout); }
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); }