Java Code Examples for org.omg.CORBA.TCKind#_tk_native

The following examples show how to use org.omg.CORBA.TCKind#_tk_native . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TypeCodeImpl.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
public TypeCodeImpl(ORB orb,
                    int creationKind,
                    String id,
                    String name)
{
    this(orb) ;

    if (creationKind == TCKind._tk_objref ||
        creationKind == TCKind._tk_native ||
        creationKind == TCKind._tk_abstract_interface)
        {
            _kind           = creationKind;
            setId(id);
            _name           = name;
        } // else initializes to null
}
 
Example 2
Source File: TypeCodeImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
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 3
Source File: TypeCodeImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
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 4
Source File: TypeCodeImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
void read_value_kind(InputStream is) {
    // unmarshal the kind
    _kind = is.read_long();

    // check validity of kind
    if ((_kind < 0 || _kind > typeTable.length) && _kind != tk_indirect) {
        throw wrapper.cannotMarshalBadTckind() ;
    }
    // Don't do any work if this is native
    if (_kind == TCKind._tk_native)
        throw wrapper.cannotMarshalNative() ;

    if (_kind == tk_indirect) {
        throw wrapper.recursiveTypecodeError() ;
    }
}
 
Example 5
Source File: TypeCodeImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
void read_value_kind(InputStream is) {
    // unmarshal the kind
    _kind = is.read_long();

    // check validity of kind
    if ((_kind < 0 || _kind > typeTable.length) && _kind != tk_indirect) {
        throw wrapper.cannotMarshalBadTckind() ;
    }
    // Don't do any work if this is native
    if (_kind == TCKind._tk_native)
        throw wrapper.cannotMarshalNative() ;

    if (_kind == tk_indirect) {
        throw wrapper.recursiveTypecodeError() ;
    }
}
 
Example 6
Source File: TypeCodeImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
void read_value_kind(InputStream is) {
    // unmarshal the kind
    _kind = is.read_long();

    // check validity of kind
    if ((_kind < 0 || _kind > typeTable.length) && _kind != tk_indirect) {
        throw wrapper.cannotMarshalBadTckind() ;
    }
    // Don't do any work if this is native
    if (_kind == TCKind._tk_native)
        throw wrapper.cannotMarshalNative() ;

    if (_kind == tk_indirect) {
        throw wrapper.recursiveTypecodeError() ;
    }
}
 
Example 7
Source File: TypeCodeImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
boolean read_value_kind(TypeCodeReader tcis)
{
    _kind = tcis.read_long();

    // Bug fix 5034649: allow for padding that precedes the typecode kind.
    int myPosition = tcis.getTopLevelPosition()-4;

    // check validity of kind
    if ((_kind < 0 || _kind > typeTable.length) && _kind != tk_indirect) {
        throw wrapper.cannotMarshalBadTckind() ;
    }

    // Don't do any work if this is native
    if (_kind == TCKind._tk_native)
        throw wrapper.cannotMarshalNative() ;

    // We have to remember the stream and position for EVERY type code
    // in case some recursive or indirect type code references it.
    TypeCodeReader topStream = tcis.getTopLevelStream();

    if (_kind == tk_indirect) {
        int streamOffset = tcis.read_long();
        if (streamOffset > -4)
            throw wrapper.invalidIndirection( new Integer(streamOffset) ) ;

        // The encoding used for indirection is the same as that used for recursive ,
        // TypeCodes i.e., a 0xffffffff indirection marker followed by a long offset
        // (in units of octets) from the beginning of the long offset.
        int topPos = tcis.getTopLevelPosition();
        // substract 4 to get back to the beginning of the long offset.
        int indirectTypePosition = topPos - 4 + streamOffset;

        // Now we have to find the referenced type
        // by its indirectTypePosition within topStream.
        //if (debug) System.out.println(
        // "TypeCodeImpl looking up indirection at position topPos " +
        //topPos + " - 4 + offset " + streamOffset + " = " + indirectTypePosition);
        TypeCodeImpl type = topStream.getTypeCodeAtPosition(indirectTypePosition);
        if (type == null)
            throw wrapper.indirectionNotFound( new Integer(indirectTypePosition) ) ;
        setIndirectType(type);
        return false;
    }

    topStream.addTypeCodeAtPosition(this, myPosition);
    return true;
}
 
Example 8
Source File: ORBImpl.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public synchronized org.omg.CORBA.TypeCode create_native_tc(String id,
                                               String name)
{
    checkShutdownState();
    return new TypeCodeImpl(this, TCKind._tk_native, id, name);
}
 
Example 9
Source File: ORB.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
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);
}
 
Example 10
Source File: ORBSingleton.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
public org.omg.CORBA.TypeCode create_native_tc(String id,
                                               String name)
{
    return new TypeCodeImpl(this, TCKind._tk_native, id, name);
}
 
Example 11
Source File: ORB.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
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);
}
 
Example 12
Source File: ORB.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
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);
}
 
Example 13
Source File: TypeCodeImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
boolean read_value_kind(TypeCodeReader tcis)
{
    _kind = tcis.read_long();

    // Bug fix 5034649: allow for padding that precedes the typecode kind.
    int myPosition = tcis.getTopLevelPosition()-4;

    // check validity of kind
    if ((_kind < 0 || _kind > typeTable.length) && _kind != tk_indirect) {
        throw wrapper.cannotMarshalBadTckind() ;
    }

    // Don't do any work if this is native
    if (_kind == TCKind._tk_native)
        throw wrapper.cannotMarshalNative() ;

    // We have to remember the stream and position for EVERY type code
    // in case some recursive or indirect type code references it.
    TypeCodeReader topStream = tcis.getTopLevelStream();

    if (_kind == tk_indirect) {
        int streamOffset = tcis.read_long();
        if (streamOffset > -4)
            throw wrapper.invalidIndirection( new Integer(streamOffset) ) ;

        // The encoding used for indirection is the same as that used for recursive ,
        // TypeCodes i.e., a 0xffffffff indirection marker followed by a long offset
        // (in units of octets) from the beginning of the long offset.
        int topPos = tcis.getTopLevelPosition();
        // substract 4 to get back to the beginning of the long offset.
        int indirectTypePosition = topPos - 4 + streamOffset;

        // Now we have to find the referenced type
        // by its indirectTypePosition within topStream.
        //if (debug) System.out.println(
        // "TypeCodeImpl looking up indirection at position topPos " +
        //topPos + " - 4 + offset " + streamOffset + " = " + indirectTypePosition);
        TypeCodeImpl type = topStream.getTypeCodeAtPosition(indirectTypePosition);
        if (type == null)
            throw wrapper.indirectionNotFound( new Integer(indirectTypePosition) ) ;
        setIndirectType(type);
        return false;
    }

    topStream.addTypeCodeAtPosition(this, myPosition);
    return true;
}
 
Example 14
Source File: ORBImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public synchronized org.omg.CORBA.TypeCode create_native_tc(String id,
                                               String name)
{
    checkShutdownState();
    return new TypeCodeImpl(this, TCKind._tk_native, id, name);
}
 
Example 15
Source File: ORBImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public synchronized org.omg.CORBA.TypeCode create_native_tc(String id,
                                               String name)
{
    checkShutdownState();
    return new TypeCodeImpl(this, TCKind._tk_native, id, name);
}
 
Example 16
Source File: ORBSingleton.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public org.omg.CORBA.TypeCode create_native_tc(String id,
                                               String name)
{
    return new TypeCodeImpl(this, TCKind._tk_native, id, name);
}
 
Example 17
Source File: TypeCodeImpl.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private void printStream(PrintStream s, int level) {
    if (_kind == tk_indirect) {
        s.print("indirect " + _id);
        return;
    }

    switch (_kind) {
        case TCKind._tk_null:
        case TCKind._tk_void:
        case TCKind._tk_short:
        case TCKind._tk_long:
        case TCKind._tk_ushort:
        case TCKind._tk_ulong:
        case TCKind._tk_float:
        case TCKind._tk_double:
        case TCKind._tk_boolean:
        case TCKind._tk_char:
        case TCKind._tk_octet:
        case TCKind._tk_any:
        case TCKind._tk_TypeCode:
        case TCKind._tk_Principal:
        case TCKind._tk_objref:
        case TCKind._tk_longlong:
        case TCKind._tk_ulonglong:
        case TCKind._tk_longdouble:
        case TCKind._tk_wchar:
        case TCKind._tk_native:
            s.print(kindNames[_kind] + " " + _name);
            break;

        case TCKind._tk_struct:
        case TCKind._tk_except:
        case TCKind._tk_value:
            s.println(kindNames[_kind] + " " + _name + " = {");
            for(int i=0; i<_memberCount; i++) {
                // memberName might differ from the name of the member.
                s.print(indent(level + 1));
                if (_memberTypes[i] != null)
                    _memberTypes[i].printStream(s, level + 1);
                else
                    s.print("<unknown type>");
                s.println(" " + _memberNames[i] + ";");
            }
            s.print(indent(level) + "}");
            break;

        case TCKind._tk_union:
            s.print("union " + _name + "...");
            break;

        case TCKind._tk_enum:
            s.print("enum " + _name + "...");
            break;

        case TCKind._tk_string:
            if (_length == 0)
                s.print("unbounded string " + _name);
            else
                s.print("bounded string(" + _length + ") " + _name);
            break;

        case TCKind._tk_sequence:
        case TCKind._tk_array:
            s.println(kindNames[_kind] + "[" + _length + "] " + _name + " = {");
            s.print(indent(level + 1));
            if (lazy_content_type() != null) {
                lazy_content_type().printStream(s, level + 1);
            }
            s.println(indent(level) + "}");
            break;

        case TCKind._tk_alias:
            s.print("alias " + _name + " = " +
                (_contentType != null ? _contentType._name : "<unresolved>"));
            break;

        case TCKind._tk_wstring:
            s.print("wstring[" + _length + "] " + _name);
            break;

        case TCKind._tk_fixed:
            s.print("fixed(" + _digits + ", " + _scale + ") " + _name);
            break;

        case TCKind._tk_value_box:
            s.print("valueBox " + _name + "...");
            break;

        case TCKind._tk_abstract_interface:
            s.print("abstractInterface " + _name + "...");
            break;

        default:
            s.print("<unknown type>");
            break;
    }
}
 
Example 18
Source File: DynAnyUtil.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
static boolean isConsistentType(TypeCode typeCode) {
    int kind = typeCode.kind().value();
    return (kind != TCKind._tk_Principal &&
            kind != TCKind._tk_native &&
            kind != TCKind._tk_abstract_interface);
}
 
Example 19
Source File: ORBSingleton.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public org.omg.CORBA.TypeCode create_native_tc(String id,
                                               String name)
{
    return new TypeCodeImpl(this, TCKind._tk_native, id, name);
}
 
Example 20
Source File: TypeCodeImpl.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
boolean read_value_kind(TypeCodeReader tcis)
{
    _kind = tcis.read_long();

    // Bug fix 5034649: allow for padding that precedes the typecode kind.
    int myPosition = tcis.getTopLevelPosition()-4;

    // check validity of kind
    if ((_kind < 0 || _kind > typeTable.length) && _kind != tk_indirect) {
        throw wrapper.cannotMarshalBadTckind() ;
    }

    // Don't do any work if this is native
    if (_kind == TCKind._tk_native)
        throw wrapper.cannotMarshalNative() ;

    // We have to remember the stream and position for EVERY type code
    // in case some recursive or indirect type code references it.
    TypeCodeReader topStream = tcis.getTopLevelStream();

    if (_kind == tk_indirect) {
        int streamOffset = tcis.read_long();
        if (streamOffset > -4)
            throw wrapper.invalidIndirection( new Integer(streamOffset) ) ;

        // The encoding used for indirection is the same as that used for recursive ,
        // TypeCodes i.e., a 0xffffffff indirection marker followed by a long offset
        // (in units of octets) from the beginning of the long offset.
        int topPos = tcis.getTopLevelPosition();
        // substract 4 to get back to the beginning of the long offset.
        int indirectTypePosition = topPos - 4 + streamOffset;

        // Now we have to find the referenced type
        // by its indirectTypePosition within topStream.
        //if (debug) System.out.println(
        // "TypeCodeImpl looking up indirection at position topPos " +
        //topPos + " - 4 + offset " + streamOffset + " = " + indirectTypePosition);
        TypeCodeImpl type = topStream.getTypeCodeAtPosition(indirectTypePosition);
        if (type == null)
            throw wrapper.indirectionNotFound( new Integer(indirectTypePosition) ) ;
        setIndirectType(type);
        return false;
    }

    topStream.addTypeCodeAtPosition(this, myPosition);
    return true;
}