Java Code Examples for com.sun.corba.se.spi.servicecontext.CodeSetServiceContext

The following examples show how to use com.sun.corba.se.spi.servicecontext.CodeSetServiceContext. These examples are extracted from open source projects. 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
private void initServiceContextRegistry( ORB orb )
{
    ServiceContextRegistry scr = orb.getServiceContextRegistry() ;

    scr.register( UEInfoServiceContext.class ) ;
    scr.register( CodeSetServiceContext.class ) ;
    scr.register( SendingContextServiceContext.class ) ;
    scr.register( ORBVersionServiceContext.class ) ;
    scr.register( MaxStreamFormatVersionServiceContext.class ) ;
}
 
Example 2
private void initServiceContextRegistry( ORB orb )
{
    ServiceContextRegistry scr = orb.getServiceContextRegistry() ;

    scr.register( UEInfoServiceContext.class ) ;
    scr.register( CodeSetServiceContext.class ) ;
    scr.register( SendingContextServiceContext.class ) ;
    scr.register( ORBVersionServiceContext.class ) ;
    scr.register( MaxStreamFormatVersionServiceContext.class ) ;
}
 
Example 3
Source Project: jdk8u60   Source File: ORBConfiguratorImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
private void initServiceContextRegistry( ORB orb )
{
    ServiceContextRegistry scr = orb.getServiceContextRegistry() ;

    scr.register( UEInfoServiceContext.class ) ;
    scr.register( CodeSetServiceContext.class ) ;
    scr.register( SendingContextServiceContext.class ) ;
    scr.register( ORBVersionServiceContext.class ) ;
    scr.register( MaxStreamFormatVersionServiceContext.class ) ;
}
 
Example 4
Source Project: JDKSourceCode1.8   Source File: ORBConfiguratorImpl.java    License: MIT License 5 votes vote down vote up
private void initServiceContextRegistry( ORB orb )
{
    ServiceContextRegistry scr = orb.getServiceContextRegistry() ;

    scr.register( UEInfoServiceContext.class ) ;
    scr.register( CodeSetServiceContext.class ) ;
    scr.register( SendingContextServiceContext.class ) ;
    scr.register( ORBVersionServiceContext.class ) ;
    scr.register( MaxStreamFormatVersionServiceContext.class ) ;
}
 
Example 5
private void initServiceContextRegistry( ORB orb )
{
    ServiceContextRegistry scr = orb.getServiceContextRegistry() ;

    scr.register( UEInfoServiceContext.class ) ;
    scr.register( CodeSetServiceContext.class ) ;
    scr.register( SendingContextServiceContext.class ) ;
    scr.register( ORBVersionServiceContext.class ) ;
    scr.register( MaxStreamFormatVersionServiceContext.class ) ;
}
 
Example 6
private void initServiceContextRegistry( ORB orb )
{
    ServiceContextRegistry scr = orb.getServiceContextRegistry() ;

    scr.register( UEInfoServiceContext.class ) ;
    scr.register( CodeSetServiceContext.class ) ;
    scr.register( SendingContextServiceContext.class ) ;
    scr.register( ORBVersionServiceContext.class ) ;
    scr.register( MaxStreamFormatVersionServiceContext.class ) ;
}
 
Example 7
private void initServiceContextRegistry( ORB orb )
{
    ServiceContextRegistry scr = orb.getServiceContextRegistry() ;

    scr.register( UEInfoServiceContext.class ) ;
    scr.register( CodeSetServiceContext.class ) ;
    scr.register( SendingContextServiceContext.class ) ;
    scr.register( ORBVersionServiceContext.class ) ;
    scr.register( MaxStreamFormatVersionServiceContext.class ) ;
}
 
Example 8
Source Project: hottub   Source File: ORBConfiguratorImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
private void initServiceContextRegistry( ORB orb )
{
    ServiceContextRegistry scr = orb.getServiceContextRegistry() ;

    scr.register( UEInfoServiceContext.class ) ;
    scr.register( CodeSetServiceContext.class ) ;
    scr.register( SendingContextServiceContext.class ) ;
    scr.register( ORBVersionServiceContext.class ) ;
    scr.register( MaxStreamFormatVersionServiceContext.class ) ;
}
 
Example 9
private void initServiceContextRegistry( ORB orb )
{
    ServiceContextRegistry scr = orb.getServiceContextRegistry() ;

    scr.register( UEInfoServiceContext.class ) ;
    scr.register( CodeSetServiceContext.class ) ;
    scr.register( SendingContextServiceContext.class ) ;
    scr.register( ORBVersionServiceContext.class ) ;
    scr.register( MaxStreamFormatVersionServiceContext.class ) ;
}
 
Example 10
private void initServiceContextRegistry( ORB orb )
{
    ServiceContextRegistry scr = orb.getServiceContextRegistry() ;

    scr.register( UEInfoServiceContext.class ) ;
    scr.register( CodeSetServiceContext.class ) ;
    scr.register( SendingContextServiceContext.class ) ;
    scr.register( ORBVersionServiceContext.class ) ;
    scr.register( MaxStreamFormatVersionServiceContext.class ) ;
}
 
Example 11
protected void addCodeSetServiceContext(CorbaConnection conn,
                                      ServiceContexts ctxs,
                                      GIOPVersion giopVersion) {

    // REVISIT.  OMG issue 3318 concerning sending the code set
    // service context more than once was deemed too much for the
    // RTF.  Here's our strategy for the moment:
    //
    // Send it on every request (necessary in cases of fragmentation
    // with multithreaded clients or when the first thing on a
    // connection is a LocateRequest).  Provide an ORB property
    // to disable multiple sends.
    //
    // Note that the connection is null in the local case and no
    // service context is included.  We use the ORB provided
    // encapsulation streams.
    //
    // Also, there will be no negotiation or service context
    // in GIOP 1.0.  ISO8859-1 is used for char/string, and
    // wchar/wstring are illegal.
    //
    if (giopVersion.equals(GIOPVersion.V1_0) || conn == null)
        return;

    CodeSetComponentInfo.CodeSetContext codeSetCtx = null;

    if (conn.getBroker().getORBData().alwaysSendCodeSetServiceContext() ||
        !conn.isPostInitialContexts()) {

        // Get the negotiated code sets (if any) out of the connection
        codeSetCtx = conn.getCodeSetContext();
    }

    // Either we shouldn't send the code set service context, or
    // for some reason, the connection doesn't have its code sets.
    // Perhaps the server didn't include them in the IOR.  Uses
    // ISO8859-1 for char and makes wchar/wstring illegal.
    if (codeSetCtx == null)
        return;

    CodeSetServiceContext cssc = new CodeSetServiceContext(codeSetCtx);
    ctxs.put(cssc);
}
 
Example 12
/**
 * Handles setting the connection's code sets if required.
 * Returns true if the CodeSetContext was in the request, false
 * otherwise.
 */
protected boolean processCodeSetContext(
    CorbaMessageMediator request, ServiceContexts contexts)
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".processCodeSetContext->: " + opAndId(request));
        }

        ServiceContext sc = contexts.get(
            CodeSetServiceContext.SERVICE_CONTEXT_ID);
        if (sc != null) {
            // Somehow a code set service context showed up in the local case.
            if (request.getConnection() == null) {
                return true;
            }

            // If it's GIOP 1.0, it shouldn't have this context at all.  Our legacy
            // ORBs sent it and we need to know if it's here to make ORB versioning
            // decisions, but we don't use the contents.
            if (request.getGIOPVersion().equals(GIOPVersion.V1_0)) {
                return true;
            }

            CodeSetServiceContext cssc = (CodeSetServiceContext)sc ;
            CodeSetComponentInfo.CodeSetContext csctx = cssc.getCodeSetContext();

            // Note on threading:
            //
            // getCodeSetContext and setCodeSetContext are synchronized
            // on the Connection.  At worst, this will result in
            // multiple threads entering this block and calling
            // setCodeSetContext but not actually changing the
            // values on the Connection.
            //
            // Alternative would be to lock the connection for the
            // whole block, but it's fine either way.

            // The connection's codeSetContext is null until we've received a
            // request with a code set context with the negotiated code sets.
            if (((CorbaConnection)request.getConnection())
                .getCodeSetContext() == null)
            {

                // Use these code sets on this connection
                if (orb.subcontractDebugFlag) {
                    dprint(".processCodeSetContext: " + opAndId(request)
                           + ": Setting code sets to: " + csctx);
                }

                ((CorbaConnection)request.getConnection())
                    .setCodeSetContext(csctx);

                // We had to read the method name using ISO 8859-1
                // (which is the default in the CDRInputStream for
                // char data), but now we may have a new char
                // code set.  If it isn't ISO8859-1, we must tell
                // the CDR stream to null any converter references
                // it has created so that it will reacquire
                // the code sets again using the new info.
                //
                // This should probably compare with the stream's
                // char code set rather than assuming it's ISO8859-1.
                // (However, the operation name is almost certainly
                // ISO8859-1 or ASCII.)
                if (csctx.getCharCodeSet() !=
                    OSFCodeSetRegistry.ISO_8859_1.getNumber()) {
                    ((MarshalInputStream)request.getInputObject())
                        .resetCodeSetConverters();
                }
            }
        }

        // If no code set information is ever sent from the client,
        // the server will use ISO8859-1 for char and throw an
        // exception for any wchar transmissions.
        //
        // In the local case, we use ORB provided streams for
        // marshaling and unmarshaling.  Currently, they use
        // ISO8859-1 for char/string and UTF16 for wchar/wstring.
        return sc != null ;
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".processCodeSetContext<-: " + opAndId(request));
        }
    }
}
 
Example 13
protected void addCodeSetServiceContext(CorbaConnection conn,
                                      ServiceContexts ctxs,
                                      GIOPVersion giopVersion) {

    // REVISIT.  OMG issue 3318 concerning sending the code set
    // service context more than once was deemed too much for the
    // RTF.  Here's our strategy for the moment:
    //
    // Send it on every request (necessary in cases of fragmentation
    // with multithreaded clients or when the first thing on a
    // connection is a LocateRequest).  Provide an ORB property
    // to disable multiple sends.
    //
    // Note that the connection is null in the local case and no
    // service context is included.  We use the ORB provided
    // encapsulation streams.
    //
    // Also, there will be no negotiation or service context
    // in GIOP 1.0.  ISO8859-1 is used for char/string, and
    // wchar/wstring are illegal.
    //
    if (giopVersion.equals(GIOPVersion.V1_0) || conn == null)
        return;

    CodeSetComponentInfo.CodeSetContext codeSetCtx = null;

    if (conn.getBroker().getORBData().alwaysSendCodeSetServiceContext() ||
        !conn.isPostInitialContexts()) {

        // Get the negotiated code sets (if any) out of the connection
        codeSetCtx = conn.getCodeSetContext();
    }

    // Either we shouldn't send the code set service context, or
    // for some reason, the connection doesn't have its code sets.
    // Perhaps the server didn't include them in the IOR.  Uses
    // ISO8859-1 for char and makes wchar/wstring illegal.
    if (codeSetCtx == null)
        return;

    CodeSetServiceContext cssc = new CodeSetServiceContext(codeSetCtx);
    ctxs.put(cssc);
}
 
Example 14
/**
 * Handles setting the connection's code sets if required.
 * Returns true if the CodeSetContext was in the request, false
 * otherwise.
 */
protected boolean processCodeSetContext(
    CorbaMessageMediator request, ServiceContexts contexts)
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".processCodeSetContext->: " + opAndId(request));
        }

        ServiceContext sc = contexts.get(
            CodeSetServiceContext.SERVICE_CONTEXT_ID);
        if (sc != null) {
            // Somehow a code set service context showed up in the local case.
            if (request.getConnection() == null) {
                return true;
            }

            // If it's GIOP 1.0, it shouldn't have this context at all.  Our legacy
            // ORBs sent it and we need to know if it's here to make ORB versioning
            // decisions, but we don't use the contents.
            if (request.getGIOPVersion().equals(GIOPVersion.V1_0)) {
                return true;
            }

            CodeSetServiceContext cssc = (CodeSetServiceContext)sc ;
            CodeSetComponentInfo.CodeSetContext csctx = cssc.getCodeSetContext();

            // Note on threading:
            //
            // getCodeSetContext and setCodeSetContext are synchronized
            // on the Connection.  At worst, this will result in
            // multiple threads entering this block and calling
            // setCodeSetContext but not actually changing the
            // values on the Connection.
            //
            // Alternative would be to lock the connection for the
            // whole block, but it's fine either way.

            // The connection's codeSetContext is null until we've received a
            // request with a code set context with the negotiated code sets.
            if (((CorbaConnection)request.getConnection())
                .getCodeSetContext() == null)
            {

                // Use these code sets on this connection
                if (orb.subcontractDebugFlag) {
                    dprint(".processCodeSetContext: " + opAndId(request)
                           + ": Setting code sets to: " + csctx);
                }

                ((CorbaConnection)request.getConnection())
                    .setCodeSetContext(csctx);

                // We had to read the method name using ISO 8859-1
                // (which is the default in the CDRInputStream for
                // char data), but now we may have a new char
                // code set.  If it isn't ISO8859-1, we must tell
                // the CDR stream to null any converter references
                // it has created so that it will reacquire
                // the code sets again using the new info.
                //
                // This should probably compare with the stream's
                // char code set rather than assuming it's ISO8859-1.
                // (However, the operation name is almost certainly
                // ISO8859-1 or ASCII.)
                if (csctx.getCharCodeSet() !=
                    OSFCodeSetRegistry.ISO_8859_1.getNumber()) {
                    ((MarshalInputStream)request.getInputObject())
                        .resetCodeSetConverters();
                }
            }
        }

        // If no code set information is ever sent from the client,
        // the server will use ISO8859-1 for char and throw an
        // exception for any wchar transmissions.
        //
        // In the local case, we use ORB provided streams for
        // marshaling and unmarshaling.  Currently, they use
        // ISO8859-1 for char/string and UTF16 for wchar/wstring.
        return sc != null ;
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".processCodeSetContext<-: " + opAndId(request));
        }
    }
}
 
Example 15
protected void addCodeSetServiceContext(CorbaConnection conn,
                                      ServiceContexts ctxs,
                                      GIOPVersion giopVersion) {

    // REVISIT.  OMG issue 3318 concerning sending the code set
    // service context more than once was deemed too much for the
    // RTF.  Here's our strategy for the moment:
    //
    // Send it on every request (necessary in cases of fragmentation
    // with multithreaded clients or when the first thing on a
    // connection is a LocateRequest).  Provide an ORB property
    // to disable multiple sends.
    //
    // Note that the connection is null in the local case and no
    // service context is included.  We use the ORB provided
    // encapsulation streams.
    //
    // Also, there will be no negotiation or service context
    // in GIOP 1.0.  ISO8859-1 is used for char/string, and
    // wchar/wstring are illegal.
    //
    if (giopVersion.equals(GIOPVersion.V1_0) || conn == null)
        return;

    CodeSetComponentInfo.CodeSetContext codeSetCtx = null;

    if (conn.getBroker().getORBData().alwaysSendCodeSetServiceContext() ||
        !conn.isPostInitialContexts()) {

        // Get the negotiated code sets (if any) out of the connection
        codeSetCtx = conn.getCodeSetContext();
    }

    // Either we shouldn't send the code set service context, or
    // for some reason, the connection doesn't have its code sets.
    // Perhaps the server didn't include them in the IOR.  Uses
    // ISO8859-1 for char and makes wchar/wstring illegal.
    if (codeSetCtx == null)
        return;

    CodeSetServiceContext cssc = new CodeSetServiceContext(codeSetCtx);
    ctxs.put(cssc);
}
 
Example 16
/**
 * Handles setting the connection's code sets if required.
 * Returns true if the CodeSetContext was in the request, false
 * otherwise.
 */
protected boolean processCodeSetContext(
    CorbaMessageMediator request, ServiceContexts contexts)
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".processCodeSetContext->: " + opAndId(request));
        }

        ServiceContext sc = contexts.get(
            CodeSetServiceContext.SERVICE_CONTEXT_ID);
        if (sc != null) {
            // Somehow a code set service context showed up in the local case.
            if (request.getConnection() == null) {
                return true;
            }

            // If it's GIOP 1.0, it shouldn't have this context at all.  Our legacy
            // ORBs sent it and we need to know if it's here to make ORB versioning
            // decisions, but we don't use the contents.
            if (request.getGIOPVersion().equals(GIOPVersion.V1_0)) {
                return true;
            }

            CodeSetServiceContext cssc = (CodeSetServiceContext)sc ;
            CodeSetComponentInfo.CodeSetContext csctx = cssc.getCodeSetContext();

            // Note on threading:
            //
            // getCodeSetContext and setCodeSetContext are synchronized
            // on the Connection.  At worst, this will result in
            // multiple threads entering this block and calling
            // setCodeSetContext but not actually changing the
            // values on the Connection.
            //
            // Alternative would be to lock the connection for the
            // whole block, but it's fine either way.

            // The connection's codeSetContext is null until we've received a
            // request with a code set context with the negotiated code sets.
            if (((CorbaConnection)request.getConnection())
                .getCodeSetContext() == null)
            {

                // Use these code sets on this connection
                if (orb.subcontractDebugFlag) {
                    dprint(".processCodeSetContext: " + opAndId(request)
                           + ": Setting code sets to: " + csctx);
                }

                ((CorbaConnection)request.getConnection())
                    .setCodeSetContext(csctx);

                // We had to read the method name using ISO 8859-1
                // (which is the default in the CDRInputStream for
                // char data), but now we may have a new char
                // code set.  If it isn't ISO8859-1, we must tell
                // the CDR stream to null any converter references
                // it has created so that it will reacquire
                // the code sets again using the new info.
                //
                // This should probably compare with the stream's
                // char code set rather than assuming it's ISO8859-1.
                // (However, the operation name is almost certainly
                // ISO8859-1 or ASCII.)
                if (csctx.getCharCodeSet() !=
                    OSFCodeSetRegistry.ISO_8859_1.getNumber()) {
                    ((MarshalInputStream)request.getInputObject())
                        .resetCodeSetConverters();
                }
            }
        }

        // If no code set information is ever sent from the client,
        // the server will use ISO8859-1 for char and throw an
        // exception for any wchar transmissions.
        //
        // In the local case, we use ORB provided streams for
        // marshaling and unmarshaling.  Currently, they use
        // ISO8859-1 for char/string and UTF16 for wchar/wstring.
        return sc != null ;
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".processCodeSetContext<-: " + opAndId(request));
        }
    }
}
 
Example 17
protected void addCodeSetServiceContext(CorbaConnection conn,
                                      ServiceContexts ctxs,
                                      GIOPVersion giopVersion) {

    // REVISIT.  OMG issue 3318 concerning sending the code set
    // service context more than once was deemed too much for the
    // RTF.  Here's our strategy for the moment:
    //
    // Send it on every request (necessary in cases of fragmentation
    // with multithreaded clients or when the first thing on a
    // connection is a LocateRequest).  Provide an ORB property
    // to disable multiple sends.
    //
    // Note that the connection is null in the local case and no
    // service context is included.  We use the ORB provided
    // encapsulation streams.
    //
    // Also, there will be no negotiation or service context
    // in GIOP 1.0.  ISO8859-1 is used for char/string, and
    // wchar/wstring are illegal.
    //
    if (giopVersion.equals(GIOPVersion.V1_0) || conn == null)
        return;

    CodeSetComponentInfo.CodeSetContext codeSetCtx = null;

    if (conn.getBroker().getORBData().alwaysSendCodeSetServiceContext() ||
        !conn.isPostInitialContexts()) {

        // Get the negotiated code sets (if any) out of the connection
        codeSetCtx = conn.getCodeSetContext();
    }

    // Either we shouldn't send the code set service context, or
    // for some reason, the connection doesn't have its code sets.
    // Perhaps the server didn't include them in the IOR.  Uses
    // ISO8859-1 for char and makes wchar/wstring illegal.
    if (codeSetCtx == null)
        return;

    CodeSetServiceContext cssc = new CodeSetServiceContext(codeSetCtx);
    ctxs.put(cssc);
}
 
Example 18
/**
 * Handles setting the connection's code sets if required.
 * Returns true if the CodeSetContext was in the request, false
 * otherwise.
 */
protected boolean processCodeSetContext(
    CorbaMessageMediator request, ServiceContexts contexts)
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".processCodeSetContext->: " + opAndId(request));
        }

        ServiceContext sc = contexts.get(
            CodeSetServiceContext.SERVICE_CONTEXT_ID);
        if (sc != null) {
            // Somehow a code set service context showed up in the local case.
            if (request.getConnection() == null) {
                return true;
            }

            // If it's GIOP 1.0, it shouldn't have this context at all.  Our legacy
            // ORBs sent it and we need to know if it's here to make ORB versioning
            // decisions, but we don't use the contents.
            if (request.getGIOPVersion().equals(GIOPVersion.V1_0)) {
                return true;
            }

            CodeSetServiceContext cssc = (CodeSetServiceContext)sc ;
            CodeSetComponentInfo.CodeSetContext csctx = cssc.getCodeSetContext();

            // Note on threading:
            //
            // getCodeSetContext and setCodeSetContext are synchronized
            // on the Connection.  At worst, this will result in
            // multiple threads entering this block and calling
            // setCodeSetContext but not actually changing the
            // values on the Connection.
            //
            // Alternative would be to lock the connection for the
            // whole block, but it's fine either way.

            // The connection's codeSetContext is null until we've received a
            // request with a code set context with the negotiated code sets.
            if (((CorbaConnection)request.getConnection())
                .getCodeSetContext() == null)
            {

                // Use these code sets on this connection
                if (orb.subcontractDebugFlag) {
                    dprint(".processCodeSetContext: " + opAndId(request)
                           + ": Setting code sets to: " + csctx);
                }

                ((CorbaConnection)request.getConnection())
                    .setCodeSetContext(csctx);

                // We had to read the method name using ISO 8859-1
                // (which is the default in the CDRInputStream for
                // char data), but now we may have a new char
                // code set.  If it isn't ISO8859-1, we must tell
                // the CDR stream to null any converter references
                // it has created so that it will reacquire
                // the code sets again using the new info.
                //
                // This should probably compare with the stream's
                // char code set rather than assuming it's ISO8859-1.
                // (However, the operation name is almost certainly
                // ISO8859-1 or ASCII.)
                if (csctx.getCharCodeSet() !=
                    OSFCodeSetRegistry.ISO_8859_1.getNumber()) {
                    ((MarshalInputStream)request.getInputObject())
                        .resetCodeSetConverters();
                }
            }
        }

        // If no code set information is ever sent from the client,
        // the server will use ISO8859-1 for char and throw an
        // exception for any wchar transmissions.
        //
        // In the local case, we use ORB provided streams for
        // marshaling and unmarshaling.  Currently, they use
        // ISO8859-1 for char/string and UTF16 for wchar/wstring.
        return sc != null ;
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".processCodeSetContext<-: " + opAndId(request));
        }
    }
}
 
Example 19
protected void addCodeSetServiceContext(CorbaConnection conn,
                                      ServiceContexts ctxs,
                                      GIOPVersion giopVersion) {

    // REVISIT.  OMG issue 3318 concerning sending the code set
    // service context more than once was deemed too much for the
    // RTF.  Here's our strategy for the moment:
    //
    // Send it on every request (necessary in cases of fragmentation
    // with multithreaded clients or when the first thing on a
    // connection is a LocateRequest).  Provide an ORB property
    // to disable multiple sends.
    //
    // Note that the connection is null in the local case and no
    // service context is included.  We use the ORB provided
    // encapsulation streams.
    //
    // Also, there will be no negotiation or service context
    // in GIOP 1.0.  ISO8859-1 is used for char/string, and
    // wchar/wstring are illegal.
    //
    if (giopVersion.equals(GIOPVersion.V1_0) || conn == null)
        return;

    CodeSetComponentInfo.CodeSetContext codeSetCtx = null;

    if (conn.getBroker().getORBData().alwaysSendCodeSetServiceContext() ||
        !conn.isPostInitialContexts()) {

        // Get the negotiated code sets (if any) out of the connection
        codeSetCtx = conn.getCodeSetContext();
    }

    // Either we shouldn't send the code set service context, or
    // for some reason, the connection doesn't have its code sets.
    // Perhaps the server didn't include them in the IOR.  Uses
    // ISO8859-1 for char and makes wchar/wstring illegal.
    if (codeSetCtx == null)
        return;

    CodeSetServiceContext cssc = new CodeSetServiceContext(codeSetCtx);
    ctxs.put(cssc);
}
 
Example 20
/**
 * Handles setting the connection's code sets if required.
 * Returns true if the CodeSetContext was in the request, false
 * otherwise.
 */
protected boolean processCodeSetContext(
    CorbaMessageMediator request, ServiceContexts contexts)
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".processCodeSetContext->: " + opAndId(request));
        }

        ServiceContext sc = contexts.get(
            CodeSetServiceContext.SERVICE_CONTEXT_ID);
        if (sc != null) {
            // Somehow a code set service context showed up in the local case.
            if (request.getConnection() == null) {
                return true;
            }

            // If it's GIOP 1.0, it shouldn't have this context at all.  Our legacy
            // ORBs sent it and we need to know if it's here to make ORB versioning
            // decisions, but we don't use the contents.
            if (request.getGIOPVersion().equals(GIOPVersion.V1_0)) {
                return true;
            }

            CodeSetServiceContext cssc = (CodeSetServiceContext)sc ;
            CodeSetComponentInfo.CodeSetContext csctx = cssc.getCodeSetContext();

            // Note on threading:
            //
            // getCodeSetContext and setCodeSetContext are synchronized
            // on the Connection.  At worst, this will result in
            // multiple threads entering this block and calling
            // setCodeSetContext but not actually changing the
            // values on the Connection.
            //
            // Alternative would be to lock the connection for the
            // whole block, but it's fine either way.

            // The connection's codeSetContext is null until we've received a
            // request with a code set context with the negotiated code sets.
            if (((CorbaConnection)request.getConnection())
                .getCodeSetContext() == null)
            {

                // Use these code sets on this connection
                if (orb.subcontractDebugFlag) {
                    dprint(".processCodeSetContext: " + opAndId(request)
                           + ": Setting code sets to: " + csctx);
                }

                ((CorbaConnection)request.getConnection())
                    .setCodeSetContext(csctx);

                // We had to read the method name using ISO 8859-1
                // (which is the default in the CDRInputStream for
                // char data), but now we may have a new char
                // code set.  If it isn't ISO8859-1, we must tell
                // the CDR stream to null any converter references
                // it has created so that it will reacquire
                // the code sets again using the new info.
                //
                // This should probably compare with the stream's
                // char code set rather than assuming it's ISO8859-1.
                // (However, the operation name is almost certainly
                // ISO8859-1 or ASCII.)
                if (csctx.getCharCodeSet() !=
                    OSFCodeSetRegistry.ISO_8859_1.getNumber()) {
                    ((MarshalInputStream)request.getInputObject())
                        .resetCodeSetConverters();
                }
            }
        }

        // If no code set information is ever sent from the client,
        // the server will use ISO8859-1 for char and throw an
        // exception for any wchar transmissions.
        //
        // In the local case, we use ORB provided streams for
        // marshaling and unmarshaling.  Currently, they use
        // ISO8859-1 for char/string and UTF16 for wchar/wstring.
        return sc != null ;
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".processCodeSetContext<-: " + opAndId(request));
        }
    }
}
 
Example 21
protected void addCodeSetServiceContext(CorbaConnection conn,
                                      ServiceContexts ctxs,
                                      GIOPVersion giopVersion) {

    // REVISIT.  OMG issue 3318 concerning sending the code set
    // service context more than once was deemed too much for the
    // RTF.  Here's our strategy for the moment:
    //
    // Send it on every request (necessary in cases of fragmentation
    // with multithreaded clients or when the first thing on a
    // connection is a LocateRequest).  Provide an ORB property
    // to disable multiple sends.
    //
    // Note that the connection is null in the local case and no
    // service context is included.  We use the ORB provided
    // encapsulation streams.
    //
    // Also, there will be no negotiation or service context
    // in GIOP 1.0.  ISO8859-1 is used for char/string, and
    // wchar/wstring are illegal.
    //
    if (giopVersion.equals(GIOPVersion.V1_0) || conn == null)
        return;

    CodeSetComponentInfo.CodeSetContext codeSetCtx = null;

    if (conn.getBroker().getORBData().alwaysSendCodeSetServiceContext() ||
        !conn.isPostInitialContexts()) {

        // Get the negotiated code sets (if any) out of the connection
        codeSetCtx = conn.getCodeSetContext();
    }

    // Either we shouldn't send the code set service context, or
    // for some reason, the connection doesn't have its code sets.
    // Perhaps the server didn't include them in the IOR.  Uses
    // ISO8859-1 for char and makes wchar/wstring illegal.
    if (codeSetCtx == null)
        return;

    CodeSetServiceContext cssc = new CodeSetServiceContext(codeSetCtx);
    ctxs.put(cssc);
}
 
Example 22
/**
 * Handles setting the connection's code sets if required.
 * Returns true if the CodeSetContext was in the request, false
 * otherwise.
 */
protected boolean processCodeSetContext(
    CorbaMessageMediator request, ServiceContexts contexts)
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".processCodeSetContext->: " + opAndId(request));
        }

        ServiceContext sc = contexts.get(
            CodeSetServiceContext.SERVICE_CONTEXT_ID);
        if (sc != null) {
            // Somehow a code set service context showed up in the local case.
            if (request.getConnection() == null) {
                return true;
            }

            // If it's GIOP 1.0, it shouldn't have this context at all.  Our legacy
            // ORBs sent it and we need to know if it's here to make ORB versioning
            // decisions, but we don't use the contents.
            if (request.getGIOPVersion().equals(GIOPVersion.V1_0)) {
                return true;
            }

            CodeSetServiceContext cssc = (CodeSetServiceContext)sc ;
            CodeSetComponentInfo.CodeSetContext csctx = cssc.getCodeSetContext();

            // Note on threading:
            //
            // getCodeSetContext and setCodeSetContext are synchronized
            // on the Connection.  At worst, this will result in
            // multiple threads entering this block and calling
            // setCodeSetContext but not actually changing the
            // values on the Connection.
            //
            // Alternative would be to lock the connection for the
            // whole block, but it's fine either way.

            // The connection's codeSetContext is null until we've received a
            // request with a code set context with the negotiated code sets.
            if (((CorbaConnection)request.getConnection())
                .getCodeSetContext() == null)
            {

                // Use these code sets on this connection
                if (orb.subcontractDebugFlag) {
                    dprint(".processCodeSetContext: " + opAndId(request)
                           + ": Setting code sets to: " + csctx);
                }

                ((CorbaConnection)request.getConnection())
                    .setCodeSetContext(csctx);

                // We had to read the method name using ISO 8859-1
                // (which is the default in the CDRInputStream for
                // char data), but now we may have a new char
                // code set.  If it isn't ISO8859-1, we must tell
                // the CDR stream to null any converter references
                // it has created so that it will reacquire
                // the code sets again using the new info.
                //
                // This should probably compare with the stream's
                // char code set rather than assuming it's ISO8859-1.
                // (However, the operation name is almost certainly
                // ISO8859-1 or ASCII.)
                if (csctx.getCharCodeSet() !=
                    OSFCodeSetRegistry.ISO_8859_1.getNumber()) {
                    ((MarshalInputStream)request.getInputObject())
                        .resetCodeSetConverters();
                }
            }
        }

        // If no code set information is ever sent from the client,
        // the server will use ISO8859-1 for char and throw an
        // exception for any wchar transmissions.
        //
        // In the local case, we use ORB provided streams for
        // marshaling and unmarshaling.  Currently, they use
        // ISO8859-1 for char/string and UTF16 for wchar/wstring.
        return sc != null ;
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".processCodeSetContext<-: " + opAndId(request));
        }
    }
}
 
Example 23
protected void addCodeSetServiceContext(CorbaConnection conn,
                                      ServiceContexts ctxs,
                                      GIOPVersion giopVersion) {

    // REVISIT.  OMG issue 3318 concerning sending the code set
    // service context more than once was deemed too much for the
    // RTF.  Here's our strategy for the moment:
    //
    // Send it on every request (necessary in cases of fragmentation
    // with multithreaded clients or when the first thing on a
    // connection is a LocateRequest).  Provide an ORB property
    // to disable multiple sends.
    //
    // Note that the connection is null in the local case and no
    // service context is included.  We use the ORB provided
    // encapsulation streams.
    //
    // Also, there will be no negotiation or service context
    // in GIOP 1.0.  ISO8859-1 is used for char/string, and
    // wchar/wstring are illegal.
    //
    if (giopVersion.equals(GIOPVersion.V1_0) || conn == null)
        return;

    CodeSetComponentInfo.CodeSetContext codeSetCtx = null;

    if (conn.getBroker().getORBData().alwaysSendCodeSetServiceContext() ||
        !conn.isPostInitialContexts()) {

        // Get the negotiated code sets (if any) out of the connection
        codeSetCtx = conn.getCodeSetContext();
    }

    // Either we shouldn't send the code set service context, or
    // for some reason, the connection doesn't have its code sets.
    // Perhaps the server didn't include them in the IOR.  Uses
    // ISO8859-1 for char and makes wchar/wstring illegal.
    if (codeSetCtx == null)
        return;

    CodeSetServiceContext cssc = new CodeSetServiceContext(codeSetCtx);
    ctxs.put(cssc);
}
 
Example 24
/**
 * Handles setting the connection's code sets if required.
 * Returns true if the CodeSetContext was in the request, false
 * otherwise.
 */
protected boolean processCodeSetContext(
    CorbaMessageMediator request, ServiceContexts contexts)
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".processCodeSetContext->: " + opAndId(request));
        }

        ServiceContext sc = contexts.get(
            CodeSetServiceContext.SERVICE_CONTEXT_ID);
        if (sc != null) {
            // Somehow a code set service context showed up in the local case.
            if (request.getConnection() == null) {
                return true;
            }

            // If it's GIOP 1.0, it shouldn't have this context at all.  Our legacy
            // ORBs sent it and we need to know if it's here to make ORB versioning
            // decisions, but we don't use the contents.
            if (request.getGIOPVersion().equals(GIOPVersion.V1_0)) {
                return true;
            }

            CodeSetServiceContext cssc = (CodeSetServiceContext)sc ;
            CodeSetComponentInfo.CodeSetContext csctx = cssc.getCodeSetContext();

            // Note on threading:
            //
            // getCodeSetContext and setCodeSetContext are synchronized
            // on the Connection.  At worst, this will result in
            // multiple threads entering this block and calling
            // setCodeSetContext but not actually changing the
            // values on the Connection.
            //
            // Alternative would be to lock the connection for the
            // whole block, but it's fine either way.

            // The connection's codeSetContext is null until we've received a
            // request with a code set context with the negotiated code sets.
            if (((CorbaConnection)request.getConnection())
                .getCodeSetContext() == null)
            {

                // Use these code sets on this connection
                if (orb.subcontractDebugFlag) {
                    dprint(".processCodeSetContext: " + opAndId(request)
                           + ": Setting code sets to: " + csctx);
                }

                ((CorbaConnection)request.getConnection())
                    .setCodeSetContext(csctx);

                // We had to read the method name using ISO 8859-1
                // (which is the default in the CDRInputStream for
                // char data), but now we may have a new char
                // code set.  If it isn't ISO8859-1, we must tell
                // the CDR stream to null any converter references
                // it has created so that it will reacquire
                // the code sets again using the new info.
                //
                // This should probably compare with the stream's
                // char code set rather than assuming it's ISO8859-1.
                // (However, the operation name is almost certainly
                // ISO8859-1 or ASCII.)
                if (csctx.getCharCodeSet() !=
                    OSFCodeSetRegistry.ISO_8859_1.getNumber()) {
                    ((MarshalInputStream)request.getInputObject())
                        .resetCodeSetConverters();
                }
            }
        }

        // If no code set information is ever sent from the client,
        // the server will use ISO8859-1 for char and throw an
        // exception for any wchar transmissions.
        //
        // In the local case, we use ORB provided streams for
        // marshaling and unmarshaling.  Currently, they use
        // ISO8859-1 for char/string and UTF16 for wchar/wstring.
        return sc != null ;
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".processCodeSetContext<-: " + opAndId(request));
        }
    }
}
 
Example 25
protected void addCodeSetServiceContext(CorbaConnection conn,
                                      ServiceContexts ctxs,
                                      GIOPVersion giopVersion) {

    // REVISIT.  OMG issue 3318 concerning sending the code set
    // service context more than once was deemed too much for the
    // RTF.  Here's our strategy for the moment:
    //
    // Send it on every request (necessary in cases of fragmentation
    // with multithreaded clients or when the first thing on a
    // connection is a LocateRequest).  Provide an ORB property
    // to disable multiple sends.
    //
    // Note that the connection is null in the local case and no
    // service context is included.  We use the ORB provided
    // encapsulation streams.
    //
    // Also, there will be no negotiation or service context
    // in GIOP 1.0.  ISO8859-1 is used for char/string, and
    // wchar/wstring are illegal.
    //
    if (giopVersion.equals(GIOPVersion.V1_0) || conn == null)
        return;

    CodeSetComponentInfo.CodeSetContext codeSetCtx = null;

    if (conn.getBroker().getORBData().alwaysSendCodeSetServiceContext() ||
        !conn.isPostInitialContexts()) {

        // Get the negotiated code sets (if any) out of the connection
        codeSetCtx = conn.getCodeSetContext();
    }

    // Either we shouldn't send the code set service context, or
    // for some reason, the connection doesn't have its code sets.
    // Perhaps the server didn't include them in the IOR.  Uses
    // ISO8859-1 for char and makes wchar/wstring illegal.
    if (codeSetCtx == null)
        return;

    CodeSetServiceContext cssc = new CodeSetServiceContext(codeSetCtx);
    ctxs.put(cssc);
}
 
Example 26
/**
 * Handles setting the connection's code sets if required.
 * Returns true if the CodeSetContext was in the request, false
 * otherwise.
 */
protected boolean processCodeSetContext(
    CorbaMessageMediator request, ServiceContexts contexts)
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".processCodeSetContext->: " + opAndId(request));
        }

        ServiceContext sc = contexts.get(
            CodeSetServiceContext.SERVICE_CONTEXT_ID);
        if (sc != null) {
            // Somehow a code set service context showed up in the local case.
            if (request.getConnection() == null) {
                return true;
            }

            // If it's GIOP 1.0, it shouldn't have this context at all.  Our legacy
            // ORBs sent it and we need to know if it's here to make ORB versioning
            // decisions, but we don't use the contents.
            if (request.getGIOPVersion().equals(GIOPVersion.V1_0)) {
                return true;
            }

            CodeSetServiceContext cssc = (CodeSetServiceContext)sc ;
            CodeSetComponentInfo.CodeSetContext csctx = cssc.getCodeSetContext();

            // Note on threading:
            //
            // getCodeSetContext and setCodeSetContext are synchronized
            // on the Connection.  At worst, this will result in
            // multiple threads entering this block and calling
            // setCodeSetContext but not actually changing the
            // values on the Connection.
            //
            // Alternative would be to lock the connection for the
            // whole block, but it's fine either way.

            // The connection's codeSetContext is null until we've received a
            // request with a code set context with the negotiated code sets.
            if (((CorbaConnection)request.getConnection())
                .getCodeSetContext() == null)
            {

                // Use these code sets on this connection
                if (orb.subcontractDebugFlag) {
                    dprint(".processCodeSetContext: " + opAndId(request)
                           + ": Setting code sets to: " + csctx);
                }

                ((CorbaConnection)request.getConnection())
                    .setCodeSetContext(csctx);

                // We had to read the method name using ISO 8859-1
                // (which is the default in the CDRInputStream for
                // char data), but now we may have a new char
                // code set.  If it isn't ISO8859-1, we must tell
                // the CDR stream to null any converter references
                // it has created so that it will reacquire
                // the code sets again using the new info.
                //
                // This should probably compare with the stream's
                // char code set rather than assuming it's ISO8859-1.
                // (However, the operation name is almost certainly
                // ISO8859-1 or ASCII.)
                if (csctx.getCharCodeSet() !=
                    OSFCodeSetRegistry.ISO_8859_1.getNumber()) {
                    ((MarshalInputStream)request.getInputObject())
                        .resetCodeSetConverters();
                }
            }
        }

        // If no code set information is ever sent from the client,
        // the server will use ISO8859-1 for char and throw an
        // exception for any wchar transmissions.
        //
        // In the local case, we use ORB provided streams for
        // marshaling and unmarshaling.  Currently, they use
        // ISO8859-1 for char/string and UTF16 for wchar/wstring.
        return sc != null ;
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".processCodeSetContext<-: " + opAndId(request));
        }
    }
}
 
Example 27
protected void addCodeSetServiceContext(CorbaConnection conn,
                                      ServiceContexts ctxs,
                                      GIOPVersion giopVersion) {

    // REVISIT.  OMG issue 3318 concerning sending the code set
    // service context more than once was deemed too much for the
    // RTF.  Here's our strategy for the moment:
    //
    // Send it on every request (necessary in cases of fragmentation
    // with multithreaded clients or when the first thing on a
    // connection is a LocateRequest).  Provide an ORB property
    // to disable multiple sends.
    //
    // Note that the connection is null in the local case and no
    // service context is included.  We use the ORB provided
    // encapsulation streams.
    //
    // Also, there will be no negotiation or service context
    // in GIOP 1.0.  ISO8859-1 is used for char/string, and
    // wchar/wstring are illegal.
    //
    if (giopVersion.equals(GIOPVersion.V1_0) || conn == null)
        return;

    CodeSetComponentInfo.CodeSetContext codeSetCtx = null;

    if (conn.getBroker().getORBData().alwaysSendCodeSetServiceContext() ||
        !conn.isPostInitialContexts()) {

        // Get the negotiated code sets (if any) out of the connection
        codeSetCtx = conn.getCodeSetContext();
    }

    // Either we shouldn't send the code set service context, or
    // for some reason, the connection doesn't have its code sets.
    // Perhaps the server didn't include them in the IOR.  Uses
    // ISO8859-1 for char and makes wchar/wstring illegal.
    if (codeSetCtx == null)
        return;

    CodeSetServiceContext cssc = new CodeSetServiceContext(codeSetCtx);
    ctxs.put(cssc);
}
 
Example 28
/**
 * Handles setting the connection's code sets if required.
 * Returns true if the CodeSetContext was in the request, false
 * otherwise.
 */
protected boolean processCodeSetContext(
    CorbaMessageMediator request, ServiceContexts contexts)
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".processCodeSetContext->: " + opAndId(request));
        }

        ServiceContext sc = contexts.get(
            CodeSetServiceContext.SERVICE_CONTEXT_ID);
        if (sc != null) {
            // Somehow a code set service context showed up in the local case.
            if (request.getConnection() == null) {
                return true;
            }

            // If it's GIOP 1.0, it shouldn't have this context at all.  Our legacy
            // ORBs sent it and we need to know if it's here to make ORB versioning
            // decisions, but we don't use the contents.
            if (request.getGIOPVersion().equals(GIOPVersion.V1_0)) {
                return true;
            }

            CodeSetServiceContext cssc = (CodeSetServiceContext)sc ;
            CodeSetComponentInfo.CodeSetContext csctx = cssc.getCodeSetContext();

            // Note on threading:
            //
            // getCodeSetContext and setCodeSetContext are synchronized
            // on the Connection.  At worst, this will result in
            // multiple threads entering this block and calling
            // setCodeSetContext but not actually changing the
            // values on the Connection.
            //
            // Alternative would be to lock the connection for the
            // whole block, but it's fine either way.

            // The connection's codeSetContext is null until we've received a
            // request with a code set context with the negotiated code sets.
            if (((CorbaConnection)request.getConnection())
                .getCodeSetContext() == null)
            {

                // Use these code sets on this connection
                if (orb.subcontractDebugFlag) {
                    dprint(".processCodeSetContext: " + opAndId(request)
                           + ": Setting code sets to: " + csctx);
                }

                ((CorbaConnection)request.getConnection())
                    .setCodeSetContext(csctx);

                // We had to read the method name using ISO 8859-1
                // (which is the default in the CDRInputStream for
                // char data), but now we may have a new char
                // code set.  If it isn't ISO8859-1, we must tell
                // the CDR stream to null any converter references
                // it has created so that it will reacquire
                // the code sets again using the new info.
                //
                // This should probably compare with the stream's
                // char code set rather than assuming it's ISO8859-1.
                // (However, the operation name is almost certainly
                // ISO8859-1 or ASCII.)
                if (csctx.getCharCodeSet() !=
                    OSFCodeSetRegistry.ISO_8859_1.getNumber()) {
                    ((MarshalInputStream)request.getInputObject())
                        .resetCodeSetConverters();
                }
            }
        }

        // If no code set information is ever sent from the client,
        // the server will use ISO8859-1 for char and throw an
        // exception for any wchar transmissions.
        //
        // In the local case, we use ORB provided streams for
        // marshaling and unmarshaling.  Currently, they use
        // ISO8859-1 for char/string and UTF16 for wchar/wstring.
        return sc != null ;
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".processCodeSetContext<-: " + opAndId(request));
        }
    }
}
 
Example 29
protected void addCodeSetServiceContext(CorbaConnection conn,
                                      ServiceContexts ctxs,
                                      GIOPVersion giopVersion) {

    // REVISIT.  OMG issue 3318 concerning sending the code set
    // service context more than once was deemed too much for the
    // RTF.  Here's our strategy for the moment:
    //
    // Send it on every request (necessary in cases of fragmentation
    // with multithreaded clients or when the first thing on a
    // connection is a LocateRequest).  Provide an ORB property
    // to disable multiple sends.
    //
    // Note that the connection is null in the local case and no
    // service context is included.  We use the ORB provided
    // encapsulation streams.
    //
    // Also, there will be no negotiation or service context
    // in GIOP 1.0.  ISO8859-1 is used for char/string, and
    // wchar/wstring are illegal.
    //
    if (giopVersion.equals(GIOPVersion.V1_0) || conn == null)
        return;

    CodeSetComponentInfo.CodeSetContext codeSetCtx = null;

    if (conn.getBroker().getORBData().alwaysSendCodeSetServiceContext() ||
        !conn.isPostInitialContexts()) {

        // Get the negotiated code sets (if any) out of the connection
        codeSetCtx = conn.getCodeSetContext();
    }

    // Either we shouldn't send the code set service context, or
    // for some reason, the connection doesn't have its code sets.
    // Perhaps the server didn't include them in the IOR.  Uses
    // ISO8859-1 for char and makes wchar/wstring illegal.
    if (codeSetCtx == null)
        return;

    CodeSetServiceContext cssc = new CodeSetServiceContext(codeSetCtx);
    ctxs.put(cssc);
}
 
Example 30
/**
 * Handles setting the connection's code sets if required.
 * Returns true if the CodeSetContext was in the request, false
 * otherwise.
 */
protected boolean processCodeSetContext(
    CorbaMessageMediator request, ServiceContexts contexts)
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".processCodeSetContext->: " + opAndId(request));
        }

        ServiceContext sc = contexts.get(
            CodeSetServiceContext.SERVICE_CONTEXT_ID);
        if (sc != null) {
            // Somehow a code set service context showed up in the local case.
            if (request.getConnection() == null) {
                return true;
            }

            // If it's GIOP 1.0, it shouldn't have this context at all.  Our legacy
            // ORBs sent it and we need to know if it's here to make ORB versioning
            // decisions, but we don't use the contents.
            if (request.getGIOPVersion().equals(GIOPVersion.V1_0)) {
                return true;
            }

            CodeSetServiceContext cssc = (CodeSetServiceContext)sc ;
            CodeSetComponentInfo.CodeSetContext csctx = cssc.getCodeSetContext();

            // Note on threading:
            //
            // getCodeSetContext and setCodeSetContext are synchronized
            // on the Connection.  At worst, this will result in
            // multiple threads entering this block and calling
            // setCodeSetContext but not actually changing the
            // values on the Connection.
            //
            // Alternative would be to lock the connection for the
            // whole block, but it's fine either way.

            // The connection's codeSetContext is null until we've received a
            // request with a code set context with the negotiated code sets.
            if (((CorbaConnection)request.getConnection())
                .getCodeSetContext() == null)
            {

                // Use these code sets on this connection
                if (orb.subcontractDebugFlag) {
                    dprint(".processCodeSetContext: " + opAndId(request)
                           + ": Setting code sets to: " + csctx);
                }

                ((CorbaConnection)request.getConnection())
                    .setCodeSetContext(csctx);

                // We had to read the method name using ISO 8859-1
                // (which is the default in the CDRInputStream for
                // char data), but now we may have a new char
                // code set.  If it isn't ISO8859-1, we must tell
                // the CDR stream to null any converter references
                // it has created so that it will reacquire
                // the code sets again using the new info.
                //
                // This should probably compare with the stream's
                // char code set rather than assuming it's ISO8859-1.
                // (However, the operation name is almost certainly
                // ISO8859-1 or ASCII.)
                if (csctx.getCharCodeSet() !=
                    OSFCodeSetRegistry.ISO_8859_1.getNumber()) {
                    ((MarshalInputStream)request.getInputObject())
                        .resetCodeSetConverters();
                }
            }
        }

        // If no code set information is ever sent from the client,
        // the server will use ISO8859-1 for char and throw an
        // exception for any wchar transmissions.
        //
        // In the local case, we use ORB provided streams for
        // marshaling and unmarshaling.  Currently, they use
        // ISO8859-1 for char/string and UTF16 for wchar/wstring.
        return sc != null ;
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".processCodeSetContext<-: " + opAndId(request));
        }
    }
}