Java Code Examples for org.omg.CORBA.TCKind.tk_except()

The following are Jave code examples for showing how to use tk_except() of the org.omg.CORBA.TCKind class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: OpenJSharp   File: ServerRequestImpl.java   View Source Code Vote up 5 votes
public void set_exception(Any exc)
{
    // except can be called by the DIR at any time (CORBA 2.2 section 6.3).

    if ( exc == null )
        throw _wrapper.setExceptionCalledNullArgs() ;

    // Ensure that the Any contains a SystemException or a
    // UserException. If the UserException is not a declared exception,
    // the client will get an UNKNOWN exception.
    TCKind kind = exc.type().kind();
    if ( kind != TCKind.tk_except )
        throw _wrapper.setExceptionCalledBadType() ;

    _exception = exc;

    // Inform Portable interceptors of the exception that was set
    // so sending_exception can return the right value.
    _orb.getPIHandler().setServerPIExceptionInfo( _exception );

    // The user can only call arguments once and not at all after
    // set_exception.  (internal flags ensure this).  However, the user
    // can call set_exception multiple times.  Therefore, we only
    // invoke receive_request the first time set_exception is
    // called (if they haven't already called arguments).
    if( !_exceptionSet && !_paramsCalled ) {
        // We need to invoke intermediate points here.
        _orb.getPIHandler().invokeServerPIIntermediatePoint();
    }

    _exceptionSet = true;

    // actual marshaling of the reply msg header and exception takes place
    // after the DSI returns control to the ORB.
}
 
Example 2
Project: openjdk-jdk10   File: ServerRequestImpl.java   View Source Code Vote up 5 votes
public void set_exception(Any exc)
{
    // except can be called by the DIR at any time (CORBA 2.2 section 6.3).

    if ( exc == null )
        throw _wrapper.setExceptionCalledNullArgs() ;

    // Ensure that the Any contains a SystemException or a
    // UserException. If the UserException is not a declared exception,
    // the client will get an UNKNOWN exception.
    TCKind kind = exc.type().kind();
    if ( kind != TCKind.tk_except )
        throw _wrapper.setExceptionCalledBadType() ;

    _exception = exc;

    // Inform Portable interceptors of the exception that was set
    // so sending_exception can return the right value.
    _orb.getPIHandler().setServerPIExceptionInfo( _exception );

    // The user can only call arguments once and not at all after
    // set_exception.  (internal flags ensure this).  However, the user
    // can call set_exception multiple times.  Therefore, we only
    // invoke receive_request the first time set_exception is
    // called (if they haven't already called arguments).
    if( !_exceptionSet && !_paramsCalled ) {
        // We need to invoke intermediate points here.
        _orb.getPIHandler().invokeServerPIIntermediatePoint();
    }

    _exceptionSet = true;

    // actual marshaling of the reply msg header and exception takes place
    // after the DSI returns control to the ORB.
}