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();
}
}
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();
}
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);
}
}
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();
}
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();
}
Aggregations