Java Code Examples for org.omg.CORBA.Any#create_input_stream()

The following examples show how to use org.omg.CORBA.Any#create_input_stream() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CorbaAnyEventProducer.java    From cxf with Apache License 2.0 6 votes vote down vote up
private CorbaObjectHandler getAnyContainedType(Any a) {
    CorbaObjectHandler result = null;

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

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

    return result;
}
 
Example 2
Source File: ORBUtility.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public static SystemException extractSystemException(Any any) {
    InputStream in = any.create_input_stream();
    ORB orb = (ORB)(in.orb());
    if ( ! isSystemExceptionTypeCode(any.type(), orb)) {
        throw wrapper.unknownDsiSysex(CompletionStatus.COMPLETED_MAYBE);
    }
    return ORBUtility.readSystemException(in);
}
 
Example 3
Source File: ORBUtility.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public static SystemException extractSystemException(Any any) {
    InputStream in = any.create_input_stream();
    ORB orb = (ORB)(in.orb());
    if ( ! isSystemExceptionTypeCode(any.type(), orb)) {
        throw wrapper.unknownDsiSysex(CompletionStatus.COMPLETED_MAYBE);
    }
    return ORBUtility.readSystemException(in);
}
 
Example 4
Source File: ORBUtility.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public static SystemException extractSystemException(Any any) {
    InputStream in = any.create_input_stream();
    ORB orb = (ORB)(in.orb());
    if ( ! isSystemExceptionTypeCode(any.type(), orb)) {
        throw wrapper.unknownDsiSysex(CompletionStatus.COMPLETED_MAYBE);
    }
    return ORBUtility.readSystemException(in);
}
 
Example 5
Source File: ORBUtility.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public static SystemException extractSystemException(Any any) {
    InputStream in = any.create_input_stream();
    ORB orb = (ORB)(in.orb());
    if ( ! isSystemExceptionTypeCode(any.type(), orb)) {
        throw wrapper.unknownDsiSysex(CompletionStatus.COMPLETED_MAYBE);
    }
    return ORBUtility.readSystemException(in);
}
 
Example 6
Source File: ORBUtility.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public static SystemException extractSystemException(Any any) {
    InputStream in = any.create_input_stream();
    ORB orb = (ORB)(in.orb());
    if ( ! isSystemExceptionTypeCode(any.type(), orb)) {
        throw wrapper.unknownDsiSysex(CompletionStatus.COMPLETED_MAYBE);
    }
    return ORBUtility.readSystemException(in);
}
 
Example 7
Source File: ORBUtility.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public static SystemException extractSystemException(Any any) {
    InputStream in = any.create_input_stream();
    ORB orb = (ORB)(in.orb());
    if ( ! isSystemExceptionTypeCode(any.type(), orb)) {
        throw wrapper.unknownDsiSysex(CompletionStatus.COMPLETED_MAYBE);
    }
    return ORBUtility.readSystemException(in);
}
 
Example 8
Source File: ORBUtility.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public static SystemException extractSystemException(Any any) {
    InputStream in = any.create_input_stream();
    ORB orb = (ORB)(in.orb());
    if ( ! isSystemExceptionTypeCode(any.type(), orb)) {
        throw wrapper.unknownDsiSysex(CompletionStatus.COMPLETED_MAYBE);
    }
    return ORBUtility.readSystemException(in);
}
 
Example 9
Source File: ORBUtility.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public static SystemException extractSystemException(Any any) {
    InputStream in = any.create_input_stream();
    ORB orb = (ORB)(in.orb());
    if ( ! isSystemExceptionTypeCode(any.type(), orb)) {
        throw wrapper.unknownDsiSysex(CompletionStatus.COMPLETED_MAYBE);
    }
    return ORBUtility.readSystemException(in);
}
 
Example 10
Source File: ORBUtility.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public static SystemException extractSystemException(Any any) {
    InputStream in = any.create_input_stream();
    ORB orb = (ORB)(in.orb());
    if ( ! isSystemExceptionTypeCode(any.type(), orb)) {
        throw wrapper.unknownDsiSysex(CompletionStatus.COMPLETED_MAYBE);
    }
    return ORBUtility.readSystemException(in);
}
 
Example 11
Source File: ORBUtility.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public static SystemException extractSystemException(Any any) {
    InputStream in = any.create_input_stream();
    ORB orb = (ORB)(in.orb());
    if ( ! isSystemExceptionTypeCode(any.type(), orb)) {
        throw wrapper.unknownDsiSysex(CompletionStatus.COMPLETED_MAYBE);
    }
    return ORBUtility.readSystemException(in);
}
 
Example 12
Source File: CorbaServerRequestDispatcherImpl.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
/** Must always be called, just after the servant's method returns.
 *  Creates the ReplyMessage header and puts in the transaction context
 *  if necessary.
 */
protected CorbaMessageMediator sendingReply(CorbaMessageMediator req, Any excany)
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".sendingReply/Any->: " + opAndId(req));
        }

        ServiceContexts scs = new ServiceContexts(orb);

        // Check if the servant set a SystemException or
        // UserException
        CorbaMessageMediator resp;
        String repId=null;
        try {
            repId = excany.type().id();
        } catch (org.omg.CORBA.TypeCodePackage.BadKind e) {
            throw wrapper.problemWithExceptionTypecode( e ) ;
        }

        if (ORBUtility.isSystemException(repId)) {
            if (orb.subcontractDebugFlag) {
                dprint(".sendingReply/Any: " + opAndId(req)
                       + ": handling system exception");
            }

            // Get the exception object from the Any
            InputStream in = excany.create_input_stream();
            SystemException ex = ORBUtility.readSystemException(in);
            // Marshal the exception back
            resp = req.getProtocolHandler()
                .createSystemExceptionResponse(req, ex, scs);
        } else {
            if (orb.subcontractDebugFlag) {
                dprint(".sendingReply/Any: " + opAndId(req)
                       + ": handling user exception");
            }

            resp = req.getProtocolHandler()
                .createUserExceptionResponse(req, scs);
            OutputStream os = (OutputStream)resp.getOutputObject();
            excany.write_value(os);
        }

        return resp;
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".sendingReply/Any<-: " + opAndId(req));
        }
    }
}
 
Example 13
Source File: CorbaServerRequestDispatcherImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
/** Must always be called, just after the servant's method returns.
 *  Creates the ReplyMessage header and puts in the transaction context
 *  if necessary.
 */
protected CorbaMessageMediator sendingReply(CorbaMessageMediator req, Any excany)
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".sendingReply/Any->: " + opAndId(req));
        }

        ServiceContexts scs = new ServiceContexts(orb);

        // Check if the servant set a SystemException or
        // UserException
        CorbaMessageMediator resp;
        String repId=null;
        try {
            repId = excany.type().id();
        } catch (org.omg.CORBA.TypeCodePackage.BadKind e) {
            throw wrapper.problemWithExceptionTypecode( e ) ;
        }

        if (ORBUtility.isSystemException(repId)) {
            if (orb.subcontractDebugFlag) {
                dprint(".sendingReply/Any: " + opAndId(req)
                       + ": handling system exception");
            }

            // Get the exception object from the Any
            InputStream in = excany.create_input_stream();
            SystemException ex = ORBUtility.readSystemException(in);
            // Marshal the exception back
            resp = req.getProtocolHandler()
                .createSystemExceptionResponse(req, ex, scs);
        } else {
            if (orb.subcontractDebugFlag) {
                dprint(".sendingReply/Any: " + opAndId(req)
                       + ": handling user exception");
            }

            resp = req.getProtocolHandler()
                .createUserExceptionResponse(req, scs);
            OutputStream os = (OutputStream)resp.getOutputObject();
            excany.write_value(os);
        }

        return resp;
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".sendingReply/Any<-: " + opAndId(req));
        }
    }
}
 
Example 14
Source File: CorbaServerRequestDispatcherImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
/** Must always be called, just after the servant's method returns.
 *  Creates the ReplyMessage header and puts in the transaction context
 *  if necessary.
 */
protected CorbaMessageMediator sendingReply(CorbaMessageMediator req, Any excany)
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".sendingReply/Any->: " + opAndId(req));
        }

        ServiceContexts scs = new ServiceContexts(orb);

        // Check if the servant set a SystemException or
        // UserException
        CorbaMessageMediator resp;
        String repId=null;
        try {
            repId = excany.type().id();
        } catch (org.omg.CORBA.TypeCodePackage.BadKind e) {
            throw wrapper.problemWithExceptionTypecode( e ) ;
        }

        if (ORBUtility.isSystemException(repId)) {
            if (orb.subcontractDebugFlag) {
                dprint(".sendingReply/Any: " + opAndId(req)
                       + ": handling system exception");
            }

            // Get the exception object from the Any
            InputStream in = excany.create_input_stream();
            SystemException ex = ORBUtility.readSystemException(in);
            // Marshal the exception back
            resp = req.getProtocolHandler()
                .createSystemExceptionResponse(req, ex, scs);
        } else {
            if (orb.subcontractDebugFlag) {
                dprint(".sendingReply/Any: " + opAndId(req)
                       + ": handling user exception");
            }

            resp = req.getProtocolHandler()
                .createUserExceptionResponse(req, scs);
            OutputStream os = (OutputStream)resp.getOutputObject();
            excany.write_value(os);
        }

        return resp;
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".sendingReply/Any<-: " + opAndId(req));
        }
    }
}
 
Example 15
Source File: CorbaServerRequestDispatcherImpl.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
/** Must always be called, just after the servant's method returns.
 *  Creates the ReplyMessage header and puts in the transaction context
 *  if necessary.
 */
protected CorbaMessageMediator sendingReply(CorbaMessageMediator req, Any excany)
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".sendingReply/Any->: " + opAndId(req));
        }

        ServiceContexts scs = new ServiceContexts(orb);

        // Check if the servant set a SystemException or
        // UserException
        CorbaMessageMediator resp;
        String repId=null;
        try {
            repId = excany.type().id();
        } catch (org.omg.CORBA.TypeCodePackage.BadKind e) {
            throw wrapper.problemWithExceptionTypecode( e ) ;
        }

        if (ORBUtility.isSystemException(repId)) {
            if (orb.subcontractDebugFlag) {
                dprint(".sendingReply/Any: " + opAndId(req)
                       + ": handling system exception");
            }

            // Get the exception object from the Any
            InputStream in = excany.create_input_stream();
            SystemException ex = ORBUtility.readSystemException(in);
            // Marshal the exception back
            resp = req.getProtocolHandler()
                .createSystemExceptionResponse(req, ex, scs);
        } else {
            if (orb.subcontractDebugFlag) {
                dprint(".sendingReply/Any: " + opAndId(req)
                       + ": handling user exception");
            }

            resp = req.getProtocolHandler()
                .createUserExceptionResponse(req, scs);
            OutputStream os = (OutputStream)resp.getOutputObject();
            excany.write_value(os);
        }

        return resp;
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".sendingReply/Any<-: " + opAndId(req));
        }
    }
}
 
Example 16
Source File: CorbaServerRequestDispatcherImpl.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
/** Must always be called, just after the servant's method returns.
 *  Creates the ReplyMessage header and puts in the transaction context
 *  if necessary.
 */
protected CorbaMessageMediator sendingReply(CorbaMessageMediator req, Any excany)
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".sendingReply/Any->: " + opAndId(req));
        }

        ServiceContexts scs = new ServiceContexts(orb);

        // Check if the servant set a SystemException or
        // UserException
        CorbaMessageMediator resp;
        String repId=null;
        try {
            repId = excany.type().id();
        } catch (org.omg.CORBA.TypeCodePackage.BadKind e) {
            throw wrapper.problemWithExceptionTypecode( e ) ;
        }

        if (ORBUtility.isSystemException(repId)) {
            if (orb.subcontractDebugFlag) {
                dprint(".sendingReply/Any: " + opAndId(req)
                       + ": handling system exception");
            }

            // Get the exception object from the Any
            InputStream in = excany.create_input_stream();
            SystemException ex = ORBUtility.readSystemException(in);
            // Marshal the exception back
            resp = req.getProtocolHandler()
                .createSystemExceptionResponse(req, ex, scs);
        } else {
            if (orb.subcontractDebugFlag) {
                dprint(".sendingReply/Any: " + opAndId(req)
                       + ": handling user exception");
            }

            resp = req.getProtocolHandler()
                .createUserExceptionResponse(req, scs);
            OutputStream os = (OutputStream)resp.getOutputObject();
            excany.write_value(os);
        }

        return resp;
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".sendingReply/Any<-: " + opAndId(req));
        }
    }
}
 
Example 17
Source File: CorbaServerRequestDispatcherImpl.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
/** Must always be called, just after the servant's method returns.
 *  Creates the ReplyMessage header and puts in the transaction context
 *  if necessary.
 */
protected CorbaMessageMediator sendingReply(CorbaMessageMediator req, Any excany)
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".sendingReply/Any->: " + opAndId(req));
        }

        ServiceContexts scs = new ServiceContexts(orb);

        // Check if the servant set a SystemException or
        // UserException
        CorbaMessageMediator resp;
        String repId=null;
        try {
            repId = excany.type().id();
        } catch (org.omg.CORBA.TypeCodePackage.BadKind e) {
            throw wrapper.problemWithExceptionTypecode( e ) ;
        }

        if (ORBUtility.isSystemException(repId)) {
            if (orb.subcontractDebugFlag) {
                dprint(".sendingReply/Any: " + opAndId(req)
                       + ": handling system exception");
            }

            // Get the exception object from the Any
            InputStream in = excany.create_input_stream();
            SystemException ex = ORBUtility.readSystemException(in);
            // Marshal the exception back
            resp = req.getProtocolHandler()
                .createSystemExceptionResponse(req, ex, scs);
        } else {
            if (orb.subcontractDebugFlag) {
                dprint(".sendingReply/Any: " + opAndId(req)
                       + ": handling user exception");
            }

            resp = req.getProtocolHandler()
                .createUserExceptionResponse(req, scs);
            OutputStream os = (OutputStream)resp.getOutputObject();
            excany.write_value(os);
        }

        return resp;
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".sendingReply/Any<-: " + opAndId(req));
        }
    }
}
 
Example 18
Source File: CorbaServerRequestDispatcherImpl.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
/** Must always be called, just after the servant's method returns.
 *  Creates the ReplyMessage header and puts in the transaction context
 *  if necessary.
 */
protected CorbaMessageMediator sendingReply(CorbaMessageMediator req, Any excany)
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".sendingReply/Any->: " + opAndId(req));
        }

        ServiceContexts scs = new ServiceContexts(orb);

        // Check if the servant set a SystemException or
        // UserException
        CorbaMessageMediator resp;
        String repId=null;
        try {
            repId = excany.type().id();
        } catch (org.omg.CORBA.TypeCodePackage.BadKind e) {
            throw wrapper.problemWithExceptionTypecode( e ) ;
        }

        if (ORBUtility.isSystemException(repId)) {
            if (orb.subcontractDebugFlag) {
                dprint(".sendingReply/Any: " + opAndId(req)
                       + ": handling system exception");
            }

            // Get the exception object from the Any
            InputStream in = excany.create_input_stream();
            SystemException ex = ORBUtility.readSystemException(in);
            // Marshal the exception back
            resp = req.getProtocolHandler()
                .createSystemExceptionResponse(req, ex, scs);
        } else {
            if (orb.subcontractDebugFlag) {
                dprint(".sendingReply/Any: " + opAndId(req)
                       + ": handling user exception");
            }

            resp = req.getProtocolHandler()
                .createUserExceptionResponse(req, scs);
            OutputStream os = (OutputStream)resp.getOutputObject();
            excany.write_value(os);
        }

        return resp;
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".sendingReply/Any<-: " + opAndId(req));
        }
    }
}
 
Example 19
Source File: CorbaServerRequestDispatcherImpl.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
/** Must always be called, just after the servant's method returns.
 *  Creates the ReplyMessage header and puts in the transaction context
 *  if necessary.
 */
protected CorbaMessageMediator sendingReply(CorbaMessageMediator req, Any excany)
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".sendingReply/Any->: " + opAndId(req));
        }

        ServiceContexts scs = new ServiceContexts(orb);

        // Check if the servant set a SystemException or
        // UserException
        CorbaMessageMediator resp;
        String repId=null;
        try {
            repId = excany.type().id();
        } catch (org.omg.CORBA.TypeCodePackage.BadKind e) {
            throw wrapper.problemWithExceptionTypecode( e ) ;
        }

        if (ORBUtility.isSystemException(repId)) {
            if (orb.subcontractDebugFlag) {
                dprint(".sendingReply/Any: " + opAndId(req)
                       + ": handling system exception");
            }

            // Get the exception object from the Any
            InputStream in = excany.create_input_stream();
            SystemException ex = ORBUtility.readSystemException(in);
            // Marshal the exception back
            resp = req.getProtocolHandler()
                .createSystemExceptionResponse(req, ex, scs);
        } else {
            if (orb.subcontractDebugFlag) {
                dprint(".sendingReply/Any: " + opAndId(req)
                       + ": handling user exception");
            }

            resp = req.getProtocolHandler()
                .createUserExceptionResponse(req, scs);
            OutputStream os = (OutputStream)resp.getOutputObject();
            excany.write_value(os);
        }

        return resp;
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".sendingReply/Any<-: " + opAndId(req));
        }
    }
}
 
Example 20
Source File: CorbaServerRequestDispatcherImpl.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
/** Must always be called, just after the servant's method returns.
 *  Creates the ReplyMessage header and puts in the transaction context
 *  if necessary.
 */
protected CorbaMessageMediator sendingReply(CorbaMessageMediator req, Any excany)
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".sendingReply/Any->: " + opAndId(req));
        }

        ServiceContexts scs = new ServiceContexts(orb);

        // Check if the servant set a SystemException or
        // UserException
        CorbaMessageMediator resp;
        String repId=null;
        try {
            repId = excany.type().id();
        } catch (org.omg.CORBA.TypeCodePackage.BadKind e) {
            throw wrapper.problemWithExceptionTypecode( e ) ;
        }

        if (ORBUtility.isSystemException(repId)) {
            if (orb.subcontractDebugFlag) {
                dprint(".sendingReply/Any: " + opAndId(req)
                       + ": handling system exception");
            }

            // Get the exception object from the Any
            InputStream in = excany.create_input_stream();
            SystemException ex = ORBUtility.readSystemException(in);
            // Marshal the exception back
            resp = req.getProtocolHandler()
                .createSystemExceptionResponse(req, ex, scs);
        } else {
            if (orb.subcontractDebugFlag) {
                dprint(".sendingReply/Any: " + opAndId(req)
                       + ": handling user exception");
            }

            resp = req.getProtocolHandler()
                .createUserExceptionResponse(req, scs);
            OutputStream os = (OutputStream)resp.getOutputObject();
            excany.write_value(os);
        }

        return resp;
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".sendingReply/Any<-: " + opAndId(req));
        }
    }
}