org.jboss.webbeans.ejb.spi
Interface EjbServices

All Superinterfaces:
Service
All Known Implementing Classes:
ForwardingEjbServices

public interface EjbServices
extends Service

A container should implement this interface to allow Web Beans to resolve EJB and discover EJBs

Author:
Pete Muir

Method Summary
 java.lang.Iterable<EjbDescriptor<?>> discoverEjbs()
          Gets a descriptor for each EJB in the application
 SessionObjectReference resolveEjb(EjbDescriptor<?> ejbDescriptor)
          Request a reference to an EJB session object from the container.
 java.lang.Object resolveEjb(InjectionPoint injectionPoint)
          Resolve the value for the given @EJB injection point
 java.lang.Object resolveRemoteEjb(java.lang.String jndiName, java.lang.String mappedName, java.lang.String ejbLink)
          Resolve a remote EJB reference.
 

Method Detail

resolveEjb

java.lang.Object resolveEjb(InjectionPoint injectionPoint)
Resolve the value for the given @EJB injection point

Parameters:
injectionPoint - the injection point metadata
Returns:
an instance of the EJB
Throws:
java.lang.IllegalArgumentException - if the injection point is not annotated with @EJB, or, if the injection point is a method that doesn't follow JavaBean conventions

resolveEjb

SessionObjectReference resolveEjb(EjbDescriptor<?> ejbDescriptor)
Request a reference to an EJB session object from the container. If the EJB being resolved is a stateful session bean, the container should ensure the session bean is created before this method returns.

Parameters:
ejbDescriptor - the ejb to resolve
Returns:
a reference to the session object

resolveRemoteEjb

java.lang.Object resolveRemoteEjb(java.lang.String jndiName,
                                  java.lang.String mappedName,
                                  java.lang.String ejbLink)
Resolve a remote EJB reference. At least one of the parameters will not be null.

Parameters:
jndiName - the JNDI name
mappedName - the mapped name
ejbLink - the EJB link name
Returns:
the remote EJB reference
Throws:
java.lang.IllegalStateException - if no EJBs can be resolved for injection
java.lang.IllegalArgumentException - if jndiName, mappedName and ejbLink are null

discoverEjbs

java.lang.Iterable<EjbDescriptor<?>> discoverEjbs()
Gets a descriptor for each EJB in the application

Returns:
the EJB descriptors


Copyright © 2011. All Rights Reserved.