Interface EJBFactory

All Superinterfaces:
Remote

public interface EJBFactory extends Remote
EJBFactory defines the methods that allow a remote client to create or find remote EJB objects. The factory is used to support EJB-Link and Auto-Link in the Client Container.

When an application defines an EJB reference, but does not provide any binding information for that reference, this is considered either an EJB-Link or Auto-Link scenario. EJB-Link refers to a configuration where the 'ejb-ref' has an 'ejb-link' (@EJB with 'beanName' parameter). And, Auto-Link refers to a configuration where the 'ejb-ref' does not contain an 'ejb-link', and thus only the reference interface is known.

For both the EJB-Link and Auto-Link scenarios, component name space and injection processing will use the methods on the EJBFactory to resolve the reference.

  • Method Details

    • create

      Object create(String application, String beanName, String interfaceName) throws javax.ejb.EJBException, RemoteException
      Returns a reference to the EJB object specified.

      The combination of application name and beanName or ejb-link including module information uniquely identify any EJB object.

      All parameters must be non-null.

      Parameters:
      application - name of the application containing the EJB.
      beanName - beanName or ejb-link, including module information.
      interfaceName - component home or business interface of EJB.
      Returns:
      a reference to the EJB object specified.
      Throws:
      javax.ejb.EJBException - is thrown when the specified EJB cannot be found or a failure occurs creating an instance.
      RemoteException
    • create

      Object create(String application, String module, String beanName, String interfaceName) throws javax.ejb.EJBException, RemoteException
      Returns a reference to the EJB object specified.

      The combination of application name, module name, and bean name uniquely identify any EJB object.

      All parameters must be non-null.

      Parameters:
      application - name of the application containing the EJB.
      module - name of the module containing the EJB.
      beanName - name of the specific EJB.
      interfaceName - component home or business interface of EJB.
      Returns:
      a reference to the EJB object specified.
      Throws:
      javax.ejb.EJBException - is thrown when the specified EJB cannot be found or a failure occurs creating an instance.
      RemoteException
    • findByBeanName

      Object findByBeanName(String application, String beanName, String interfaceName) throws javax.ejb.EJBException, RemoteException
      Returns a reference to the EJB object specified.

      The combination of application name, module name, and bean name uniquely identify any EJB object.

      This method if intended to be used when the specific module name is not known. All modules in the application will be searched for an EJB with the specified name. If multiple modules in the application contain an EJB with the specified name, this is considered an ambiguous reference, and an EJBException will be thrown.

      Parameters:
      application - name of the application containing the EJB.
      beanName - name of the specific EJB.
      interfaceName - component home or business interface of EJB.
      Returns:
      a reference to the EJB object specified.
      Throws:
      javax.ejb.EJBException - is thrown when the specified EJB cannot be found or a failure occurs creating an instance.
      RemoteException
    • findByInterface

      Object findByInterface(String application, String interfaceName) throws javax.ejb.EJBException, RemoteException
      Returns a reference to the EJB object specified.

      The combination of application name, module name, and bean name uniquely identify any EJB object.

      This method if intended to be used when neither the specific module name nor bean name are known. All modules in the application will be searched for an EJB that implements the specified interface. If multiple EJB objects in the application implement the specified interface, this is considered an ambiguous reference, and an EJBException will be thrown.

      Parameters:
      application - name of the application containing the EJB.
      interfaceName - component home or business interface of EJB.
      Returns:
      a reference to the EJB object specified.
      Throws:
      javax.ejb.EJBException - is thrown when the specified EJB cannot be found or a failure occurs creating an instance.
      RemoteException