com.sun.corba.se.impl.encoding.MarshalInputStream Java Examples

The following examples show how to use com.sun.corba.se.impl.encoding.MarshalInputStream. 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: CodeSetServiceContext.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public CodeSetServiceContext(InputStream is, GIOPVersion gv)
{
    super(is, gv) ;
    csc = new CodeSetComponentInfo.CodeSetContext() ;
    csc.read( (MarshalInputStream)in ) ;
}
 
Example #2
Source File: CodeSetsComponentImpl.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public CodeSetsComponentImpl( InputStream is )
{
    csci = new CodeSetComponentInfo() ;
    csci.read( (MarshalInputStream)is ) ;
}
 
Example #3
Source File: CorbaServerRequestDispatcherImpl.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * 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 #4
Source File: CodeSetServiceContext.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public CodeSetServiceContext(InputStream is, GIOPVersion gv)
{
    super(is, gv) ;
    csc = new CodeSetComponentInfo.CodeSetContext() ;
    csc.read( (MarshalInputStream)in ) ;
}
 
Example #5
Source File: CodeSetsComponentImpl.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public CodeSetsComponentImpl( InputStream is )
{
    csci = new CodeSetComponentInfo() ;
    csci.read( (MarshalInputStream)is ) ;
}
 
Example #6
Source File: CorbaServerRequestDispatcherImpl.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
/**
 * 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 #7
Source File: CodeSetServiceContext.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public CodeSetServiceContext(InputStream is, GIOPVersion gv)
{
    super(is, gv) ;
    csc = new CodeSetComponentInfo.CodeSetContext() ;
    csc.read( (MarshalInputStream)in ) ;
}
 
Example #8
Source File: CodeSetsComponentImpl.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public CodeSetsComponentImpl( InputStream is )
{
    csci = new CodeSetComponentInfo() ;
    csci.read( (MarshalInputStream)is ) ;
}
 
Example #9
Source File: CorbaServerRequestDispatcherImpl.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
/**
 * 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 #10
Source File: CodeSetServiceContext.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public CodeSetServiceContext(InputStream is, GIOPVersion gv)
{
    super(is, gv) ;
    csc = new CodeSetComponentInfo.CodeSetContext() ;
    csc.read( (MarshalInputStream)in ) ;
}
 
Example #11
Source File: CodeSetsComponentImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public CodeSetsComponentImpl( InputStream is )
{
    csci = new CodeSetComponentInfo() ;
    csci.read( (MarshalInputStream)is ) ;
}
 
Example #12
Source File: CorbaServerRequestDispatcherImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * 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
Source File: CodeSetServiceContext.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public CodeSetServiceContext(InputStream is, GIOPVersion gv)
{
    super(is, gv) ;
    csc = new CodeSetComponentInfo.CodeSetContext() ;
    csc.read( (MarshalInputStream)in ) ;
}
 
Example #14
Source File: CodeSetsComponentImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public CodeSetsComponentImpl( InputStream is )
{
    csci = new CodeSetComponentInfo() ;
    csci.read( (MarshalInputStream)is ) ;
}
 
Example #15
Source File: CorbaServerRequestDispatcherImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
/**
 * 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 #16
Source File: CodeSetServiceContext.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
public CodeSetServiceContext(InputStream is, GIOPVersion gv)
{
    super(is, gv) ;
    csc = new CodeSetComponentInfo.CodeSetContext() ;
    csc.read( (MarshalInputStream)in ) ;
}
 
Example #17
Source File: CodeSetsComponentImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public CodeSetsComponentImpl( InputStream is )
{
    csci = new CodeSetComponentInfo() ;
    csci.read( (MarshalInputStream)is ) ;
}
 
Example #18
Source File: CorbaServerRequestDispatcherImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
/**
 * 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
Source File: CodeSetServiceContext.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public CodeSetServiceContext(InputStream is, GIOPVersion gv)
{
    super(is, gv) ;
    csc = new CodeSetComponentInfo.CodeSetContext() ;
    csc.read( (MarshalInputStream)in ) ;
}
 
Example #20
Source File: CodeSetsComponentImpl.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
public CodeSetsComponentImpl( InputStream is )
{
    csci = new CodeSetComponentInfo() ;
    csci.read( (MarshalInputStream)is ) ;
}
 
Example #21
Source File: CorbaServerRequestDispatcherImpl.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
/**
 * 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 #22
Source File: CodeSetServiceContext.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
public CodeSetServiceContext(InputStream is, GIOPVersion gv)
{
    super(is, gv) ;
    csc = new CodeSetComponentInfo.CodeSetContext() ;
    csc.read( (MarshalInputStream)in ) ;
}
 
Example #23
Source File: CodeSetsComponentImpl.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public CodeSetsComponentImpl( InputStream is )
{
    csci = new CodeSetComponentInfo() ;
    csci.read( (MarshalInputStream)is ) ;
}
 
Example #24
Source File: CorbaServerRequestDispatcherImpl.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * 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
Source File: CodeSetServiceContext.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public CodeSetServiceContext(InputStream is, GIOPVersion gv)
{
    super(is, gv) ;
    csc = new CodeSetComponentInfo.CodeSetContext() ;
    csc.read( (MarshalInputStream)in ) ;
}
 
Example #26
Source File: CodeSetsComponentImpl.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public CodeSetsComponentImpl( InputStream is )
{
    csci = new CodeSetComponentInfo() ;
    csci.read( (MarshalInputStream)is ) ;
}
 
Example #27
Source File: CorbaServerRequestDispatcherImpl.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * 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 #28
Source File: CodeSetServiceContext.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public CodeSetServiceContext(InputStream is, GIOPVersion gv)
{
    super(is, gv) ;
    csc = new CodeSetComponentInfo.CodeSetContext() ;
    csc.read( (MarshalInputStream)in ) ;
}
 
Example #29
Source File: CodeSetsComponentImpl.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
public CodeSetsComponentImpl( InputStream is )
{
    csci = new CodeSetComponentInfo() ;
    csci.read( (MarshalInputStream)is ) ;
}
 
Example #30
Source File: CorbaServerRequestDispatcherImpl.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
/**
 * 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));
        }
    }
}