Search in sources :

Example 1 with EJBLocalHome

use of javax.ejb.EJBLocalHome in project Payara by payara.

the class SafeProperties method instantiateEJBLocalHomeImpl.

private EJBLocalHomeImpl instantiateEJBLocalHomeImpl() throws Exception {
    // LocalHome impl
    EJBLocalHomeInvocationHandler invHandler = getEJBLocalHomeInvocationHandler(localHomeIntf);
    invHandler.setMethodMap(proxyInvocationInfoMap);
    EJBLocalHomeImpl homeImpl = invHandler;
    // Maintain insertion order
    Set proxyInterfacesSet = new LinkedHashSet();
    proxyInterfacesSet.add(IndirectlySerializable.class);
    addProxyInterfacesSetClass(proxyInterfacesSet, true);
    proxyInterfacesSet.add(localHomeIntf);
    Class[] proxyInterfaces = (Class[]) proxyInterfacesSet.toArray(new Class[proxyInterfacesSet.size()]);
    // Client's EJBLocalHome object
    try {
        EJBLocalHome proxy = (EJBLocalHome) Proxy.newProxyInstance(loader, proxyInterfaces, invHandler);
        invHandler.setProxy(proxy);
    } catch (ClassCastException e) {
        String msg = localStrings.getLocalString("ejb.basecontainer_invalid_local_home_interface", "Local home interface [{0}] is invalid since it does not extend javax.ejb.EJBLocalHome.", localHomeIntf);
        throw new IllegalArgumentException(msg, e);
    }
    homeImpl.setContainer(this);
    return homeImpl;
}
Also used : LinkedHashSet(java.util.LinkedHashSet) Set(java.util.Set) LinkedHashSet(java.util.LinkedHashSet) HashSet(java.util.HashSet) EJBLocalHome(javax.ejb.EJBLocalHome)

Example 2 with EJBLocalHome

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

the class StatelessPojoEjbLocalObjectTests method test02_getEjbLocalHome.

public void test02_getEjbLocalHome() {
    try {
        final EJBLocalHome localHome = ejbLocalObject.getEJBLocalHome();
        assertNotNull("The EJBLocalHome is null", localHome);
    } catch (final Exception e) {
        fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
}
Also used : EJBLocalHome(javax.ejb.EJBLocalHome)

Example 3 with EJBLocalHome

use of javax.ejb.EJBLocalHome in project Payara by payara.

the class SafeProperties method instantiateEJBLocalBusinessHomeImpl.

private EJBLocalHomeImpl instantiateEJBLocalBusinessHomeImpl() throws Exception {
    EJBLocalHomeInvocationHandler invHandler = getEJBLocalHomeInvocationHandler(localBusinessHomeIntf);
    invHandler.setMethodMap(proxyInvocationInfoMap);
    EJBLocalHomeImpl homeImpl = invHandler;
    EJBLocalHome proxy = (EJBLocalHome) Proxy.newProxyInstance(loader, new Class[] { IndirectlySerializable.class, localBusinessHomeIntf }, invHandler);
    invHandler.setProxy(proxy);
    homeImpl.setContainer(this);
    return homeImpl;
}
Also used : IndirectlySerializable(com.sun.enterprise.container.common.spi.util.IndirectlySerializable) EJBLocalHome(javax.ejb.EJBLocalHome)

Example 4 with EJBLocalHome

use of javax.ejb.EJBLocalHome in project Payara by payara.

the class SafeProperties method instantiateEJBOptionalLocalBusinessHomeImpl.

private EJBLocalHomeImpl instantiateEJBOptionalLocalBusinessHomeImpl() throws Exception {
    EJBLocalHomeInvocationHandler invHandler = getEJBLocalHomeInvocationHandler(localBusinessHomeIntf);
    invHandler.setMethodMap(proxyInvocationInfoMap);
    EJBLocalHomeImpl homeImpl = invHandler;
    EJBLocalHome proxy = (EJBLocalHome) Proxy.newProxyInstance(loader, new Class[] { IndirectlySerializable.class, ejbOptionalLocalBusinessHomeIntf }, invHandler);
    invHandler.setProxy(proxy);
    homeImpl.setContainer(this);
    return homeImpl;
}
Also used : IndirectlySerializable(com.sun.enterprise.container.common.spi.util.IndirectlySerializable) EJBLocalHome(javax.ejb.EJBLocalHome)

Example 5 with EJBLocalHome

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

the class SingletonPojoEjbLocalObjectTests method test02_getEjbLocalHome.

public void test02_getEjbLocalHome() {
    try {
        final EJBLocalHome localHome = ejbLocalObject.getEJBLocalHome();
        assertNotNull("The EJBLocalHome is null", localHome);
    } catch (final Exception e) {
        fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
}
Also used : EJBLocalHome(javax.ejb.EJBLocalHome)

Aggregations

EJBLocalHome (javax.ejb.EJBLocalHome)6 IndirectlySerializable (com.sun.enterprise.container.common.spi.util.IndirectlySerializable)2 HashSet (java.util.HashSet)1 LinkedHashSet (java.util.LinkedHashSet)1 Set (java.util.Set)1