private boolean isRemoveMethod(Method method) { // TODO we can certainly optimize this search algorithm! MethodSignature methodSignature = new MethodSignatureImpl(method); return bean.getEjbDescriptor().getRemoveMethodSignatures().contains(methodSignature); }
public SessionObjectReference createReference() { try { SessionBeanInjectionPoint.registerContextualInstance(getEjbDescriptor()); return beanManager.getServices().get(EjbServices.class).resolveEjb(getEjbDescriptor().delegate()); } finally { SessionBeanInjectionPoint.unregisterContextualInstance(getEjbDescriptor()); } }
public SessionBeanType getSessionBeanType() { checkWithinObserverNotification(); if (getBean().getEjbDescriptor().isStateless()) { return SessionBeanType.STATELESS; } else if (getBean().getEjbDescriptor().isStateful()) { return SessionBeanType.STATEFUL; } else if (getBean().getEjbDescriptor().isSingleton()) { return SessionBeanType.SINGLETON; } else { throw BootstrapLogger.LOG.beanTypeNotEjb(getBean()); } }
/** * Returns {@link EnhancedAnnotatedType} for the EJB implementation class. Throws {@link IllegalStateException} if called after bootstrap. * * @param bean * @throws IllegalStateException if called after bootstrap * @return {@link EnhancedAnnotatedType} representation of this EJB's implementation class */ public static <T> EnhancedAnnotatedType<T> getEjbImplementationClass(SessionBean<T> bean) { return getEjbImplementationClass(bean.getEjbDescriptor(), bean.getBeanManager(), bean.getEnhancedAnnotated()); }
public static <T> SessionBeanInjectionTarget<T> of(EnhancedAnnotatedType<T> type, SessionBean<T> bean, BeanManagerImpl beanManager) { LifecycleCallbackInvoker<T> invoker = DefaultLifecycleCallbackInvoker.of(type); Injector<T> injector; if (bean.getEjbDescriptor().isStateless() || bean.getEjbDescriptor().isSingleton()) { injector = new DynamicInjectionPointInjector<T>(type, bean, beanManager); } else { injector = new DefaultInjector<T>(type, bean, beanManager); } return new SessionBeanInjectionTarget<T>(type, bean, beanManager, injector, invoker); }
public String getEjbName() { checkWithinObserverNotification(); return getBean().getEjbDescriptor().getEjbName(); }
public static <T> SessionBeanInjectionTarget<T> of(EnhancedAnnotatedType<T> type, SessionBean<T> bean, BeanManagerImpl beanManager) { LifecycleCallbackInvoker<T> invoker = DefaultLifecycleCallbackInvoker.of(type); Injector<T> injector; if (bean.getEjbDescriptor().isStateless() || bean.getEjbDescriptor().isSingleton()) { injector = new DynamicInjectionPointInjector<T>(type, bean, beanManager); } else { injector = new DefaultInjector<T>(type, bean, beanManager); } return new SessionBeanInjectionTarget<T>(type, bean, beanManager, injector, invoker); }
public SessionBeanType getSessionBeanType() { checkWithinObserverNotification(); if (getBean().getEjbDescriptor().isStateless()) { return SessionBeanType.STATELESS; } else if (getBean().getEjbDescriptor().isStateful()) { return SessionBeanType.STATEFUL; } else if (getBean().getEjbDescriptor().isSingleton()) { return SessionBeanType.SINGLETON; } else { throw BootstrapLogger.LOG.beanTypeNotEjb(getBean()); } }
public String getEjbName() { checkWithinObserverNotification(); return getBean().getEjbDescriptor().getEjbName(); }
public SessionBeanType getSessionBeanType() { checkWithinObserverNotification(); if (getBean().getEjbDescriptor().isStateless()) { return SessionBeanType.STATELESS; } else if (getBean().getEjbDescriptor().isStateful()) { return SessionBeanType.STATEFUL; } else if (getBean().getEjbDescriptor().isSingleton()) { return SessionBeanType.SINGLETON; } else { throw BootstrapLogger.LOG.beanTypeNotEjb(getBean()); } }
/** * Returns {@link EnhancedAnnotatedType} for the EJB implementation class. Throws {@link IllegalStateException} if called after bootstrap. * @param bean * @throws IllegalStateException if called after bootstrap * @return {@link EnhancedAnnotatedType} representation of this EJB's implementation class */ public static <T> EnhancedAnnotatedType<T> getEjbImplementationClass(SessionBean<T> bean) { return getEjbImplementationClass(bean.getEjbDescriptor(), bean.getBeanManager(), bean.getEnhancedAnnotated()); }
public SessionBeanType getSessionBeanType() { checkWithinObserverNotification(); if (getBean().getEjbDescriptor().isStateless()) { return SessionBeanType.STATELESS; } else if (getBean().getEjbDescriptor().isStateful()) { return SessionBeanType.STATEFUL; } else if (getBean().getEjbDescriptor().isSingleton()) { return SessionBeanType.SINGLETON; } else { throw BootstrapLogger.LOG.beanTypeNotEjb(getBean()); } }
public SessionBeanType getSessionBeanType() { checkWithinObserverNotification(); if (getBean().getEjbDescriptor().isStateless()) { return SessionBeanType.STATELESS; } else if (getBean().getEjbDescriptor().isStateful()) { return SessionBeanType.STATEFUL; } else if (getBean().getEjbDescriptor().isSingleton()) { return SessionBeanType.SINGLETON; } else { throw BootstrapLogger.LOG.beanTypeNotEjb(getBean()); } }
public SessionBeanType getSessionBeanType() { checkWithinObserverNotification(); if (getBean().getEjbDescriptor().isStateless()) { return SessionBeanType.STATELESS; } else if (getBean().getEjbDescriptor().isStateful()) { return SessionBeanType.STATEFUL; } else if (getBean().getEjbDescriptor().isSingleton()) { return SessionBeanType.SINGLETON; } else { throw BootstrapLogger.LOG.beanTypeNotEjb(getBean()); } }
public String getEjbName() { checkWithinObserverNotification(); return getBean().getEjbDescriptor().getEjbName(); }
public String getEjbName() { checkWithinObserverNotification(); return getBean().getEjbDescriptor().getEjbName(); }
@Override public String toString() { return "Session bean [" + getBeanClass() + " with qualifiers [" + Formats.formatAnnotations(getQualifiers()) + "]; local interfaces are [" + Formats.formatBusinessInterfaceDescriptors(getEjbDescriptor().getLocalBusinessInterfaces()) + "]"; }
protected EnterpriseTargetBeanInstance createEnterpriseTargetBeanInstance() { if (bean.getEjbDescriptor().isStateless() || bean.getEjbDescriptor().isSingleton()) { return new InjectionPointPropagatingEnterpriseTargetBeanInstance(bean.getBeanClass(), new EnterpriseBeanProxyMethodHandler<T>(bean), bean.getBeanManager()); } else { return new EnterpriseTargetBeanInstance(bean.getBeanClass(), new EnterpriseBeanProxyMethodHandler<T>(bean)); } }
protected void registerInterceptors() { InterceptionModel model = beanManager.getInterceptorModelRegistry().get(getAnnotated()); if (model != null) { getBeanManager().getServices().get(EjbServices.class).registerInterceptors(getEjbDescriptor().delegate(), new InterceptorBindingsAdapter(model)); } } }
/** * Produces a factory for a specific bean implementation. * * @param proxiedBeanType the actual enterprise bean */ public EnterpriseProxyFactory(Class<T> proxiedBeanType, SessionBean<T> bean) { super(bean.getBeanManager().getContextId(), proxiedBeanType, ImmutableSet.<Type> builder().addAll(bean.getTypes()) .addAll(bean.getEjbDescriptor().getRemoteBusinessInterfacesAsClasses()).build(), bean); }