Search in sources :

Example 1 with RecoveryCoordinatorId

use of com.arjuna.ats.internal.jts.orbspecific.recovery.recoverycoordinators.RecoveryCoordinatorId in project narayana by jbosstm.

the class JavaIdlRCDefaultServant method replay_completion.

public Status replay_completion(Resource res) throws SystemException, NotPrepared {
    if (jtsLogger.logger.isDebugEnabled()) {
        jtsLogger.logger.debug("JavaIdlRCDefaultServant::replay_completion)");
    }
    try {
        // Begin New
        org.omg.CORBA.Object obj = _ourOrb.resolve_initial_references("POACurrent");
        org.omg.PortableServer.Current poa_current = org.omg.PortableServer.CurrentHelper.narrow(obj);
        byte[] objectId = poa_current.get_object_id();
        // End New
        String objectIdString = new String(objectId, StandardCharsets.UTF_8);
        String poaName = poa_current.get_POA().the_name();
        if (objectIdString.startsWith(poaName)) {
            // strip off the POA name prefix from the object name - the remainder encodes our Uids
            int index = poaName.length();
            if (objectIdString.length() > index)
                index += 1;
            objectIdString = objectIdString.substring(index);
        }
        // convert that to the structured id
        RecoveryCoordinatorId recovCoId = RecoveryCoordinatorId.reconstruct(objectIdString);
        if (jtsLogger.logger.isDebugEnabled()) {
            jtsLogger.logger.debug("JavaIdlDefaultServant replay_completion for Id " + recovCoId);
        }
        // and do the real replay
        return GenericRecoveryCoordinator.replay_completion(recovCoId, res);
    }/**
     */
     catch (NotPrepared exp) {
        throw exp;
    }/**/
     catch (Exception ex) {
        jtsLogger.i18NLogger.warn_orbspecific_jacorb_recoverycoordinators_JacOrbRCDefaultServant_3(ex);
        return Status.StatusUnknown;
    }
}
Also used : RecoveryCoordinatorId(com.arjuna.ats.internal.jts.orbspecific.recovery.recoverycoordinators.RecoveryCoordinatorId) NotPrepared(org.omg.CosTransactions.NotPrepared) SystemException(org.omg.CORBA.SystemException)

Example 2 with RecoveryCoordinatorId

use of com.arjuna.ats.internal.jts.orbspecific.recovery.recoverycoordinators.RecoveryCoordinatorId in project narayana by jbosstm.

the class JavaIdlRCDefaultServant method replay_completion.

public Status replay_completion(Resource res) throws SystemException, NotPrepared {
    if (jtsLogger.logger.isDebugEnabled()) {
        jtsLogger.logger.debug("JavaIdlRCDefaultServant::replay_completion)");
    }
    try {
        // Begin New
        org.omg.CORBA.Object obj = _ourOrb.resolve_initial_references("POACurrent");
        org.omg.PortableServer.Current poa_current = org.omg.PortableServer.CurrentHelper.narrow(obj);
        byte[] objectId = poa_current.get_object_id();
        // End New
        String objectIdString = new String(objectId);
        String poaName = poa_current.get_POA().the_name();
        if (objectIdString.startsWith(poaName)) {
            // strip off the POA name prefix from the object name - the remainder encodes our Uids
            int index = poaName.length();
            if (objectIdString.length() > index)
                index += 1;
            objectIdString = objectIdString.substring(index);
        }
        // convert that to the structured id
        RecoveryCoordinatorId recovCoId = RecoveryCoordinatorId.reconstruct(objectIdString);
        if (jtsLogger.logger.isDebugEnabled()) {
            jtsLogger.logger.debug("JavaIdlDefaultServant replay_completion for Id " + recovCoId);
        }
        // and do the real replay
        return GenericRecoveryCoordinator.replay_completion(recovCoId, res);
    }/**
     */
     catch (NotPrepared exp) {
        throw exp;
    }/**/
     catch (Exception ex) {
        jtsLogger.i18NLogger.warn_orbspecific_jacorb_recoverycoordinators_JacOrbRCDefaultServant_3(ex);
        return Status.StatusUnknown;
    }
}
Also used : RecoveryCoordinatorId(com.arjuna.ats.internal.jts.orbspecific.recovery.recoverycoordinators.RecoveryCoordinatorId) NotPrepared(org.omg.CosTransactions.NotPrepared) SystemException(org.omg.CORBA.SystemException)

Example 3 with RecoveryCoordinatorId

use of com.arjuna.ats.internal.jts.orbspecific.recovery.recoverycoordinators.RecoveryCoordinatorId in project narayana by jbosstm.

the class JacOrbRCDefaultServant method replay_completion.

public Status replay_completion(Resource res) throws SystemException, NotPrepared {
    if (jtsLogger.logger.isDebugEnabled()) {
        jtsLogger.logger.debug("JacOrbDefaultServant::replay_completion)");
    }
    try {
        // Begin New
        org.omg.CORBA.Object obj = _ourOrb.resolve_initial_references("POACurrent");
        org.omg.PortableServer.Current poa_current = org.omg.PortableServer.CurrentHelper.narrow(obj);
        byte[] objectId = poa_current.get_object_id();
        // End New
        String objectIdString = new String(objectId, StandardCharsets.UTF_8);
        // convert that to the structured id
        RecoveryCoordinatorId recovCoId = RecoveryCoordinatorId.reconstruct(objectIdString);
        if (jtsLogger.logger.isDebugEnabled()) {
            jtsLogger.logger.debug("JacOrbDefaultServant replay_completion for Id " + recovCoId);
        }
        // and do the real replay
        return GenericRecoveryCoordinator.replay_completion(recovCoId, res);
    }/**
     */
     catch (NotPrepared exp) {
        throw exp;
    }/**/
     catch (Exception ex) {
        jtsLogger.i18NLogger.warn_orbspecific_jacorb_recoverycoordinators_JacOrbRCDefaultServant_3(ex);
        return Status.StatusUnknown;
    }
}
Also used : RecoveryCoordinatorId(com.arjuna.ats.internal.jts.orbspecific.recovery.recoverycoordinators.RecoveryCoordinatorId) NotPrepared(org.omg.CosTransactions.NotPrepared) SystemException(org.omg.CORBA.SystemException)

Aggregations

RecoveryCoordinatorId (com.arjuna.ats.internal.jts.orbspecific.recovery.recoverycoordinators.RecoveryCoordinatorId)3 SystemException (org.omg.CORBA.SystemException)3 NotPrepared (org.omg.CosTransactions.NotPrepared)3