Java Code Examples for org.omg.CORBA.TCKind._tk_value

The following are Jave code examples for showing how to use _tk_value of the org.omg.CORBA.TCKind class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: openjdk-jdk10   File: TypeCodeImpl.java   View Source Code Vote up 6 votes
public TypeCode member_type(int index)
    throws BadKind, org.omg.CORBA.TypeCodePackage.Bounds
{
    switch (_kind) {
    case tk_indirect:
        return indirectType().member_type(index);
    case TCKind._tk_except:
    case TCKind._tk_struct:
    case TCKind._tk_union:
    case TCKind._tk_value:
        try {
            return _memberTypes[index];
        } catch (ArrayIndexOutOfBoundsException e) {
            throw new org.omg.CORBA.TypeCodePackage.Bounds();
        }
    default:
        throw new BadKind();
    }
}
 
Example 2
Project: OpenJSharp   File: TypeCodeImpl.java   View Source Code Vote up 6 votes
public String id()
    throws BadKind
{
    switch (_kind) {
    case tk_indirect:
        //return indirectType().id(); // same as _id
    case TCKind._tk_except:
    case TCKind._tk_objref:
    case TCKind._tk_struct:
    case TCKind._tk_union:
    case TCKind._tk_enum:
    case TCKind._tk_alias:
    case TCKind._tk_value:
    case TCKind._tk_value_box:
    case TCKind._tk_native:
    case TCKind._tk_abstract_interface:
        // exception and objref typecodes must have a repository id.
        // structs, unions, enums, and aliases may or may not.
        return _id;
    default:
        // all other typecodes throw the BadKind exception.
        throw new BadKind();
    }
}
 
Example 3
Project: openjdk-jdk10   File: ValueUtility.java   View Source Code Vote up 6 votes
public static String getSignature(ValueMember member)
    throws ClassNotFoundException {

    // REVISIT.  Can the type be something that is
    // non-primitive yet not a value_box, value, or objref?
    // If so, should use ObjectStreamClass or throw
    // exception.

    if (member.type.kind().value() == TCKind._tk_value_box ||
        member.type.kind().value() == TCKind._tk_value ||
        member.type.kind().value() == TCKind._tk_objref) {
        Class c = RepositoryId.cache.getId(member.id).getClassFromType();
        return ObjectStreamClass.getSignature(c);

    } else {

        return primitiveConstants[member.type.kind().value()];
    }

}
 
Example 4
Project: OpenJSharp   File: TypeCodeImpl.java   View Source Code Vote up 6 votes
public int member_count()
    throws BadKind
{
    switch (_kind) {
    case tk_indirect:
        return indirectType().member_count();
    case TCKind._tk_except:
    case TCKind._tk_struct:
    case TCKind._tk_union:
    case TCKind._tk_enum:
    case TCKind._tk_value:
        return _memberCount;
    default:
        throw new BadKind();
    }
}
 
Example 5
Project: openjdk-jdk10   File: TypeCodeImpl.java   View Source Code Vote up 6 votes
public int member_count()
    throws BadKind
{
    switch (_kind) {
    case tk_indirect:
        return indirectType().member_count();
    case TCKind._tk_except:
    case TCKind._tk_struct:
    case TCKind._tk_union:
    case TCKind._tk_enum:
    case TCKind._tk_value:
        return _memberCount;
    default:
        throw new BadKind();
    }
}
 
Example 6
Project: OpenJSharp   File: ValueUtility.java   View Source Code Vote up 6 votes
public static String getSignature(ValueMember member)
    throws ClassNotFoundException {

    // REVISIT.  Can the type be something that is
    // non-primitive yet not a value_box, value, or objref?
    // If so, should use ObjectStreamClass or throw
    // exception.

    if (member.type.kind().value() == TCKind._tk_value_box ||
        member.type.kind().value() == TCKind._tk_value ||
        member.type.kind().value() == TCKind._tk_objref) {
        Class c = RepositoryId.cache.getId(member.id).getClassFromType();
        return ObjectStreamClass.getSignature(c);

    } else {

        return primitiveConstants[member.type.kind().value()];
    }

}
 
Example 7
Project: OpenJSharp   File: CDRInputStream_1_0.java   View Source Code Vote up 6 votes
public Any read_any() {
    Any any = orb.create_any();
    TypeCodeImpl tc = new TypeCodeImpl(orb);

    // read off the typecode

    // REVISIT We could avoid this try-catch if we could peek the typecode
    // kind off this stream and see if it is a tk_value.  Looking at the
    // code we know that for tk_value the Any.read_value() below
    // ignores the tc argument anyway (except for the kind field).
    // But still we would need to make sure that the whole typecode,
    // including encapsulations, is read off.
    try {
        tc.read_value(parent);
    } catch (MARSHAL ex) {
        if (tc.kind().value() != TCKind._tk_value)
            throw ex;
        // We can be sure that the whole typecode encapsulation has been
        // read off.
        dprintThrowable(ex);
    }
    // read off the value of the any
    any.read_value(parent, tc);

    return any;
}
 
Example 8
Project: openjdk-jdk10   File: TypeCodeImpl.java   View Source Code Vote up 6 votes
public String name()
    throws BadKind
{
    switch (_kind) {
    case tk_indirect:
        return indirectType().name();
    case TCKind._tk_except:
    case TCKind._tk_objref:
    case TCKind._tk_struct:
    case TCKind._tk_union:
    case TCKind._tk_enum:
    case TCKind._tk_alias:
    case TCKind._tk_value:
    case TCKind._tk_value_box:
    case TCKind._tk_native:
    case TCKind._tk_abstract_interface:
        return _name;
    default:
        throw new BadKind();
    }
}
 
Example 9
Project: openjdk-jdk10   File: DynAnyBasicImpl.java   View Source Code Vote up 5 votes
public java.io.Serializable get_val()
    throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
           org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
    if (status == STATUS_DESTROYED) {
        throw wrapper.dynAnyDestroyed() ;
    }
    int kind = any.type().kind().value();
    if (kind != TCKind._tk_value && kind != TCKind._tk_value_box)
        throw new TypeMismatch();
    return any.extract_Value();
}
 
Example 10
Project: openjdk-jdk10   File: DynAnyUtil.java   View Source Code Vote up 5 votes
static DynAny createMostDerivedDynAny(Any any, ORB orb, boolean copyValue)
    throws org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode
{
    if (any == null || ! DynAnyUtil.isConsistentType(any.type()))
        throw new org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode();

    switch (any.type().kind().value()) {
        case TCKind._tk_sequence:
            return new DynSequenceImpl(orb, any, copyValue);
        case TCKind._tk_struct:
            return new DynStructImpl(orb, any, copyValue);
        case TCKind._tk_array:
            return new DynArrayImpl(orb, any, copyValue);
        case TCKind._tk_union:
            return new DynUnionImpl(orb, any, copyValue);
        case TCKind._tk_enum:
            return new DynEnumImpl(orb, any, copyValue);
        case TCKind._tk_fixed:
            return new DynFixedImpl(orb, any, copyValue);
        case TCKind._tk_value:
            return new DynValueImpl(orb, any, copyValue);
        case TCKind._tk_value_box:
            return new DynValueBoxImpl(orb, any, copyValue);
        default:
            return new DynAnyBasicImpl(orb, any, copyValue);
    }
}
 
Example 11
Project: openjdk-jdk10   File: TypeCodeImpl.java   View Source Code Vote up 5 votes
public TypeCode concrete_base_type() throws BadKind {
    switch (_kind) {
    case tk_indirect:
        return indirectType().concrete_base_type();
    case TCKind._tk_value:
        return _concrete_base;
    default:
        throw new BadKind();
    }
}
 
Example 12
Project: OpenJSharp   File: TypeCodeImpl.java   View Source Code Vote up 5 votes
public short member_visibility(int index) throws BadKind,
    org.omg.CORBA.TypeCodePackage.Bounds {
    switch (_kind) {
    case tk_indirect:
        return indirectType().member_visibility(index);
    case TCKind._tk_value:
        try {
            return _memberAccess[index];
        } catch (ArrayIndexOutOfBoundsException e) {
            throw new org.omg.CORBA.TypeCodePackage.Bounds();
        }
    default:
        throw new BadKind();
    }
}
 
Example 13
Project: openjdk-jdk10   File: ORBImpl.java   View Source Code Vote up 5 votes
public synchronized org.omg.CORBA.TypeCode create_value_tc(String id,
                                              String name,
                                              short type_modifier,
                                              TypeCode concrete_base,
                                              ValueMember[] members)
{
    checkShutdownState();
    return new TypeCodeImpl(this, TCKind._tk_value, id, name,
                            type_modifier, concrete_base, members);
}
 
Example 14
Project: openjdk-jdk10   File: TypeCodeImpl.java   View Source Code Vote up 5 votes
public short member_visibility(int index) throws BadKind,
    org.omg.CORBA.TypeCodePackage.Bounds {
    switch (_kind) {
    case tk_indirect:
        return indirectType().member_visibility(index);
    case TCKind._tk_value:
        try {
            return _memberAccess[index];
        } catch (ArrayIndexOutOfBoundsException e) {
            throw new org.omg.CORBA.TypeCodePackage.Bounds();
        }
    default:
        throw new BadKind();
    }
}
 
Example 15
Project: OpenJSharp   File: DynAnyUtil.java   View Source Code Vote up 5 votes
static DynAny createMostDerivedDynAny(TypeCode typeCode, ORB orb)
    throws org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode
{
    if (typeCode == null || ! DynAnyUtil.isConsistentType(typeCode))
        throw new org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode();

    switch (typeCode.kind().value()) {
        case TCKind._tk_sequence:
            return new DynSequenceImpl(orb, typeCode);
        case TCKind._tk_struct:
            return new DynStructImpl(orb, typeCode);
        case TCKind._tk_array:
            return new DynArrayImpl(orb, typeCode);
        case TCKind._tk_union:
            return new DynUnionImpl(orb, typeCode);
        case TCKind._tk_enum:
            return new DynEnumImpl(orb, typeCode);
        case TCKind._tk_fixed:
            return new DynFixedImpl(orb, typeCode);
        case TCKind._tk_value:
            return new DynValueImpl(orb, typeCode);
        case TCKind._tk_value_box:
            return new DynValueBoxImpl(orb, typeCode);
        default:
            return new DynAnyBasicImpl(orb, typeCode);
    }
}
 
Example 16
Project: OpenJSharp   File: DynAnyBasicImpl.java   View Source Code Vote up 5 votes
public void insert_val(java.io.Serializable value)
    throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
           org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
    if (status == STATUS_DESTROYED) {
        throw wrapper.dynAnyDestroyed() ;
    }
    int kind = any.type().kind().value();
    if (kind != TCKind._tk_value && kind != TCKind._tk_value_box)
        throw new TypeMismatch();
    any.insert_Value(value);
}
 
Example 17
Project: openjdk-jdk10   File: DynAnyUtil.java   View Source Code Vote up 5 votes
static boolean isConstructedDynAny(DynAny dynAny) {
    // DynFixed is constructed but not a subclass of DynAnyConstructedImpl
    //return (dynAny instanceof DynAnyConstructedImpl);
    int kind = dynAny.type().kind().value();
    return (kind == TCKind._tk_sequence ||
            kind == TCKind._tk_struct ||
            kind == TCKind._tk_array ||
            kind == TCKind._tk_union ||
            kind == TCKind._tk_enum ||
            kind == TCKind._tk_fixed ||
            kind == TCKind._tk_value ||
            kind == TCKind._tk_value_box);
}
 
Example 18
Project: OpenJSharp   File: ORBImpl.java   View Source Code Vote up 5 votes
public synchronized org.omg.CORBA.TypeCode create_value_tc(String id,
                                              String name,
                                              short type_modifier,
                                              TypeCode concrete_base,
                                              ValueMember[] members)
{
    checkShutdownState();
    return new TypeCodeImpl(this, TCKind._tk_value, id, name,
                            type_modifier, concrete_base, members);
}
 
Example 19
Project: OpenJSharp   File: ORBSingleton.java   View Source Code Vote up 5 votes
public org.omg.CORBA.TypeCode create_value_tc(String id,
                                              String name,
                                              short type_modifier,
                                              TypeCode concrete_base,
                                              ValueMember[] members)
{
    return new TypeCodeImpl(this, TCKind._tk_value, id, name,
                            type_modifier, concrete_base, members);
}
 
Example 20
Project: openjdk-jdk10   File: ORB.java   View Source Code Vote up 4 votes
protected ORB()
{
    // Initialize logging first, since it is needed nearly
    // everywhere (for example, in TypeCodeImpl).
    wrapperMap = new ConcurrentHashMap<>();
    wrapper = ORBUtilSystemException.get( this,
        CORBALogDomains.RPC_PRESENTATION ) ;
    omgWrapper = OMGSystemException.get( this,
        CORBALogDomains.RPC_PRESENTATION ) ;

    typeCodeMap = new HashMap<>();

    primitiveTypeCodeConstants = new TypeCodeImpl[] {
        new TypeCodeImpl(this, TCKind._tk_null),
        new TypeCodeImpl(this, TCKind._tk_void),
        new TypeCodeImpl(this, TCKind._tk_short),
        new TypeCodeImpl(this, TCKind._tk_long),
        new TypeCodeImpl(this, TCKind._tk_ushort),
        new TypeCodeImpl(this, TCKind._tk_ulong),
        new TypeCodeImpl(this, TCKind._tk_float),
        new TypeCodeImpl(this, TCKind._tk_double),
        new TypeCodeImpl(this, TCKind._tk_boolean),
        new TypeCodeImpl(this, TCKind._tk_char),
        new TypeCodeImpl(this, TCKind._tk_octet),
        new TypeCodeImpl(this, TCKind._tk_any),
        new TypeCodeImpl(this, TCKind._tk_TypeCode),
        new TypeCodeImpl(this, TCKind._tk_Principal),
        new TypeCodeImpl(this, TCKind._tk_objref),
        null,       // tk_struct
        null,       // tk_union
        null,       // tk_enum
        new TypeCodeImpl(this, TCKind._tk_string),
        null,       // tk_sequence
        null,       // tk_array
        null,       // tk_alias
        null,       // tk_except
        new TypeCodeImpl(this, TCKind._tk_longlong),
        new TypeCodeImpl(this, TCKind._tk_ulonglong),
        new TypeCodeImpl(this, TCKind._tk_longdouble),
        new TypeCodeImpl(this, TCKind._tk_wchar),
        new TypeCodeImpl(this, TCKind._tk_wstring),
        new TypeCodeImpl(this, TCKind._tk_fixed),
        new TypeCodeImpl(this, TCKind._tk_value),
        new TypeCodeImpl(this, TCKind._tk_value_box),
        new TypeCodeImpl(this, TCKind._tk_native),
        new TypeCodeImpl(this, TCKind._tk_abstract_interface)
    } ;

    monitoringManager =
        MonitoringFactories.getMonitoringManagerFactory( ).
            createMonitoringManager(
            MonitoringConstants.DEFAULT_MONITORING_ROOT,
            MonitoringConstants.DEFAULT_MONITORING_ROOT_DESCRIPTION);
}