Search in sources :

Example 6 with EJBHome

use of javax.ejb.EJBHome in project tomee by apache.

the class SingletonPojoEjbMetaDataTests method test01_getEJBHome.

//=================================
// Test meta data methods
//
public void test01_getEJBHome() {
    try {
        final EJBHome home = ejbMetaData.getEJBHome();
        assertNotNull("The EJBHome is null", home);
    } catch (final Exception e) {
        fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
}
Also used : EJBHome(javax.ejb.EJBHome)

Example 7 with EJBHome

use of javax.ejb.EJBHome in project tomee by apache.

the class SingletonPojoEjbObjectTests method test01_getEjbHome.

// ===============================
// Start EJBObject methods test
//
/**
     * According to the EJB3.0 "Core Contracts and Requirements" specs, section
     * 3.6.4, a session EJBObject supports:
     * 1. Get the session object's remote home interface.
     * 2. Get the session object's handle.
     * 3. Test if the session object is identical with another session object.
     * 4. Remove the session object.
     */
/**
     * A method to test retrieving the EJBHome interface of a session bean using its EJBObject reference.
     */
public void test01_getEjbHome() {
    try {
        final EJBHome home = ejbObject.getEJBHome();
        assertNotNull("The EJBHome is null", home);
    } catch (final Exception e) {
        fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
}
Also used : EJBHome(javax.ejb.EJBHome)

Example 8 with EJBHome

use of javax.ejb.EJBHome in project tomee by apache.

the class SingletonEjbObjectTests method test03_getEjbHome.

public void test03_getEjbHome() {
    try {
        final EJBHome home = ejbObject.getEJBHome();
        assertNotNull("The EJBHome is null", home);
    } catch (final Exception e) {
        fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
}
Also used : EJBHome(javax.ejb.EJBHome) RemoteException(java.rmi.RemoteException)

Example 9 with EJBHome

use of javax.ejb.EJBHome in project tomee by apache.

the class RmiIiopStatefulBean method returnEJBHome.

public EJBHome returnEJBHome() throws javax.ejb.EJBException {
    EJBHome data = null;
    try {
        final InitialContext ctx = new InitialContext();
        data = (EJBHome) ctx.lookup("java:comp/env/stateful/rmi-iiop/home");
    } catch (final Exception e) {
        e.printStackTrace();
        throw new javax.ejb.EJBException(e);
    }
    return data;
}
Also used : EJBException(javax.ejb.EJBException) EJBHome(javax.ejb.EJBHome) InitialContext(javax.naming.InitialContext) EJBException(javax.ejb.EJBException) RemoteException(java.rmi.RemoteException)

Example 10 with EJBHome

use of javax.ejb.EJBHome in project tomee by apache.

the class RmiIiopSingletonBean method returnEJBHome.

public EJBHome returnEJBHome() throws javax.ejb.EJBException {
    EJBHome data = null;
    try {
        final InitialContext ctx = new InitialContext();
        data = (EJBHome) ctx.lookup("java:comp/env/singleton/rmi-iiop/home");
    } catch (final Exception e) {
        e.printStackTrace();
        throw new javax.ejb.EJBException(e);
    }
    return data;
}
Also used : EJBException(javax.ejb.EJBException) EJBHome(javax.ejb.EJBHome) InitialContext(javax.naming.InitialContext) EJBException(javax.ejb.EJBException) RemoteException(java.rmi.RemoteException)

Aggregations

EJBHome (javax.ejb.EJBHome)63 RemoteException (java.rmi.RemoteException)14 EJBObject (javax.ejb.EJBObject)11 InitialContext (javax.naming.InitialContext)10 HomeHandle (javax.ejb.HomeHandle)8 ObjectNotFoundException (javax.ejb.ObjectNotFoundException)7 EJBException (javax.ejb.EJBException)6 ByteArrayInputStream (java.io.ByteArrayInputStream)3 ByteArrayOutputStream (java.io.ByteArrayOutputStream)3 ObjectInputStream (java.io.ObjectInputStream)3 ObjectOutputStream (java.io.ObjectOutputStream)3 MarshalledObject (java.rmi.MarshalledObject)3 Method (java.lang.reflect.Method)2 EJBLocalHome (javax.ejb.EJBLocalHome)2 EJBMetaData (javax.ejb.EJBMetaData)2 Handle (javax.ejb.Handle)2 RemoveException (javax.ejb.RemoveException)2 Test (org.junit.Test)2 CreateException (javax.ejb.CreateException)1 EJBAccessException (javax.ejb.EJBAccessException)1