org.openxava.ejbx
Class EJBFactory

java.lang.Object
  extended by org.openxava.ejbx.EJBFactory

public class EJBFactory
extends java.lang.Object

Utility class for create EJBs from home.

We can create with argument (typical in EntityBeans case) or without argument (typical in SessionBeans case).

Author:
Javier Paniza

Constructor Summary
EJBFactory()
           
 
Method Summary
static java.lang.Object create(EJBHome home)
          Create a EJB from a home.
static java.lang.Object create(EJBHome home, java.util.Map map)
          Create a EJB from a home and the create argument.
static java.lang.Object create(EJBHome home, java.lang.Object details)
          Create a EJB form home and the create arguments.
static java.lang.Object create(java.lang.Object home, java.lang.Class className)
          Creates a EJB from a home and its class.
static java.lang.Object create(java.lang.Object home, java.lang.Class homeClass, java.util.Map map)
          Create a EJB from a home, its class and a java.util.Map as create argument.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EJBFactory

public EJBFactory()
Method Detail

create

public static java.lang.Object create(EJBHome home)
                               throws CreateException,
                                      java.rmi.RemoteException,
                                      java.lang.NoSuchMethodException
Create a EJB from a home.

The home must to have a create() method.

Parameters:
home - The home against call the create() method
Throws:
CreateException - The original from create() method
java.rmi.RemoteException - The original from create() method
java.lang.NoSuchMethodException - If the home does not have create() method

create

public static java.lang.Object create(java.lang.Object home,
                                      java.lang.Class className)
                               throws CreateException,
                                      java.rmi.RemoteException,
                                      java.lang.NoSuchMethodException
Creates a EJB from a home and its class.

The home must to have a create() method.

Parameters:
home - home on which the creation method is invoked.
className - home class on which the creation method is invoked.
Throws:
CreateException - From original create
java.rmi.RemoteException - From original create
java.lang.NoSuchMethodException - If the home does not have a create() method

create

public static java.lang.Object create(EJBHome home,
                                      java.lang.Object details)
                               throws ValidationException,
                                      CreateException,
                                      java.rmi.RemoteException,
                                      java.lang.NoSuchMethodException
Create a EJB form home and the create arguments.

The home must to have a create(Object ) method.

Parameters:
home - The home on which create method is invoked.
details - Argument to send to create method
Throws:
ValidationException - From create method
CreateException - From create method
java.rmi.RemoteException - From create method
java.lang.NoSuchMethodException - If the home does not have a method create(Object )

create

public static java.lang.Object create(EJBHome home,
                                      java.util.Map map)
                               throws ValidationException,
                                      CreateException,
                                      java.rmi.RemoteException,
                                      java.lang.NoSuchMethodException
Create a EJB from a home and the create argument.

The home must to have a create(Map ) method.

Parameters:
home - The home on which the create method is invoked.
map - Argument sent to create method
Throws:
ValidationException - From create method
CreateException - From create method
java.rmi.RemoteException - From create method
java.lang.NoSuchMethodException - If the home does not have a create(Object ) method

create

public static java.lang.Object create(java.lang.Object home,
                                      java.lang.Class homeClass,
                                      java.util.Map map)
                               throws CreateException,
                                      ValidationException,
                                      java.rmi.RemoteException,
                                      java.lang.NoSuchMethodException
Create a EJB from a home, its class and a java.util.Map as create argument.

The home sent must to have a create(Map ) method.

Parameters:
home - The home on which create method is invoked
homeClass - Class of the home
map - Argument sent to create method
Throws:
CreateException - From create method
ValidationException - From create method
java.rmi.RemoteException - From create method
java.lang.NoSuchMethodException - If the home does not have a create(Map ) method