Search in sources :

Example 26 with BAD_OPERATION

use of org.omg.CORBA.BAD_OPERATION 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) ORB(org.omg.CORBA.ORB) InitialContext(javax.naming.InitialContext)

Aggregations

BAD_OPERATION (org.omg.CORBA.BAD_OPERATION)26 SystemException (org.omg.CORBA.SystemException)11 ControlWrapper (com.arjuna.ats.internal.jts.ControlWrapper)8 Any (org.omg.CORBA.Any)6 UNKNOWN (org.omg.CORBA.UNKNOWN)6 INVALID_TRANSACTION (org.omg.CORBA.INVALID_TRANSACTION)5 Control (org.omg.CosTransactions.Control)4 OutputStream (org.omg.CORBA.portable.OutputStream)3 Coordinator (org.omg.CosTransactions.Coordinator)3 ServerControl (com.arjuna.ats.internal.jts.orbspecific.interposition.ServerControl)2 ServerSynchronization (com.arjuna.ats.internal.jts.orbspecific.interposition.resources.ServerSynchronization)2 InterceptorContext (org.jboss.invocation.InterceptorContext)2 BAD_PARAM (org.omg.CORBA.BAD_PARAM)2 NO_IMPLEMENT (org.omg.CORBA.NO_IMPLEMENT)2 InputStream (org.omg.CORBA.portable.InputStream)2 UnknownException (org.omg.CORBA.portable.UnknownException)2 Inactive (org.omg.CosTransactions.Inactive)2 RecoveryCoordinator (org.omg.CosTransactions.RecoveryCoordinator)2 SynchronizationUnavailable (org.omg.CosTransactions.SynchronizationUnavailable)2 TransactionFactory (org.omg.CosTransactions.TransactionFactory)2