Java Code Examples for com.sun.corba.se.impl.encoding.EncapsOutputStream#create_input_stream()

The following examples show how to use com.sun.corba.se.impl.encoding.EncapsOutputStream#create_input_stream() . 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: IORImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public org.omg.IOP.IOR getIOPIOR() {
    EncapsOutputStream os =
        sun.corba.OutputStreamFactory.newEncapsOutputStream(factory);
    write(os);
    InputStream is = (InputStream) (os.create_input_stream());
    return org.omg.IOP.IORHelper.read(is);
}
 
Example 2
Source File: IORImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public org.omg.IOP.IOR getIOPIOR() {
    EncapsOutputStream os =
        sun.corba.OutputStreamFactory.newEncapsOutputStream(factory);
    write(os);
    InputStream is = (InputStream) (os.create_input_stream());
    return org.omg.IOP.IORHelper.read(is);
}
 
Example 3
Source File: TaggedComponentFactoryFinderImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public TaggedComponent create( org.omg.CORBA.ORB orb,
    org.omg.IOP.TaggedComponent comp )
{
    EncapsOutputStream os =
        sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)orb);
    org.omg.IOP.TaggedComponentHelper.write( os, comp ) ;
    InputStream is = (InputStream)(os.create_input_stream() ) ;
    // Skip the component ID: we just wrote it out above
    is.read_ulong() ;

    return (TaggedComponent)create( comp.tag, is ) ;
}
 
Example 4
Source File: IIOPProfileImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public org.omg.IOP.TaggedProfile getIOPProfile()
{
    EncapsOutputStream os =
        sun.corba.OutputStreamFactory.newEncapsOutputStream(orb);
    os.write_long( getId() ) ;
    write( os ) ;
    InputStream is = (InputStream)(os.create_input_stream()) ;
    return org.omg.IOP.TaggedProfileHelper.read( is ) ;
}
 
Example 5
Source File: IIOPProfileImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public org.omg.IOP.TaggedProfile getIOPProfile()
{
    EncapsOutputStream os =
        sun.corba.OutputStreamFactory.newEncapsOutputStream(orb);
    os.write_long( getId() ) ;
    write( os ) ;
    InputStream is = (InputStream)(os.create_input_stream()) ;
    return org.omg.IOP.TaggedProfileHelper.read( is ) ;
}
 
Example 6
Source File: IORImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public org.omg.IOP.IOR getIOPIOR() {
    EncapsOutputStream os =
        sun.corba.OutputStreamFactory.newEncapsOutputStream(factory);
    write(os);
    InputStream is = (InputStream) (os.create_input_stream());
    return org.omg.IOP.IORHelper.read(is);
}
 
Example 7
Source File: IIOPProfileImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public org.omg.IOP.TaggedProfile getIOPProfile()
{
    EncapsOutputStream os =
        sun.corba.OutputStreamFactory.newEncapsOutputStream(orb);
    os.write_long( getId() ) ;
    write( os ) ;
    InputStream is = (InputStream)(os.create_input_stream()) ;
    return org.omg.IOP.TaggedProfileHelper.read( is ) ;
}
 
Example 8
Source File: TaggedComponentBase.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public org.omg.IOP.TaggedComponent getIOPComponent(
    org.omg.CORBA.ORB orb )
{
    EncapsOutputStream os =
        sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)orb);
    write( os ) ;
    InputStream is = (InputStream)(os.create_input_stream() ) ;
    return org.omg.IOP.TaggedComponentHelper.read( is ) ;
}
 
Example 9
Source File: TaggedComponentBase.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public org.omg.IOP.TaggedComponent getIOPComponent(
    org.omg.CORBA.ORB orb )
{
    EncapsOutputStream os =
        sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)orb);
    write( os ) ;
    InputStream is = (InputStream)(os.create_input_stream() ) ;
    return org.omg.IOP.TaggedComponentHelper.read( is ) ;
}
 
Example 10
Source File: IIOPProfileImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public org.omg.IOP.TaggedProfile getIOPProfile()
{
    EncapsOutputStream os =
        sun.corba.OutputStreamFactory.newEncapsOutputStream(orb);
    os.write_long( getId() ) ;
    write( os ) ;
    InputStream is = (InputStream)(os.create_input_stream()) ;
    return org.omg.IOP.TaggedProfileHelper.read( is ) ;
}
 
Example 11
Source File: TaggedComponentBase.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public org.omg.IOP.TaggedComponent getIOPComponent(
    org.omg.CORBA.ORB orb )
{
    EncapsOutputStream os =
        sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)orb);
    write( os ) ;
    InputStream is = (InputStream)(os.create_input_stream() ) ;
    return org.omg.IOP.TaggedComponentHelper.read( is ) ;
}
 
Example 12
Source File: GenericTaggedProfile.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public org.omg.IOP.TaggedProfile getIOPProfile()
{
    EncapsOutputStream os =
        sun.corba.OutputStreamFactory.newEncapsOutputStream(orb);
    write( os ) ;
    InputStream is = (InputStream)(os.create_input_stream()) ;
    return org.omg.IOP.TaggedProfileHelper.read( is ) ;
}
 
Example 13
Source File: TaggedComponentBase.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public org.omg.IOP.TaggedComponent getIOPComponent(
    org.omg.CORBA.ORB orb )
{
    EncapsOutputStream os =
        sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)orb);
    write( os ) ;
    InputStream is = (InputStream)(os.create_input_stream() ) ;
    return org.omg.IOP.TaggedComponentHelper.read( is ) ;
}
 
Example 14
Source File: IORImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public org.omg.IOP.IOR getIOPIOR() {
    EncapsOutputStream os =
        sun.corba.OutputStreamFactory.newEncapsOutputStream(factory);
    write(os);
    InputStream is = (InputStream) (os.create_input_stream());
    return org.omg.IOP.IORHelper.read(is);
}
 
Example 15
Source File: TaggedComponentBase.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public org.omg.IOP.TaggedComponent getIOPComponent(
    org.omg.CORBA.ORB orb )
{
    EncapsOutputStream os =
        sun.corba.OutputStreamFactory.newEncapsOutputStream((ORB)orb);
    write( os ) ;
    InputStream is = (InputStream)(os.create_input_stream() ) ;
    return org.omg.IOP.TaggedComponentHelper.read( is ) ;
}
 
Example 16
Source File: RequestInfoImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Utility method to look up a service context with the given id and
 * convert it to an IOP.ServiceContext.  Uses the given HashMap as
 * a cache.  If not found in cache, the result is inserted in the cache.
 */
protected org.omg.IOP.ServiceContext
    getServiceContext ( HashMap cachedServiceContexts,
                        ServiceContexts serviceContexts, int id )
{
    org.omg.IOP.ServiceContext result = null;
    Integer integerId = new Integer( id );

    // Search cache first:
    result = (org.omg.IOP.ServiceContext)
        cachedServiceContexts.get( integerId );

    // null could normally mean that either we cached the value null
    // or it's not in the cache.  However, there is no way for us to
    // cache the value null in the following code.
    if( result == null ) {
        // Not in cache.  Find it and put in cache.
        // Get the desired "core" service context.
        com.sun.corba.se.spi.servicecontext.ServiceContext context =
            serviceContexts.get( id );
        if (context == null)
            throw stdWrapper.invalidServiceContextId() ;

        // Convert the "core" service context to an
        // "IOP" ServiceContext by writing it to a
        // CDROutputStream and reading it back.
        EncapsOutputStream out =
            sun.corba.OutputStreamFactory.newEncapsOutputStream(myORB);

        context.write( out, GIOPVersion.V1_2 );
        InputStream inputStream = out.create_input_stream();
        result = ServiceContextHelper.read( inputStream );

        cachedServiceContexts.put( integerId, result );
    }

    // Good citizen: For increased efficiency, we assume that interceptors
    // will not modify the returned ServiceContext.  Otherwise, we would
    // have to make a deep copy.

    return result;
}
 
Example 17
Source File: RequestInfoImpl.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Utility method to look up a service context with the given id and
 * convert it to an IOP.ServiceContext.  Uses the given HashMap as
 * a cache.  If not found in cache, the result is inserted in the cache.
 */
protected org.omg.IOP.ServiceContext
    getServiceContext ( HashMap cachedServiceContexts,
                        ServiceContexts serviceContexts, int id )
{
    org.omg.IOP.ServiceContext result = null;
    Integer integerId = new Integer( id );

    // Search cache first:
    result = (org.omg.IOP.ServiceContext)
        cachedServiceContexts.get( integerId );

    // null could normally mean that either we cached the value null
    // or it's not in the cache.  However, there is no way for us to
    // cache the value null in the following code.
    if( result == null ) {
        // Not in cache.  Find it and put in cache.
        // Get the desired "core" service context.
        com.sun.corba.se.spi.servicecontext.ServiceContext context =
            serviceContexts.get( id );
        if (context == null)
            throw stdWrapper.invalidServiceContextId() ;

        // Convert the "core" service context to an
        // "IOP" ServiceContext by writing it to a
        // CDROutputStream and reading it back.
        EncapsOutputStream out =
            sun.corba.OutputStreamFactory.newEncapsOutputStream(myORB);

        context.write( out, GIOPVersion.V1_2 );
        InputStream inputStream = out.create_input_stream();
        result = ServiceContextHelper.read( inputStream );

        cachedServiceContexts.put( integerId, result );
    }

    // Good citizen: For increased efficiency, we assume that interceptors
    // will not modify the returned ServiceContext.  Otherwise, we would
    // have to make a deep copy.

    return result;
}
 
Example 18
Source File: RequestInfoImpl.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Utility method to look up a service context with the given id and
 * convert it to an IOP.ServiceContext.  Uses the given HashMap as
 * a cache.  If not found in cache, the result is inserted in the cache.
 */
protected org.omg.IOP.ServiceContext
    getServiceContext ( HashMap cachedServiceContexts,
                        ServiceContexts serviceContexts, int id )
{
    org.omg.IOP.ServiceContext result = null;
    Integer integerId = new Integer( id );

    // Search cache first:
    result = (org.omg.IOP.ServiceContext)
        cachedServiceContexts.get( integerId );

    // null could normally mean that either we cached the value null
    // or it's not in the cache.  However, there is no way for us to
    // cache the value null in the following code.
    if( result == null ) {
        // Not in cache.  Find it and put in cache.
        // Get the desired "core" service context.
        com.sun.corba.se.spi.servicecontext.ServiceContext context =
            serviceContexts.get( id );
        if (context == null)
            throw stdWrapper.invalidServiceContextId() ;

        // Convert the "core" service context to an
        // "IOP" ServiceContext by writing it to a
        // CDROutputStream and reading it back.
        EncapsOutputStream out =
            sun.corba.OutputStreamFactory.newEncapsOutputStream(myORB);

        context.write( out, GIOPVersion.V1_2 );
        InputStream inputStream = out.create_input_stream();
        result = ServiceContextHelper.read( inputStream );

        cachedServiceContexts.put( integerId, result );
    }

    // Good citizen: For increased efficiency, we assume that interceptors
    // will not modify the returned ServiceContext.  Otherwise, we would
    // have to make a deep copy.

    return result;
}
 
Example 19
Source File: RequestInfoImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Utility method to look up a service context with the given id and
 * convert it to an IOP.ServiceContext.  Uses the given HashMap as
 * a cache.  If not found in cache, the result is inserted in the cache.
 */
protected org.omg.IOP.ServiceContext
    getServiceContext ( HashMap cachedServiceContexts,
                        ServiceContexts serviceContexts, int id )
{
    org.omg.IOP.ServiceContext result = null;
    Integer integerId = new Integer( id );

    // Search cache first:
    result = (org.omg.IOP.ServiceContext)
        cachedServiceContexts.get( integerId );

    // null could normally mean that either we cached the value null
    // or it's not in the cache.  However, there is no way for us to
    // cache the value null in the following code.
    if( result == null ) {
        // Not in cache.  Find it and put in cache.
        // Get the desired "core" service context.
        com.sun.corba.se.spi.servicecontext.ServiceContext context =
            serviceContexts.get( id );
        if (context == null)
            throw stdWrapper.invalidServiceContextId() ;

        // Convert the "core" service context to an
        // "IOP" ServiceContext by writing it to a
        // CDROutputStream and reading it back.
        EncapsOutputStream out =
            sun.corba.OutputStreamFactory.newEncapsOutputStream(myORB);

        context.write( out, GIOPVersion.V1_2 );
        InputStream inputStream = out.create_input_stream();
        result = ServiceContextHelper.read( inputStream );

        cachedServiceContexts.put( integerId, result );
    }

    // Good citizen: For increased efficiency, we assume that interceptors
    // will not modify the returned ServiceContext.  Otherwise, we would
    // have to make a deep copy.

    return result;
}
 
Example 20
Source File: RequestInfoImpl.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
/**
 * Utility method to look up a service context with the given id and
 * convert it to an IOP.ServiceContext.  Uses the given HashMap as
 * a cache.  If not found in cache, the result is inserted in the cache.
 */
protected org.omg.IOP.ServiceContext
    getServiceContext ( HashMap cachedServiceContexts,
                        ServiceContexts serviceContexts, int id )
{
    org.omg.IOP.ServiceContext result = null;
    Integer integerId = new Integer( id );

    // Search cache first:
    result = (org.omg.IOP.ServiceContext)
        cachedServiceContexts.get( integerId );

    // null could normally mean that either we cached the value null
    // or it's not in the cache.  However, there is no way for us to
    // cache the value null in the following code.
    if( result == null ) {
        // Not in cache.  Find it and put in cache.
        // Get the desired "core" service context.
        com.sun.corba.se.spi.servicecontext.ServiceContext context =
            serviceContexts.get( id );
        if (context == null)
            throw stdWrapper.invalidServiceContextId() ;

        // Convert the "core" service context to an
        // "IOP" ServiceContext by writing it to a
        // CDROutputStream and reading it back.
        EncapsOutputStream out =
            sun.corba.OutputStreamFactory.newEncapsOutputStream(myORB);

        context.write( out, GIOPVersion.V1_2 );
        InputStream inputStream = out.create_input_stream();
        result = ServiceContextHelper.read( inputStream );

        cachedServiceContexts.put( integerId, result );
    }

    // Good citizen: For increased efficiency, we assume that interceptors
    // will not modify the returned ServiceContext.  Otherwise, we would
    // have to make a deep copy.

    return result;
}