类org.omg.CORBA.portable.InputStream源码实例Demo

下面列出了怎么用org.omg.CORBA.portable.InputStream的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: openjdk-8   文件: BootstrapResolverImpl.java
public org.omg.CORBA.Object resolve( String identifier )
{
    InputStream inStream = null ;
    org.omg.CORBA.Object result = null ;

    try {
        inStream = invoke( "get", identifier ) ;

        result = inStream.read_Object();

        // NOTE: do note trap and ignore errors.
        // Let them flow out.
    } finally {
        bootstrapDelegate.releaseReply( null, inStream ) ;
    }

    return result ;
}
 
源代码2 项目: jdk1.8-source-analysis   文件: AnyImpl.java
/**
 * returns an input stream that an Any value can be marshaled out of.
 *
 * @result          the InputStream to marshal value of Any out of.
 */
public org.omg.CORBA.portable.InputStream create_input_stream()
{
    //
    // We create a new InputStream so that multiple threads can call here
    // and read the streams in parallel without thread safety problems.
    //
    //debug.log ("create_input_stream");
    if (AnyImpl.isStreamed[realType().kind().value()]) {
        return stream.dup();
    } else {
        OutputStream os = (OutputStream)orb.create_output_stream();
        TCUtility.marshalIn(os, realType(), value, object);

        return os.create_input_stream();
    }
}
 
源代码3 项目: openjdk-jdk8u   文件: BootstrapResolverImpl.java
public org.omg.CORBA.Object resolve( String identifier )
{
    InputStream inStream = null ;
    org.omg.CORBA.Object result = null ;

    try {
        inStream = invoke( "get", identifier ) ;

        result = inStream.read_Object();

        // NOTE: do note trap and ignore errors.
        // Let them flow out.
    } finally {
        bootstrapDelegate.releaseReply( null, inStream ) ;
    }

    return result ;
}
 
源代码4 项目: cxf   文件: CorbaAnyEventProducer.java
private CorbaObjectHandler getAnyContainedType(Any a) {
    CorbaObjectHandler result = null;

    TypeCode tc = a.type();
    QName containedName = new QName("AnyContainedType");
    QName idlType = null;
    if (CorbaUtils.isPrimitiveTypeCode(tc)) {
        idlType = CorbaAnyHelper.getPrimitiveIdlTypeFromTypeCode(tc);
        result = new CorbaPrimitiveHandler(containedName, idlType, tc, null);
    } else if (tc.kind().value() == TCKind._tk_any) {
        idlType = CorbaConstants.NT_CORBA_ANY;
        result = new CorbaAnyHandler(containedName, idlType, tc, null);
        ((CorbaAnyHandler)result).setTypeMap(handler.getTypeMap());
    } else {
        idlType = handler.getTypeMap().getIdlType(tc);
        result = CorbaHandlerUtils.initializeObjectHandler(orb, containedName, idlType,
                                                           handler.getTypeMap(), serviceInfo);
    }

    InputStream is = a.create_input_stream();
    CorbaObjectReader reader = new CorbaObjectReader(is);
    reader.read(result);

    return result;
}
 
public java.util.Set list()
{
    InputStream inStream = null ;
    java.util.Set result = new java.util.HashSet() ;

    try {
        inStream = invoke( "list", null ) ;

        int count = inStream.read_long();
        for (int i=0; i < count; i++)
            result.add( inStream.read_string() ) ;

        // NOTE: do note trap and ignore errors.
        // Let them flow out.
    } finally {
        bootstrapDelegate.releaseReply( null, inStream ) ;
    }

    return result ;
}
 
源代码6 项目: JDKSourceCode1.8   文件: BootstrapResolverImpl.java
public java.util.Set list()
{
    InputStream inStream = null ;
    java.util.Set result = new java.util.HashSet() ;

    try {
        inStream = invoke( "list", null ) ;

        int count = inStream.read_long();
        for (int i=0; i < count; i++)
            result.add( inStream.read_string() ) ;

        // NOTE: do note trap and ignore errors.
        // Let them flow out.
    } finally {
        bootstrapDelegate.releaseReply( null, inStream ) ;
    }

    return result ;
}
 
源代码7 项目: openjdk-jdk8u-backup   文件: AnyImpl.java
/**
 * returns an input stream that an Any value can be marshaled out of.
 *
 * @result          the InputStream to marshal value of Any out of.
 */
public org.omg.CORBA.portable.InputStream create_input_stream()
{
    //
    // We create a new InputStream so that multiple threads can call here
    // and read the streams in parallel without thread safety problems.
    //
    //debug.log ("create_input_stream");
    if (AnyImpl.isStreamed[realType().kind().value()]) {
        return stream.dup();
    } else {
        OutputStream os = (OutputStream)orb.create_output_stream();
        TCUtility.marshalIn(os, realType(), value, object);

        return os.create_input_stream();
    }
}
 
源代码8 项目: openjdk-jdk8u   文件: Utility.java
/**
 * Read an object reference from the input stream and narrow
 * it to the desired type.
 * @param in the stream to read from.
 * @throws ClassCastException if narrowFrom cannot be cast to narrowTo.
 */
public static Object readObjectAndNarrow(InputStream in,
                                         Class narrowTo)
    throws ClassCastException
{
    Object result = in.read_Object();
    if (result != null)
        return PortableRemoteObject.narrow(result, narrowTo);
    else
        return null;
}
 
源代码9 项目: jdk8u60   文件: CDROutputObject.java
/** overrides create_input_stream from CDROutputStream */
public org.omg.CORBA.portable.InputStream create_input_stream()
{
    // XREVISIT
    return null;
    //return new XIIOPInputStream(orb(), getByteBuffer(), getIndex(),
        //isLittleEndian(), getMessageHeader(), conn);
}
 
源代码10 项目: hottub   文件: AnyImpl.java
public Any extractAny(TypeCode memberType, ORB orb) {
    Any returnValue = orb.create_any();
    OutputStream out = returnValue.create_output_stream();
    TypeCodeImpl.convertToNative(orb, memberType).copy((InputStream)stream, out);
    returnValue.read_value(out.create_input_stream(), memberType);
    return returnValue;
}
 
源代码11 项目: JDKSourceCode1.8   文件: DynArrayImpl.java
protected boolean initializeComponentsFromAny() {
    // This typeCode is of kind tk_array.
    TypeCode typeCode = any.type();
    int length = getBound();
    TypeCode contentType = getContentType();
    InputStream input;

    try {
        input = any.create_input_stream();
    } catch (BAD_OPERATION e) {
        return false;
    }

    components = new DynAny[length];
    anys = new Any[length];

    for (int i=0; i<length; i++) {
        // _REVISIT_ Could use read_xxx_array() methods on InputStream for efficiency
        // but only for primitive types
        anys[i] = DynAnyUtil.extractAnyFromStream(contentType, input, orb);
        try {
            // Creates the appropriate subtype without copying the Any
            components[i] = DynAnyUtil.createMostDerivedDynAny(anys[i], orb, false);
        } catch (InconsistentTypeCode itc) { // impossible
        }
    }
    return true;
}
 
源代码12 项目: openjdk-8-source   文件: AnyImpl.java
public Any extractAny(TypeCode memberType, ORB orb) {
    Any returnValue = orb.create_any();
    OutputStream out = returnValue.create_output_stream();
    TypeCodeImpl.convertToNative(orb, memberType).copy((InputStream)stream, out);
    returnValue.read_value(out.create_input_stream(), memberType);
    return returnValue;
}
 
源代码13 项目: jdk8u60   文件: Util.java
/**
 * Reads a java.lang.Object as a CORBA any.
 * @param in the stream from which to read the any.
 * @return the object read from the stream.
 */
public Object readAny(InputStream in)
{
    Any any = in.read_any();
    if ( any.type().kind().value() == TCKind._tk_objref )
        return any.extract_Object ();
    else
        return any.extract_Value();
}
 
源代码14 项目: cxf   文件: CorbaObjectReaderTest.java
@Test
public void testReadOctet() {
    OutputStream oStream = orb.create_output_stream();
    oStream.write_octet((byte)27);

    InputStream iStream = oStream.create_input_stream();
    CorbaObjectReader reader = new CorbaObjectReader(iStream);

    Byte octetValue = reader.readOctet();
    assertTrue(octetValue.byteValue() == (byte)27);
}
 
源代码15 项目: cxf   文件: CorbaObjectReaderTest.java
@Test
public void testReadFloat() {
    OutputStream oStream = orb.create_output_stream();
    oStream.write_float((float)1234.56);

    InputStream iStream = oStream.create_input_stream();
    CorbaObjectReader reader = new CorbaObjectReader(iStream);

    Float floatValue = reader.readFloat();
    assertTrue(floatValue.floatValue() == (float)1234.56);
}
 
源代码16 项目: jdk1.8-source-analysis   文件: AnyImpl.java
static public Any extractAnyFromStream(TypeCode memberType, InputStream input, ORB orb) {
    Any returnValue = orb.create_any();
    OutputStream out = returnValue.create_output_stream();
    TypeCodeImpl.convertToNative(orb, memberType).copy(input, out);
    returnValue.read_value(out.create_input_stream(), memberType);
    return returnValue;
}
 
源代码17 项目: openjdk-8-source   文件: CorbaClientDelegateImpl.java
public InputStream invoke(org.omg.CORBA.Object self, OutputStream output)
    throws
        ApplicationException,
        RemarshalException
{
    ClientRequestDispatcher subcontract = getClientRequestDispatcher();
    return (InputStream)
        subcontract.marshalingComplete((Object)self, (OutputObject)output);
}
 
源代码18 项目: TencentKona-8   文件: Utility.java
/**
 * Read an object reference from the input stream and narrow
 * it to the desired type.
 * @param in the stream to read from.
 * @throws ClassCastException if narrowFrom cannot be cast to narrowTo.
 */
public static Object readObjectAndNarrow(InputStream in,
                                         Class narrowTo)
    throws ClassCastException
{
    Object result = in.read_Object();
    if (result != null)
        return PortableRemoteObject.narrow(result, narrowTo);
    else
        return null;
}
 
源代码19 项目: hottub   文件: ORBUtility.java
public static SystemException extractSystemException(Any any) {
    InputStream in = any.create_input_stream();
    ORB orb = (ORB)(in.orb());
    if ( ! isSystemExceptionTypeCode(any.type(), orb)) {
        throw wrapper.unknownDsiSysex(CompletionStatus.COMPLETED_MAYBE);
    }
    return ORBUtility.readSystemException(in);
}
 
源代码20 项目: jdk1.8-source-analysis   文件: DynArrayImpl.java
protected boolean initializeComponentsFromAny() {
    // This typeCode is of kind tk_array.
    TypeCode typeCode = any.type();
    int length = getBound();
    TypeCode contentType = getContentType();
    InputStream input;

    try {
        input = any.create_input_stream();
    } catch (BAD_OPERATION e) {
        return false;
    }

    components = new DynAny[length];
    anys = new Any[length];

    for (int i=0; i<length; i++) {
        // _REVISIT_ Could use read_xxx_array() methods on InputStream for efficiency
        // but only for primitive types
        anys[i] = DynAnyUtil.extractAnyFromStream(contentType, input, orb);
        try {
            // Creates the appropriate subtype without copying the Any
            components[i] = DynAnyUtil.createMostDerivedDynAny(anys[i], orb, false);
        } catch (InconsistentTypeCode itc) { // impossible
        }
    }
    return true;
}
 
源代码21 项目: TencentKona-8   文件: ORBUtility.java
public static SystemException extractSystemException(Any any) {
    InputStream in = any.create_input_stream();
    ORB orb = (ORB)(in.orb());
    if ( ! isSystemExceptionTypeCode(any.type(), orb)) {
        throw wrapper.unknownDsiSysex(CompletionStatus.COMPLETED_MAYBE);
    }
    return ORBUtility.readSystemException(in);
}
 
源代码22 项目: openjdk-jdk8u-backup   文件: RequestImpl.java
public void unmarshalReply(InputStream is)
{
    // First unmarshal the return value if it is not void
    if ( _result != null ) {
        Any returnAny = _result.value();
        TypeCode returnType = returnAny.type();
        if ( returnType.kind().value() != TCKind._tk_void )
            returnAny.read_value(is, returnType);
    }

    // Now unmarshal the out/inout args
    try {
        for ( int i=0; i<_arguments.count() ; i++) {
            NamedValue nv = _arguments.item(i);
            switch( nv.flags() ) {
            case ARG_IN.value:
                break;
            case ARG_OUT.value:
            case ARG_INOUT.value:
                Any any = nv.value();
                any.read_value(is, any.type());
                break;
            }
        }
    }
    catch ( org.omg.CORBA.Bounds ex ) {
        // Cannot happen since we only iterate till _arguments.count()
    }
}
 
源代码23 项目: openjdk-jdk8u   文件: AnyImpl.java
public Any extractAny(TypeCode memberType, ORB orb) {
    Any returnValue = orb.create_any();
    OutputStream out = returnValue.create_output_stream();
    TypeCodeImpl.convertToNative(orb, memberType).copy((InputStream)stream, out);
    returnValue.read_value(out.create_input_stream(), memberType);
    return returnValue;
}
 
源代码24 项目: jdk1.8-source-analysis   文件: Utility.java
/**
 * Read an object reference from the input stream and narrow
 * it to the desired type.
 * @param in the stream to read from.
 * @throws ClassCastException if narrowFrom cannot be cast to narrowTo.
 */
public static Object readObjectAndNarrow(InputStream in,
                                         Class narrowTo)
    throws ClassCastException
{
    Object result = in.read_Object();
    if (result != null)
        return PortableRemoteObject.narrow(result, narrowTo);
    else
        return null;
}
 
源代码25 项目: jdk1.8-source-analysis   文件: Utility.java
/**
 * Read an abstract interface type from the input stream and narrow
 * it to the desired type.
 * @param in the stream to read from.
 * @throws ClassCastException if narrowFrom cannot be cast to narrowTo.
 */
public static Object readAbstractAndNarrow(
    org.omg.CORBA_2_3.portable.InputStream in, Class narrowTo)
    throws ClassCastException
{
    Object result = in.read_abstract_interface();
    if (result != null)
        return PortableRemoteObject.narrow(result, narrowTo);
    else
        return null;
}
 
/** Read the data into a (presumably) empty ORTImpl.  This sets the
* orb to the ORB of the InputStream.
*/
public void _read( InputStream is )
{
    org.omg.CORBA_2_3.portable.InputStream istr =
        (org.omg.CORBA_2_3.portable.InputStream)is ;
    iorTemplate = IORFactories.makeIORTemplate( istr ) ;
    orb = (ORB)(istr.orb()) ;
}
 
源代码27 项目: openjdk-8-source   文件: Utility.java
/**
 * Read an abstract interface type from the input stream and narrow
 * it to the desired type.
 * @param in the stream to read from.
 * @throws ClassCastException if narrowFrom cannot be cast to narrowTo.
 */
public static Object readAbstractAndNarrow(
    org.omg.CORBA_2_3.portable.InputStream in, Class narrowTo)
    throws ClassCastException
{
    Object result = in.read_abstract_interface();
    if (result != null)
        return PortableRemoteObject.narrow(result, narrowTo);
    else
        return null;
}
 
源代码28 项目: cxf   文件: CorbaObjectReaderTest.java
@Test
public void testReadULong() {
    OutputStream oStream = orb.create_output_stream();
    oStream.write_ulong(100000);

    InputStream iStream = oStream.create_input_stream();
    CorbaObjectReader reader = new CorbaObjectReader(iStream);

    long ulongValue = reader.readULong();
    assertTrue(ulongValue == 100000);
}
 
源代码29 项目: openjdk-jdk8u-backup   文件: AnyImpl.java
public Any extractAny(TypeCode memberType, ORB orb) {
    Any returnValue = orb.create_any();
    OutputStream out = returnValue.create_output_stream();
    TypeCodeImpl.convertToNative(orb, memberType).copy((InputStream)stream, out);
    returnValue.read_value(out.create_input_stream(), memberType);
    return returnValue;
}
 
源代码30 项目: jdk8u60   文件: DynArrayImpl.java
protected boolean initializeComponentsFromAny() {
    // This typeCode is of kind tk_array.
    TypeCode typeCode = any.type();
    int length = getBound();
    TypeCode contentType = getContentType();
    InputStream input;

    try {
        input = any.create_input_stream();
    } catch (BAD_OPERATION e) {
        return false;
    }

    components = new DynAny[length];
    anys = new Any[length];

    for (int i=0; i<length; i++) {
        // _REVISIT_ Could use read_xxx_array() methods on InputStream for efficiency
        // but only for primitive types
        anys[i] = DynAnyUtil.extractAnyFromStream(contentType, input, orb);
        try {
            // Creates the appropriate subtype without copying the Any
            components[i] = DynAnyUtil.createMostDerivedDynAny(anys[i], orb, false);
        } catch (InconsistentTypeCode itc) { // impossible
        }
    }
    return true;
}
 
 类所在包
 类方法
 同包方法