Search in sources :

Example 56 with Any

use of org.omg.CORBA.Any in project wildfly by wildfly.

the class ValueMemberDefImpl method describe.

public Description describe() {
    String defined_in_id = "IR";
    if (defined_in instanceof ContainedOperations)
        defined_in_id = ((ContainedOperations) defined_in).id();
    ValueMember d = new ValueMember(name, id, defined_in_id, version, typeCode, type_def(), access());
    Any any = getORB().create_any();
    ValueMemberHelper.insert(any, d);
    return new Description(DefinitionKind.dk_ValueMember, any);
}
Also used : Description(org.omg.CORBA.ContainedPackage.Description) ValueMember(org.omg.CORBA.ValueMember) ContainedOperations(org.omg.CORBA.ContainedOperations) Any(org.omg.CORBA.Any)

Example 57 with Any

use of org.omg.CORBA.Any in project wildfly by wildfly.

the class InterfaceRepository method addConstants.

/**
     * Add a set of constants to a container (interface or value class).
     */
private void addConstants(LocalContainer container, ContainerAnalysis ca) throws RMIIIOPViolationException, IRConstructionException {
    ConstantAnalysis[] consts = ca.getConstants();
    for (int i = 0; i < consts.length; ++i) {
        ConstantDefImpl cDef;
        String cid = ca.getMemberRepositoryId(consts[i].getJavaName());
        String cName = consts[i].getIDLName();
        Class cls = consts[i].getType();
        TypeCode typeCode = getConstantTypeCode(cls);
        Any value = orb.create_any();
        consts[i].insertValue(value);
        cDef = new ConstantDefImpl(cid, cName, "1.0", typeCode, value, container, impl);
        container.add(cName, cDef);
    }
}
Also used : TypeCode(org.omg.CORBA.TypeCode) ConstantAnalysis(org.wildfly.iiop.openjdk.rmi.ConstantAnalysis) Any(org.omg.CORBA.Any)

Example 58 with Any

use of org.omg.CORBA.Any in project wildfly by wildfly.

the class ModuleDefImpl method describe.

// ContainedImpl implementation ----------------------------------
public Description describe() {
    String defined_in_id = "IR";
    if (defined_in instanceof ContainedOperations)
        defined_in_id = ((ContainedOperations) defined_in).id();
    ModuleDescription md = new ModuleDescription(name, id, defined_in_id, version);
    Any any = getORB().create_any();
    ModuleDescriptionHelper.insert(any, md);
    return new Description(DefinitionKind.dk_Module, any);
}
Also used : Description(org.omg.CORBA.ContainedPackage.Description) ModuleDescription(org.omg.CORBA.ModuleDescription) ModuleDescription(org.omg.CORBA.ModuleDescription) ContainedOperations(org.omg.CORBA.ContainedOperations) Any(org.omg.CORBA.Any)

Example 59 with Any

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

the class AnyAideTest method testComplexObjectToCorbaAny.

public void testComplexObjectToCorbaAny() {
    NestedEvent neVal = new NestedEvent();
    neVal.sampVal = advancedCS.getAny();
    neVal.sampVal.insert_long(15);
    Any anyNe = null;
    try {
        anyNe = anyAide.complexObjectToCorbaAny(neVal);
    } catch (AcsJException ex) {
    }
    assertNotNull(anyNe);
    NestedEvent neVal2 = NestedEventHelper.extract(anyNe);
    assertEquals(neVal.sampVal.extract_long(), neVal2.sampVal.extract_long());
    try {
        anyAide.complexObjectToCorbaAny(null);
        fail();
    } catch (AcsJException ex) {
    }
}
Also used : AcsJException(alma.acs.exceptions.AcsJException) NotNestedEvent(alma.ADMINTEST1.NotNestedEvent) NestedEvent(alma.ADMINTEST1.InterfaceForNestedEventDefinitionPackage.NestedEvent) Any(org.omg.CORBA.Any)

Example 60 with Any

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

the class AnyAideTest method testObjectToCorbaAny.

public void testObjectToCorbaAny() {
    final String strVal = "str";
    final Long lVal = 13L;
    final Double dVal = 13.7;
    final Float fVal = 13.3f;
    final Integer iVal = 11;
    final int[] intArr = new int[] { 1, 2, 3, 4 };
    final NestedEvent neVal = new NestedEvent();
    neVal.sampVal = advancedCS.getAny();
    neVal.sampVal.insert_long(15);
    Any anyNull = null, anyString = null, anyLong = null, anyDouble = null, anyFloat = null, anyInt = null;
    Any anyNe = null, anyIntArr = null;
    try {
        anyNull = anyAide.objectToCorbaAny(null);
        anyString = anyAide.objectToCorbaAny(strVal);
        anyLong = anyAide.objectToCorbaAny(lVal);
        anyDouble = anyAide.objectToCorbaAny(dVal);
        anyFloat = anyAide.objectToCorbaAny(fVal);
        anyInt = anyAide.objectToCorbaAny(iVal);
        anyNe = anyAide.objectToCorbaAny(neVal);
        anyIntArr = anyAide.objectToCorbaAny(intArr);
    } catch (AcsJException ex) {
    }
    assertNotNull(anyNull);
    assertNotNull(anyString);
    assertNotNull(anyLong);
    assertNotNull(anyDouble);
    assertNotNull(anyFloat);
    assertNotNull(anyInt);
    assertNotNull(anyNe);
    assertNotNull(anyIntArr);
    assertNull(anyNull.extract_Object());
    assertEquals(lVal.longValue(), anyLong.extract_longlong());
    assertEquals(dVal.doubleValue(), anyDouble.extract_double());
    assertEquals(fVal.floatValue(), anyFloat.extract_float());
    assertEquals(iVal.intValue(), anyInt.extract_long());
    assertEquals(strVal, anyString.extract_string());
    NestedEvent neVal2 = NestedEventHelper.extract(anyNe);
    assertEquals(neVal.sampVal.extract_long(), neVal2.sampVal.extract_long());
    int[] intArr2 = longSeqHelper.extract(anyIntArr);
    assertEquals(intArr.length, intArr2.length);
    for (int i = 0; i < intArr2.length; ++i) {
        assertEquals(intArr[i], intArr2[i]);
    }
    try {
        Any anyVector = anyAide.objectToCorbaAny(new Vector());
        fail();
    } catch (AcsJException ex) {
    }
}
Also used : AcsJException(alma.acs.exceptions.AcsJException) NotNestedEvent(alma.ADMINTEST1.NotNestedEvent) NestedEvent(alma.ADMINTEST1.InterfaceForNestedEventDefinitionPackage.NestedEvent) Any(org.omg.CORBA.Any) Vector(java.util.Vector)

Aggregations

Any (org.omg.CORBA.Any)107 MonitorBlob (alma.TMCDB.MonitorBlob)20 MonitorDataBlock (alma.TMCDB.MonitorDataBlock)20 ComponentData (alma.acs.monitoring.DAO.ComponentData)15 ServiceContext (org.omg.IOP.ServiceContext)13 BAD_PARAM (org.omg.CORBA.BAD_PARAM)10 SASContextBody (org.omg.CSI.SASContextBody)10 AcsJException (alma.acs.exceptions.AcsJException)9 Test (org.junit.Test)9 Description (org.omg.CORBA.ContainedPackage.Description)9 FormatMismatch (org.omg.IOP.CodecPackage.FormatMismatch)8 TypeMismatch (org.omg.IOP.CodecPackage.TypeMismatch)8 ContainedOperations (org.omg.CORBA.ContainedOperations)7 NVList (org.omg.CORBA.NVList)7 InvalidTypeForEncoding (org.omg.IOP.CodecPackage.InvalidTypeForEncoding)7 TMCDB.doubleBlobData (alma.TMCDB.doubleBlobData)6 TMCDB.doubleSeqBlobData (alma.TMCDB.doubleSeqBlobData)6 TMCDB.floatBlobData (alma.TMCDB.floatBlobData)6 MonitorPointTimeSeries (alma.acs.monitoring.MonitorPointTimeSeries)6 MonitorPointValue (alma.acs.monitoring.MonitorPointValue)6