org.omg.IOP.ServiceContextHelper Java Examples

The following examples show how to use org.omg.IOP.ServiceContextHelper. 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: 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;
}
 
Example #2
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 #3
Source File: RequestInfoImpl.java    From jdk8u60 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 #4
Source File: RequestInfoImpl.java    From JDKSourceCode1.8 with MIT License 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 #5
Source File: RequestInfoImpl.java    From openjdk-jdk8u 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 #6
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 #7
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 #8
Source File: RequestInfoImpl.java    From hottub 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 #9
Source File: RequestInfoImpl.java    From openjdk-8-source 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 #10
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;
}