Search in sources :

Example 6 with NoSuchCharacteristic

use of alma.ACS.NoSuchCharacteristic in project ACS by ACS-Community.

the class RWpatternImpl method whenSet.

/**
	 * @see alma.ACS.PpatternOperations#whenSet()
	 */
public Condition[] whenSet() {
    try {
        int[] values = characteristicModelImpl.getIntegerSeq("whenSet");
        Condition[] conditions = new Condition[values.length];
        for (int i = 0; i < conditions.length; i++) conditions[i] = Condition.from_int(values[i]);
        return conditions;
    } catch (NoSuchCharacteristic ncs) {
        throw new NO_RESOURCES();
    }
}
Also used : Condition(alma.ACS.Condition) NoSuchCharacteristic(alma.ACS.NoSuchCharacteristic) NO_RESOURCES(org.omg.CORBA.NO_RESOURCES)

Example 7 with NoSuchCharacteristic

use of alma.ACS.NoSuchCharacteristic in project ACS by ACS-Community.

the class CharacteristicComponentImpl method get_characteristic_by_name.

/*********************** [ CharacteristicModel ] ***********************/
/**
	 * @see alma.ACS.CharacteristicModelOperations#get_characteristic_by_name(java.lang.String)
	 */
public Any get_characteristic_by_name(String name) throws NoSuchCharacteristic {
    //for create the Any
    characteristicModelImpl.lendContainerServices(m_containerServices);
    Any ret = characteristicModelImpl.get_characteristic_by_name(name);
    if (ret != null)
        return characteristicModelImpl.get_characteristic_by_name(name);
    else
        throw new NoSuchCharacteristic();
}
Also used : NoSuchCharacteristic(alma.ACS.NoSuchCharacteristic) Any(org.omg.CORBA.Any)

Example 8 with NoSuchCharacteristic

use of alma.ACS.NoSuchCharacteristic in project ACS by ACS-Community.

the class CharacteristicModelImpl method getFloatSeq.

/**
	 * Read sequence double characteristic.
	 * @param name	characteristic name.
	 * @throws NoSuchCharacteristic is thrown if characterstic does not exist.
	 */
public float[] getFloatSeq(String name) throws NoSuchCharacteristic {
    try {
        double[] temp = dao.get_double_seq(prefix + name);
        float[] ret = new float[temp.length];
        for (int i = 0; i < temp.length; i++) {
            ret[i] = (float) temp[i];
        }
        return ret;
    } catch (Throwable th) {
        throw new NoSuchCharacteristic(name, modelName);
    }
}
Also used : NoSuchCharacteristic(alma.ACS.NoSuchCharacteristic)

Example 9 with NoSuchCharacteristic

use of alma.ACS.NoSuchCharacteristic in project ACS by ACS-Community.

the class CharacteristicModelImpl method get_characteristic_by_name.

/*********************** [ CharacteristicModel ] ***********************/
/**
	 * @see alma.ACS.CharacteristicModelOperations#get_characteristic_by_name(java.lang.String)
	 */
public Any get_characteristic_by_name(String name) throws NoSuchCharacteristic {
    try {
        String strVal = new String();
        if (prefix == "")
            strVal = dao.get_string(name);
        else
            strVal = dao.get_string(prefix + name);
        //I needed the getAny() to create a new Any, since a constructor for
        // Any (i.e: new Any() ), doesn't exist
        Any value_p = m_container.getAdvancedContainerServices().getAny();
        value_p.insert_string(strVal);
        return value_p;
    } catch (CDBFieldDoesNotExistEx fde) {
        NoSuchCharacteristic nsc = new NoSuchCharacteristic();
        nsc.characteristic_name = name;
        nsc.component_name = modelName;
        throw nsc;
    } catch (SystemException se) {
        throw se;
    } catch (WrongCDBDataTypeEx wct) {
    }
    throw new NoSuchCharacteristic();
}
Also used : SystemException(org.omg.CORBA.SystemException) CDBFieldDoesNotExistEx(alma.cdbErrType.CDBFieldDoesNotExistEx) NoSuchCharacteristic(alma.ACS.NoSuchCharacteristic) Any(org.omg.CORBA.Any) WrongCDBDataTypeEx(alma.cdbErrType.WrongCDBDataTypeEx)

Example 10 with NoSuchCharacteristic

use of alma.ACS.NoSuchCharacteristic in project ACS by ACS-Community.

the class CharacteristicModelImpl method get_all_characteristics.

/**
	 * @see alma.ACS.CharacteristicModelOperations#get_all_characteristics()
	 */
public PropertySet get_all_characteristics() {
    String[] allSeq;
    try {
        if (prefix == "")
            allSeq = dao.get_string_seq("");
        else
            allSeq = dao.get_string_seq(prefix);
        Property[] p = new Property[allSeq.length];
        for (int i = 0; i < allSeq.length; i++) {
            Any a = get_characteristic_by_name(allSeq[i]);
            p[i] = new Property(allSeq[i], a);
        }
        //dangerous methods!! 
        ORB orb = m_container.getAdvancedContainerServices().getORB();
        POA rootpoa = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
        rootpoa.the_POAManager().activate();
        PropertySetImpl psetImpl = new PropertySetImpl(p);
        PropertySetPOATie psetTie = new PropertySetPOATie(psetImpl, rootpoa);
        return psetTie._this(orb);
    } catch (CDBFieldDoesNotExistEx e) {
    } catch (WrongCDBDataTypeEx e) {
    } catch (NoSuchCharacteristic e) {
    } catch (MultipleExceptions e) {
    } catch (InvalidName e) {
    } catch (AdapterInactive e) {
    } catch (NullPointerException e) {
        System.out.println(e);
    }
    throw new NO_IMPLEMENT();
}
Also used : NO_IMPLEMENT(org.omg.CORBA.NO_IMPLEMENT) POA(org.omg.PortableServer.POA) NoSuchCharacteristic(alma.ACS.NoSuchCharacteristic) AdapterInactive(org.omg.PortableServer.POAManagerPackage.AdapterInactive) Any(org.omg.CORBA.Any) PropertySetImpl(alma.ACS.jbaci.PropertySetImpl) PropertySetPOATie(org.omg.CosPropertyService.PropertySetPOATie) InvalidName(org.omg.CORBA.ORBPackage.InvalidName) CDBFieldDoesNotExistEx(alma.cdbErrType.CDBFieldDoesNotExistEx) MultipleExceptions(org.omg.CosPropertyService.MultipleExceptions) Property(org.omg.CosPropertyService.Property) ORB(org.omg.CORBA.ORB) WrongCDBDataTypeEx(alma.cdbErrType.WrongCDBDataTypeEx)

Aggregations

NoSuchCharacteristic (alma.ACS.NoSuchCharacteristic)10 NO_RESOURCES (org.omg.CORBA.NO_RESOURCES)6 Condition (alma.ACS.Condition)5 Any (org.omg.CORBA.Any)3 CDBFieldDoesNotExistEx (alma.cdbErrType.CDBFieldDoesNotExistEx)2 WrongCDBDataTypeEx (alma.cdbErrType.WrongCDBDataTypeEx)2 PropertySetImpl (alma.ACS.jbaci.PropertySetImpl)1 NO_IMPLEMENT (org.omg.CORBA.NO_IMPLEMENT)1 ORB (org.omg.CORBA.ORB)1 InvalidName (org.omg.CORBA.ORBPackage.InvalidName)1 SystemException (org.omg.CORBA.SystemException)1 MultipleExceptions (org.omg.CosPropertyService.MultipleExceptions)1 Property (org.omg.CosPropertyService.Property)1 PropertySetPOATie (org.omg.CosPropertyService.PropertySetPOATie)1 POA (org.omg.PortableServer.POA)1 AdapterInactive (org.omg.PortableServer.POAManagerPackage.AdapterInactive)1