com.sun.corba.se.impl.corba.TypeCodeImpl Java Examples

The following examples show how to use com.sun.corba.se.impl.corba.TypeCodeImpl. 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: CDRInputStream_1_0.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
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 #2
Source File: CDRInputStream_1_0.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
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 #3
Source File: ORBImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
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 #4
Source File: DynAnyConstructedImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
protected boolean isRecursive() {
    if (isRecursive == RECURSIVE_UNDEF) {
        TypeCode typeCode = any.type();
        if (typeCode instanceof TypeCodeImpl) {
            if (((TypeCodeImpl)typeCode).is_recursive())
                isRecursive = RECURSIVE_YES;
            else
                isRecursive = RECURSIVE_NO;
        } else {
            // No way to find out unless the TypeCode spec changes.
            isRecursive = RECURSIVE_NO;
        }
    }
    return (isRecursive == RECURSIVE_YES);
}
 
Example #5
Source File: WrapperInputStream.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public TypeCodeImpl getTypeCodeAtPosition(int position) {
    if (typeMap == null)
        return null;
    //if (TypeCodeImpl.debug) System.out.println("Getting tc " + (TypeCodeImpl)typeMap.get(new Integer(position)) +
        //" at position " + position);
    return (TypeCodeImpl)typeMap.get(new Integer(position));
}
 
Example #6
Source File: ORBSingleton.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
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 #7
Source File: ORBImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
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 #8
Source File: WrapperInputStream.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void printTypeMap() {
    System.out.println("typeMap = {");
    List sortedKeys = new ArrayList(typeMap.keySet());
    Collections.sort(sortedKeys);
    Iterator i = sortedKeys.iterator();
    while (i.hasNext()) {
        Integer pos = (Integer)i.next();
        TypeCodeImpl tci = (TypeCodeImpl)typeMap.get(pos);
        System.out.println("  key = " + pos.intValue() + ", value = " + tci.description());
    }
    System.out.println("}");
}
 
Example #9
Source File: ORBImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public synchronized void setTypeCodeForClass(Class c, TypeCodeImpl tci)
{
    checkShutdownState();

    if (typeCodeForClassMap == null)
        typeCodeForClassMap = Collections.synchronizedMap(
            new WeakHashMap(64));
    // Store only one TypeCode per class.
    if ( ! typeCodeForClassMap.containsKey(c))
        typeCodeForClassMap.put(c, tci);
}
 
Example #10
Source File: TypeCodeInputStream.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public void printTypeMap() {
    System.out.println("typeMap = {");
    Iterator i = typeMap.keySet().iterator();
    while (i.hasNext()) {
        Integer pos = (Integer)i.next();
        TypeCodeImpl tci = (TypeCodeImpl)typeMap.get(pos);
        System.out.println("  key = " + pos.intValue() + ", value = " + tci.description());
    }
    System.out.println("}");
}
 
Example #11
Source File: TypeCodeInputStream.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public TypeCodeImpl getTypeCodeAtPosition(int position) {
    if (typeMap == null)
        return null;
    //if (TypeCodeImpl.debug) {
        //System.out.println("Getting tc " + (TypeCode)typeMap.get(new Integer(position)) +
                           //" at position " + position);
    //}
    return (TypeCodeImpl)typeMap.get(new Integer(position));
}
 
Example #12
Source File: ORBImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public synchronized org.omg.CORBA.TypeCode create_abstract_interface_tc(
                                                           String id,
                                                           String name)
{
    checkShutdownState();
    return new TypeCodeImpl(this, TCKind._tk_abstract_interface, id, name);
}
 
Example #13
Source File: WrapperInputStream.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public void printTypeMap() {
    System.out.println("typeMap = {");
    List sortedKeys = new ArrayList(typeMap.keySet());
    Collections.sort(sortedKeys);
    Iterator i = sortedKeys.iterator();
    while (i.hasNext()) {
        Integer pos = (Integer)i.next();
        TypeCodeImpl tci = (TypeCodeImpl)typeMap.get(pos);
        System.out.println("  key = " + pos.intValue() + ", value = " + tci.description());
    }
    System.out.println("}");
}
 
Example #14
Source File: WrapperInputStream.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public TypeCodeImpl getTypeCodeAtPosition(int position) {
    if (typeMap == null)
        return null;
    //if (TypeCodeImpl.debug) System.out.println("Getting tc " + (TypeCodeImpl)typeMap.get(new Integer(position)) +
        //" at position " + position);
    return (TypeCodeImpl)typeMap.get(new Integer(position));
}
 
Example #15
Source File: ORBImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public synchronized TypeCodeImpl getTypeCodeForClass(Class c)
{
    checkShutdownState();

    if (typeCodeForClassMap == null)
        return null;
    return (TypeCodeImpl)typeCodeForClassMap.get(c);
}
 
Example #16
Source File: DynAnyConstructedImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
protected boolean isRecursive() {
    if (isRecursive == RECURSIVE_UNDEF) {
        TypeCode typeCode = any.type();
        if (typeCode instanceof TypeCodeImpl) {
            if (((TypeCodeImpl)typeCode).is_recursive())
                isRecursive = RECURSIVE_YES;
            else
                isRecursive = RECURSIVE_NO;
        } else {
            // No way to find out unless the TypeCode spec changes.
            isRecursive = RECURSIVE_NO;
        }
    }
    return (isRecursive == RECURSIVE_YES);
}
 
Example #17
Source File: ORBImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public synchronized TypeCodeImpl getTypeCodeForClass(Class c)
{
    checkShutdownState();

    if (typeCodeForClassMap == null)
        return null;
    return (TypeCodeImpl)typeCodeForClassMap.get(c);
}
 
Example #18
Source File: ORBSingleton.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public TypeCode create_union_tc(String id,
                                String name,
                                TypeCode discriminator_type,
                                UnionMember[] members)
{
    return new TypeCodeImpl(this,
                            TCKind._tk_union,
                            id,
                            name,
                            discriminator_type,
                            members);
}
 
Example #19
Source File: ORBSingleton.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
public TypeCode create_sequence_tc(int bound,
                                   TypeCode element_type)
{
    return new TypeCodeImpl(this, TCKind._tk_sequence, bound, element_type);
}
 
Example #20
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_fixed_tc(short digits, short scale)
{
    return new TypeCodeImpl(this, TCKind._tk_fixed, digits, scale);
}
 
Example #21
Source File: ORBSingleton.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
public TypeCode create_recursive_sequence_tc(int bound,
                                             int offset)
{
    return new TypeCodeImpl(this, TCKind._tk_sequence, bound, offset);
}
 
Example #22
Source File: ORBSingleton.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
public TypeCode create_alias_tc(String id,
                                String name,
                                TypeCode original_type)
{
    return new TypeCodeImpl(this, TCKind._tk_alias, id, name, original_type);
}
 
Example #23
Source File: ORBSingleton.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
public TypeCodeImpl getTypeCodeForClass( Class c )
{
    return null ;
}
 
Example #24
Source File: ORBSingleton.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
public TypeCodeImpl getTypeCodeForClass( Class c )
{
    return null ;
}
 
Example #25
Source File: ORBSingleton.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
public TypeCode create_array_tc(int length,
                                TypeCode element_type)
{
    return new TypeCodeImpl(this, TCKind._tk_array, length, element_type);
}
 
Example #26
Source File: ORBSingleton.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
public TypeCode create_string_tc(int bound) {
    return new TypeCodeImpl(this, TCKind._tk_string, bound);
}
 
Example #27
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 #28
Source File: ORBSingleton.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public org.omg.CORBA.TypeCode create_abstract_interface_tc(
                                                           String id,
                                                           String name)
{
    return new TypeCodeImpl(this, TCKind._tk_abstract_interface, id, name);
}
 
Example #29
Source File: ORBImpl.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public synchronized org.omg.CORBA.TypeCode create_fixed_tc(short digits, short scale)
{
    checkShutdownState();
    return new TypeCodeImpl(this, TCKind._tk_fixed, digits, scale);
}
 
Example #30
Source File: ORBImpl.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public synchronized org.omg.CORBA.TypeCode create_fixed_tc(short digits, short scale)
{
    checkShutdownState();
    return new TypeCodeImpl(this, TCKind._tk_fixed, digits, scale);
}