Search in sources :

Example 1 with Stub

use of javax.rmi.CORBA.Stub in project wildfly by wildfly.

the class HandleDelegateImpl method reconnect.

protected void reconnect(Object object) throws IOException {
    if (object instanceof ObjectImpl) {
        try {
            // Check we are still connected
            ObjectImpl objectImpl = (ObjectImpl) object;
            objectImpl._get_delegate();
        } catch (BAD_OPERATION e) {
            try {
                // Reconnect
                final Stub stub = (Stub) object;
                final ORB orb = (ORB) new InitialContext().lookup("java:comp/ORB");
                stub.connect(orb);
            } catch (NamingException ne) {
                throw EjbLogger.ROOT_LOGGER.failedToLookupORB();
            }
        }
    } else {
        throw EjbLogger.ROOT_LOGGER.notAnObjectImpl(object.getClass());
    }
}
Also used : Stub(javax.rmi.CORBA.Stub) NamingException(javax.naming.NamingException) BAD_OPERATION(org.omg.CORBA.BAD_OPERATION) ObjectImpl(org.omg.CORBA.portable.ObjectImpl) InitialContext(javax.naming.InitialContext) ORB(org.omg.CORBA.ORB)

Example 2 with Stub

use of javax.rmi.CORBA.Stub in project tomee by apache.

the class Corbas method connect.

public static Object connect(final Object obj) throws IOException {
    if (obj instanceof Stub) {
        final Stub stub = (Stub) obj;
        final ORB orb = getORB();
        stub.connect(orb);
    }
    return obj;
}
Also used : Stub(javax.rmi.CORBA.Stub) ORB(org.omg.CORBA.ORB)

Aggregations

Stub (javax.rmi.CORBA.Stub)2 ORB (org.omg.CORBA.ORB)2 InitialContext (javax.naming.InitialContext)1 NamingException (javax.naming.NamingException)1 BAD_OPERATION (org.omg.CORBA.BAD_OPERATION)1 ObjectImpl (org.omg.CORBA.portable.ObjectImpl)1