Search in sources :

Example 11 with EJBHome

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

the class Unknown2HomeHandleTests method test01_getEJBHome.

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

Example 12 with EJBHome

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

the class Complex2EjbMetaDataTests 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(jakarta.ejb.EJBHome)

Example 13 with EJBHome

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

the class Complex2HomeHandleTests method test01_getEJBHome.

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

Example 14 with EJBHome

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

the class Complex2HomeHandleTests method Xtest03_copyHandleBySerialize.

public void Xtest03_copyHandleBySerialize() {
    try {
        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
        final ObjectOutputStream oos = new ObjectOutputStream(baos);
        oos.writeObject(ejbHomeHandle);
        oos.flush();
        oos.close();
        final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
        final ObjectInputStream ois = new ObjectInputStream(bais);
        final HomeHandle copy = (HomeHandle) ois.readObject();
        assertNotNull("The HomeHandle copy is null", copy);
        final EJBHome home = copy.getEJBHome();
        assertNotNull("The EJBHome is null", home);
    } catch (final Exception e) {
        fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) EJBHome(jakarta.ejb.EJBHome) HomeHandle(jakarta.ejb.HomeHandle) ByteArrayOutputStream(java.io.ByteArrayOutputStream) ObjectOutputStream(java.io.ObjectOutputStream) ObjectInputStream(java.io.ObjectInputStream)

Example 15 with EJBHome

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

the class Complex2HomeHandleTests method Xtest02_copyHandleByMarshalledObject.

public void Xtest02_copyHandleByMarshalledObject() {
    try {
        final MarshalledObject obj = new MarshalledObject(ejbHomeHandle);
        final HomeHandle copy = (HomeHandle) obj.get();
        assertNotNull("The HomeHandle copy is null", copy);
        final EJBHome home = copy.getEJBHome();
        assertNotNull("The EJBHome is null", home);
    } catch (final Exception e) {
        fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
}
Also used : EJBHome(jakarta.ejb.EJBHome) MarshalledObject(java.rmi.MarshalledObject) HomeHandle(jakarta.ejb.HomeHandle)

Aggregations

EJBHome (jakarta.ejb.EJBHome)60 RemoteException (java.rmi.RemoteException)14 EJBObject (jakarta.ejb.EJBObject)8 InitialContext (javax.naming.InitialContext)8 ObjectNotFoundException (jakarta.ejb.ObjectNotFoundException)7 EJBException (jakarta.ejb.EJBException)6 HomeHandle (jakarta.ejb.HomeHandle)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 EJBLocalHome (jakarta.ejb.EJBLocalHome)2 RemoveException (jakarta.ejb.RemoveException)2 Method (java.lang.reflect.Method)2 CreateException (jakarta.ejb.CreateException)1 EJBAccessException (jakarta.ejb.EJBAccessException)1 EJBLocalObject (jakarta.ejb.EJBLocalObject)1 AnnotatedMethod (jakarta.enterprise.inject.spi.AnnotatedMethod)1 LoginException (javax.security.auth.login.LoginException)1