Search in sources :

Example 11 with NO_IMPLEMENT

use of org.omg.CORBA.NO_IMPLEMENT in project ACS by ACS-Community.

the class PropertyPrimTest method testNewSubscriptionAlarm.

public void testNewSubscriptionAlarm() {
    try {
        CBDescIn descIn = new CBDescIn(50000, 50000, 1208);
        ROpropertyDouble.new_subscription_Alarm(null, descIn);
        fail("NO_IMPLEMENT exception expected");
    } catch (NO_IMPLEMENT ex) {
    // OK
    }
}
Also used : NO_IMPLEMENT(org.omg.CORBA.NO_IMPLEMENT) CBDescIn(alma.ACS.CBDescIn)

Example 12 with NO_IMPLEMENT

use of org.omg.CORBA.NO_IMPLEMENT in project ACS by ACS-Community.

the class PropertyDoubleTest method testCreatePostponedMonitor.

public void testCreatePostponedMonitor() {
    // TODO tmp
    if (true)
        return;
    try {
        CBDescIn descIn = new CBDescIn(50000, 50000, 1208);
        ROproperty.create_postponed_monitor(0, null, descIn);
        fail("NO_IMPLEMENT exception expected");
    } catch (NO_IMPLEMENT ex) {
    // OK
    }
}
Also used : NO_IMPLEMENT(org.omg.CORBA.NO_IMPLEMENT) CBDescIn(alma.ACS.CBDescIn)

Example 13 with NO_IMPLEMENT

use of org.omg.CORBA.NO_IMPLEMENT in project cxf by apache.

the class CorbaObjectReader method readFixed.

public void readFixed(CorbaFixedHandler fixedHandler) throws CorbaBindingException {
    long scale = fixedHandler.getScale();
    try {
        java.math.BigDecimal fixedValue = stream.read_fixed().movePointLeft((int) scale);
        fixedHandler.setValue(fixedValue);
    } catch (NO_IMPLEMENT ex) {
        // the read_fixed method is a "late addition" and not all orbs implement it.
        // Some of them have a "read_fixed(TypeCode)" method, we'll try that
        Method m = null;
        try {
            m = stream.getClass().getMethod("read_fixed", new Class[] { TypeCode.class });
            BigDecimal fixedValue = (BigDecimal) m.invoke(stream, new Object[] { fixedHandler.getTypeCode() });
            fixedHandler.setValue(fixedValue);
        } catch (Throwable e1) {
            throw ex;
        }
    }
}
Also used : NO_IMPLEMENT(org.omg.CORBA.NO_IMPLEMENT) BigDecimal(java.math.BigDecimal) Method(java.lang.reflect.Method) BigDecimal(java.math.BigDecimal)

Example 14 with NO_IMPLEMENT

use of org.omg.CORBA.NO_IMPLEMENT in project narayana by jbosstm.

the class JacOrbRCManager method makeRC.

/**
 * We create a RecoveryCoordinator reference, but without (we think)
 * actually making the implementation object available to the orb.
 * The data needed to construct the RecoveryCoordinator is put in
 * the ObjectId. If a replay_completion is received, it will be sent,
 * via the locationd daemon, to the RecoveryManager.
 */
public RecoveryCoordinator makeRC(Uid RCUid, Uid tranUid, Uid processUid, boolean isServerTransaction) {
    initialise();
    RecoveryCoordinator rc = null;
    try {
        String rcObjectId = GenericRecoveryCoordinator.makeId(RCUid, tranUid, processUid, isServerTransaction);
        if (ref_ReCoo != null) {
            // New for IOR template
            String new_ior = RecoverIOR.newObjectKey(ref_ReCoo, rcObjectId);
            org.omg.CORBA.Object rcAsObject = ORBManager.getORB().orb().string_to_object(new_ior);
            // End for IOR Template
            rc = RecoveryCoordinatorHelper.narrow(rcAsObject);
            if (jtsLogger.logger.isDebugEnabled()) {
                jtsLogger.logger.debug("JacOrbRCManager: Created reference for tran " + tranUid + " = " + rc);
            }
        } else {
            if (JacOrbRCManager._runWithoutDaemon)
                throw new NO_IMPLEMENT();
            else {
                jtsLogger.i18NLogger.warn_orbspecific_jacorb_recoverycoordinators_JacOrbRCManager_3();
                rc = null;
            }
        }
    } catch (Exception ex) {
        jtsLogger.i18NLogger.warn_orbspecific_jacorb_recoverycoordinators_JacOrbRCManager_2(ex);
    }
    return rc;
}
Also used : NO_IMPLEMENT(org.omg.CORBA.NO_IMPLEMENT) RecoveryCoordinator(org.omg.CosTransactions.RecoveryCoordinator) GenericRecoveryCoordinator(com.arjuna.ats.internal.jts.orbspecific.recovery.recoverycoordinators.GenericRecoveryCoordinator) SystemException(org.omg.CORBA.SystemException)

Example 15 with NO_IMPLEMENT

use of org.omg.CORBA.NO_IMPLEMENT in project narayana by jbosstm.

the class StatusChecker method getStatus.

/**
 *  try to get the status from a factory and convert to our way.
 *  factory must not be null
 *  itemUid is the store id as in _itemFromUid
 */
private Status getStatus(Uid transactionUid, FactoryContactItem item, boolean checkTheObjectStore) throws Inactive {
    if (jtsLogger.logger.isDebugEnabled()) {
        jtsLogger.logger.debug("StatusChecker.getStatus(" + transactionUid + ", " + item + ", " + checkTheObjectStore + ")");
    }
    ArjunaFactory factory = item.getFactory();
    if (factory != null) {
        Status otsStatus = Status.StatusUnknown;
        boolean originalDead = false;
        try {
            otid_t otid = Utility.uidToOtid(transactionUid);
            otsStatus = factory.getCurrentStatus(otid);
            if (jtsLogger.logger.isDebugEnabled()) {
                jtsLogger.logger.debug("StatusChecker.getStatus(" + transactionUid + ") - current status = " + Utility.stringStatus(otsStatus));
            }
            if (otsStatus == Status.StatusNoTransaction) {
                otsStatus = factory.getStatus(otid);
                if (jtsLogger.logger.isDebugEnabled()) {
                    jtsLogger.logger.debug("StatusChecker.getStatus(" + transactionUid + ") - stored status = " + Utility.stringStatus(otsStatus));
                }
                switch(otsStatus.value()) {
                    case Status._StatusNoTransaction:
                        // return Status.StatusRolledBack;
                        return otsStatus;
                    case Status._StatusUnknown:
                        return otsStatus;
                    default:
                        {
                            /*
                * We got an answer! This probably means that the
                * factory has just finished with the transaction, but
                * the state hasn't been removed by the file system yet
                * - we don't sync the removal to improve performance.
                */
                            jtsLogger.i18NLogger.warn_recovery_contact_StatusChecker_3(transactionUid);
                            otsStatus = Status.StatusUnknown;
                        }
                        break;
                }
            }
            if (jtsLogger.logger.isDebugEnabled()) {
                jtsLogger.logger.debug("StatusChecker.getStatus(" + transactionUid + ") - Status = " + Utility.stringStatus(otsStatus));
            }
            item.markAsAlive();
        } catch (NO_IMPLEMENT ex_noimp) {
            if (jtsLogger.logger.isDebugEnabled()) {
                jtsLogger.logger.debug("StatusChecker.getStatus(" + transactionUid + ") - NO_IMPLEMENT = dead");
            }
            originalDead = true;
        // orbix seems to count unreachable as transient. Over infinite time, all
        // addresses are valid
        } catch (TRANSIENT ex_trans) {
            if (ORBInfo.getOrbEnumValue() == ORBType.JACORB) {
                // the original application has (probably) died
                if (jtsLogger.logger.isDebugEnabled()) {
                    jtsLogger.logger.debug("StatusChecker.getStatus(" + transactionUid + ") - TRANSIENT = dead");
                }
                originalDead = true;
            }
        } catch (COMM_FAILURE ex_comm) {
            if (ORBInfo.getOrbEnumValue() == ORBType.JAVAIDL) {
                // the original application has (probably) died
                if (jtsLogger.logger.isDebugEnabled()) {
                    jtsLogger.logger.debug("StatusChecker.getStatus(" + transactionUid + ") - COMM_FAILURE = dead");
                }
                originalDead = true;
            } else /*
	     * Probably the original application has died, but only just - do
	     * not mark either way.
	     */
            if (jtsLogger.logger.isDebugEnabled()) {
                jtsLogger.logger.debug("StatusChecker.getStatus(" + transactionUid + ") - COMM_FAILURE = live");
            }
        } catch (OBJECT_NOT_EXIST ex_noobj) {
            // the original process must have gone away, and another one
            // come up in the same place
            // (or, just possibly, the original closed the ots)
            originalDead = true;
            if (jtsLogger.logger.isDebugEnabled()) {
                jtsLogger.logger.debug("StatusChecker.getStatus(" + transactionUid + ") - OBJECT_NOT_EXIST = dead");
            }
        } catch (BAD_PARAM ex_badparam) {
            jtsLogger.i18NLogger.warn_recovery_contact_StatusChecker_9();
        // the transactionUid is invalid !
        } catch (NoTransaction ex_notran) {
            jtsLogger.i18NLogger.warn_recovery_contact_StatusChecker_10();
        // the transactionUid is invalid !
        // no transaction
        } catch (SystemException ex_corba) {
            // why did this happen ?
            if (ORBInfo.getOrbEnumValue() == ORBType.JAVAIDL) {
                // the original application has (probably) died
                if (jtsLogger.logger.isDebugEnabled()) {
                    jtsLogger.logger.debug("StatusChecker.getStatus(" + transactionUid + ") - COMM_FAILURE = dead");
                }
                originalDead = true;
            }
            jtsLogger.i18NLogger.warn_recovery_contact_StatusChecker_11(ex_corba);
        } catch (Exception ex_other) {
            // this really shouldn't happen
            jtsLogger.i18NLogger.warn_recovery_contact_StatusChecker_12(ex_other);
        }
        if (originalDead) {
            item.markAsDead();
            throw new Inactive();
        } else {
            return otsStatus;
        }
    } else {
        // factory in item is null - process already dead
        if (jtsLogger.logger.isDebugEnabled()) {
            jtsLogger.logger.debug("StatusChecker.getStatus(" + transactionUid + ") -  no factory, process previously dead");
        }
        if (checkTheObjectStore) {
            try {
                Status s = OTSManager.factory().getStatus(transactionUid);
                if (s == Status.StatusCommitting)
                    return Status.StatusCommitted;
                else {
                    if (s == Status.StatusRollingBack)
                        return Status.StatusRolledBack;
                }
                return s;
            } catch (NoTransaction e1) {
                return Status.StatusNoTransaction;
            } catch (SystemException e2) {
                return Status.StatusUnknown;
            }
        } else {
            throw new Inactive();
        }
    }
}
Also used : Status(org.omg.CosTransactions.Status) NO_IMPLEMENT(org.omg.CORBA.NO_IMPLEMENT) NoTransaction(org.omg.CosTransactions.NoTransaction) COMM_FAILURE(org.omg.CORBA.COMM_FAILURE) CosTransactions.otid_t(org.omg.CosTransactions.otid_t) BAD_PARAM(org.omg.CORBA.BAD_PARAM) SystemException(org.omg.CORBA.SystemException) OBJECT_NOT_EXIST(org.omg.CORBA.OBJECT_NOT_EXIST) SystemException(org.omg.CORBA.SystemException) Inactive(org.omg.CosTransactions.Inactive) ArjunaFactory(com.arjuna.ArjunaOTS.ArjunaFactory) TRANSIENT(org.omg.CORBA.TRANSIENT)

Aggregations

NO_IMPLEMENT (org.omg.CORBA.NO_IMPLEMENT)17 CBDescIn (alma.ACS.CBDescIn)6 SystemException (org.omg.CORBA.SystemException)5 RecoveryCoordinator (org.omg.CosTransactions.RecoveryCoordinator)4 GenericRecoveryCoordinator (com.arjuna.ats.internal.jts.orbspecific.recovery.recoverycoordinators.GenericRecoveryCoordinator)3 ComponentLifecycleException (alma.acs.component.ComponentLifecycleException)2 EventDescription (alma.acsnc.EventDescription)2 ArrayList (java.util.ArrayList)2 BAD_OPERATION (org.omg.CORBA.BAD_OPERATION)2 BAD_PARAM (org.omg.CORBA.BAD_PARAM)2 Inactive (org.omg.CosTransactions.Inactive)2 NoSuchCharacteristic (alma.ACS.NoSuchCharacteristic)1 PropertySetImpl (alma.ACS.jbaci.PropertySetImpl)1 CDBFieldDoesNotExistEx (alma.cdbErrType.CDBFieldDoesNotExistEx)1 WrongCDBDataTypeEx (alma.cdbErrType.WrongCDBDataTypeEx)1 ArjunaFactory (com.arjuna.ArjunaOTS.ArjunaFactory)1 OTSAbstractRecord (com.arjuna.ArjunaOTS.OTSAbstractRecord)1 UidCoordinator (com.arjuna.ArjunaOTS.UidCoordinator)1 Uid (com.arjuna.ats.arjuna.common.Uid)1 AbstractRecord (com.arjuna.ats.arjuna.coordinator.AbstractRecord)1