net.sf.ejbutil
Class EjbUtil

java.lang.Object
  extended by net.sf.ejbutil.EjbUtil

public class EjbUtil
extends java.lang.Object

A utility class to find XDoclet generated Home interfaces of EJBs and to create EJBs

Author:
Tom Vijlbrief

Constructor Summary
EjbUtil()
           
 
Method Summary
static java.lang.Object create(java.lang.Class cl)
          Create an EJB with the default create()
static java.lang.Object find(java.lang.Class cl, java.lang.String name)
          Like find(name1, name2) but using only one name
static java.lang.Object find(java.lang.Class cl, java.lang.String name1, java.lang.String name2)
          Find the Home interface of the EJB in the COMP or JNDI namespace.
static javax.ejb.EJBObject jbossCreate(java.lang.Class cl)
          Creates an EJB in JBoss.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EjbUtil

public EjbUtil()
Method Detail

find

public static java.lang.Object find(java.lang.Class cl,
                                    java.lang.String name1,
                                    java.lang.String name2)
                             throws javax.naming.NamingException
Find the Home interface of the EJB in the COMP or JNDI namespace.

Parameters:
cl - The class of the Home interface
name1 - The first name of the Home Interface of the EJB (normally java:comp/env/...)
name2 - The second name of the Home Interface of the EJB (normally JNDI) or null
Returns:
The home interface
Throws:
javax.naming.NamingException

find

public static java.lang.Object find(java.lang.Class cl,
                                    java.lang.String name)
                             throws javax.naming.NamingException
Like find(name1, name2) but using only one name

Parameters:
cl -
name -
Returns:
Throws:
javax.naming.NamingException

create

public static java.lang.Object create(java.lang.Class cl)
Create an EJB with the default create()

Parameters:
cl - The class of the Home interface
Returns:
The created EJBObject

jbossCreate

public static javax.ejb.EJBObject jbossCreate(java.lang.Class cl)
Creates an EJB in JBoss. This method is used to call JBoss from other application servers (SAP, WebLogic, ...) The system property jboss.provider is used to refer to the JBoss provider (default: "jnp://localhost:11099")

Parameters:
cl - The class of the Home interface
Returns:
The created EJBObject