本文整理汇总了Java中org.omg.CORBA.TCKind.tk_except方法的典型用法代码示例。如果您正苦于以下问题:Java TCKind.tk_except方法的具体用法?Java TCKind.tk_except怎么用?Java TCKind.tk_except使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.omg.CORBA.TCKind
的用法示例。
在下文中一共展示了TCKind.tk_except方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: set_exception
import org.omg.CORBA.TCKind; //导入方法依赖的package包/类
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.
}