下面列出了怎么用org.omg.CORBA.portable.ApplicationException的API类实例代码及写法,或者点击链接到github查看源代码。
public Exception readException( ApplicationException ae )
{
// Note that the exception ID is present in both ae
// and in the input stream from ae. The exception
// reader must actually read the exception ID from
// the stream.
InputStream is = (InputStream)ae.getInputStream() ;
String excName = ae.getId() ;
int index = findDeclaredException( excName ) ;
if (index < 0) {
excName = is.read_string() ;
Exception res = new UnexpectedException( excName ) ;
res.initCause( ae ) ;
return res ;
}
return rws[index].read( is ) ;
}
public Exception readException( ApplicationException ae )
{
// Note that the exception ID is present in both ae
// and in the input stream from ae. The exception
// reader must actually read the exception ID from
// the stream.
InputStream is = (InputStream)ae.getInputStream() ;
String excName = ae.getId() ;
int index = findDeclaredException( excName ) ;
if (index < 0) {
excName = is.read_string() ;
Exception res = new UnexpectedException( excName ) ;
res.initCause( ae ) ;
return res ;
}
return rws[index].read( is ) ;
}
public Exception readException( ApplicationException ae )
{
// Note that the exception ID is present in both ae
// and in the input stream from ae. The exception
// reader must actually read the exception ID from
// the stream.
InputStream is = (InputStream)ae.getInputStream() ;
String excName = ae.getId() ;
int index = findDeclaredException( excName ) ;
if (index < 0) {
excName = is.read_string() ;
Exception res = new UnexpectedException( excName ) ;
res.initCause( ae ) ;
return res ;
}
return rws[index].read( is ) ;
}
public Exception readException( ApplicationException ae )
{
// Note that the exception ID is present in both ae
// and in the input stream from ae. The exception
// reader must actually read the exception ID from
// the stream.
InputStream is = (InputStream)ae.getInputStream() ;
String excName = ae.getId() ;
int index = findDeclaredException( excName ) ;
if (index < 0) {
excName = is.read_string() ;
Exception res = new UnexpectedException( excName ) ;
res.initCause( ae ) ;
return res ;
}
return rws[index].read( is ) ;
}
public Exception readException( ApplicationException ae )
{
// Note that the exception ID is present in both ae
// and in the input stream from ae. The exception
// reader must actually read the exception ID from
// the stream.
InputStream is = (InputStream)ae.getInputStream() ;
String excName = ae.getId() ;
int index = findDeclaredException( excName ) ;
if (index < 0) {
excName = is.read_string() ;
Exception res = new UnexpectedException( excName ) ;
res.initCause( ae ) ;
return res ;
}
return rws[index].read( is ) ;
}
public Exception readException( ApplicationException ae )
{
// Note that the exception ID is present in both ae
// and in the input stream from ae. The exception
// reader must actually read the exception ID from
// the stream.
InputStream is = (InputStream)ae.getInputStream() ;
String excName = ae.getId() ;
int index = findDeclaredException( excName ) ;
if (index < 0) {
excName = is.read_string() ;
Exception res = new UnexpectedException( excName ) ;
res.initCause( ae ) ;
return res ;
}
return rws[index].read( is ) ;
}
public Exception readException( ApplicationException ae )
{
// Note that the exception ID is present in both ae
// and in the input stream from ae. The exception
// reader must actually read the exception ID from
// the stream.
InputStream is = (InputStream)ae.getInputStream() ;
String excName = ae.getId() ;
int index = findDeclaredException( excName ) ;
if (index < 0) {
excName = is.read_string() ;
Exception res = new UnexpectedException( excName ) ;
res.initCause( ae ) ;
return res ;
}
return rws[index].read( is ) ;
}
public Exception readException( ApplicationException ae )
{
// Note that the exception ID is present in both ae
// and in the input stream from ae. The exception
// reader must actually read the exception ID from
// the stream.
InputStream is = (InputStream)ae.getInputStream() ;
String excName = ae.getId() ;
int index = findDeclaredException( excName ) ;
if (index < 0) {
excName = is.read_string() ;
Exception res = new UnexpectedException( excName ) ;
res.initCause( ae ) ;
return res ;
}
return rws[index].read( is ) ;
}
public Exception readException( ApplicationException ae )
{
// Note that the exception ID is present in both ae
// and in the input stream from ae. The exception
// reader must actually read the exception ID from
// the stream.
InputStream is = (InputStream)ae.getInputStream() ;
String excName = ae.getId() ;
int index = findDeclaredException( excName ) ;
if (index < 0) {
excName = is.read_string() ;
Exception res = new UnexpectedException( excName ) ;
res.initCause( ae ) ;
return res ;
}
return rws[index].read( is ) ;
}
public Exception readException( ApplicationException ae )
{
// Note that the exception ID is present in both ae
// and in the input stream from ae. The exception
// reader must actually read the exception ID from
// the stream.
InputStream is = (InputStream)ae.getInputStream() ;
String excName = ae.getId() ;
int index = findDeclaredException( excName ) ;
if (index < 0) {
excName = is.read_string() ;
Exception res = new UnexpectedException( excName ) ;
res.initCause( ae ) ;
return res ;
}
return rws[index].read( is ) ;
}
public InputStream invoke(org.omg.CORBA.Object self, OutputStream output)
throws
ApplicationException,
RemarshalException
{
ClientRequestDispatcher subcontract = getClientRequestDispatcher();
return (InputStream)
subcontract.marshalingComplete((Object)self, (OutputObject)output);
}
/**
* The CORBA::RepositoryId of the exception to be returned to the client.
*/
public String received_exception_id (){
checkAccess( MID_RECEIVED_EXCEPTION_ID );
if( cachedReceivedExceptionId == null ) {
String result = null;
if( exception == null ) {
// Note: exception should never be null here since we will
// throw a BAD_INV_ORDER if this is not called from
// receive_exception.
throw wrapper.exceptionWasNull() ;
} else if( exception instanceof SystemException ) {
String name = exception.getClass().getName();
result = ORBUtility.repositoryIdOf(name);
} else if( exception instanceof ApplicationException ) {
result = ((ApplicationException)exception).getId();
}
// _REVISIT_ We need to be able to handle a UserException in the
// DII case. How do we extract the ID from a UserException?
cachedReceivedExceptionId = result;
}
return cachedReceivedExceptionId;
}
public InputStream invoke(org.omg.CORBA.Object self, OutputStream output)
throws
ApplicationException,
RemarshalException
{
ClientRequestDispatcher subcontract = getClientRequestDispatcher();
return (InputStream)
subcontract.marshalingComplete((Object)self, (OutputObject)output);
}
/**
* The CORBA::RepositoryId of the exception to be returned to the client.
*/
public String received_exception_id (){
checkAccess( MID_RECEIVED_EXCEPTION_ID );
if( cachedReceivedExceptionId == null ) {
String result = null;
if( exception == null ) {
// Note: exception should never be null here since we will
// throw a BAD_INV_ORDER if this is not called from
// receive_exception.
throw wrapper.exceptionWasNull() ;
} else if( exception instanceof SystemException ) {
String name = exception.getClass().getName();
result = ORBUtility.repositoryIdOf(name);
} else if( exception instanceof ApplicationException ) {
result = ((ApplicationException)exception).getId();
}
// _REVISIT_ We need to be able to handle a UserException in the
// DII case. How do we extract the ID from a UserException?
cachedReceivedExceptionId = result;
}
return cachedReceivedExceptionId;
}
public InputStream invoke(org.omg.CORBA.Object self, OutputStream output)
throws
ApplicationException,
RemarshalException
{
ClientRequestDispatcher subcontract = getClientRequestDispatcher();
return (InputStream)
subcontract.marshalingComplete((Object)self, (OutputObject)output);
}
/**
* The CORBA::RepositoryId of the exception to be returned to the client.
*/
public String received_exception_id (){
checkAccess( MID_RECEIVED_EXCEPTION_ID );
if( cachedReceivedExceptionId == null ) {
String result = null;
if( exception == null ) {
// Note: exception should never be null here since we will
// throw a BAD_INV_ORDER if this is not called from
// receive_exception.
throw wrapper.exceptionWasNull() ;
} else if( exception instanceof SystemException ) {
String name = exception.getClass().getName();
result = ORBUtility.repositoryIdOf(name);
} else if( exception instanceof ApplicationException ) {
result = ((ApplicationException)exception).getId();
}
// _REVISIT_ We need to be able to handle a UserException in the
// DII case. How do we extract the ID from a UserException?
cachedReceivedExceptionId = result;
}
return cachedReceivedExceptionId;
}
public InputStream invoke(org.omg.CORBA.Object self, OutputStream output)
throws
ApplicationException,
RemarshalException
{
ClientRequestDispatcher subcontract = getClientRequestDispatcher();
return (InputStream)
subcontract.marshalingComplete((Object)self, (OutputObject)output);
}
/**
* The CORBA::RepositoryId of the exception to be returned to the client.
*/
public String received_exception_id (){
checkAccess( MID_RECEIVED_EXCEPTION_ID );
if( cachedReceivedExceptionId == null ) {
String result = null;
if( exception == null ) {
// Note: exception should never be null here since we will
// throw a BAD_INV_ORDER if this is not called from
// receive_exception.
throw wrapper.exceptionWasNull() ;
} else if( exception instanceof SystemException ) {
String name = exception.getClass().getName();
result = ORBUtility.repositoryIdOf(name);
} else if( exception instanceof ApplicationException ) {
result = ((ApplicationException)exception).getId();
}
// _REVISIT_ We need to be able to handle a UserException in the
// DII case. How do we extract the ID from a UserException?
cachedReceivedExceptionId = result;
}
return cachedReceivedExceptionId;
}
public InputStream invoke(org.omg.CORBA.Object self, OutputStream output)
throws
ApplicationException,
RemarshalException
{
ClientRequestDispatcher subcontract = getClientRequestDispatcher();
return (InputStream)
subcontract.marshalingComplete((Object)self, (OutputObject)output);
}
/**
* The CORBA::RepositoryId of the exception to be returned to the client.
*/
public String received_exception_id (){
checkAccess( MID_RECEIVED_EXCEPTION_ID );
if( cachedReceivedExceptionId == null ) {
String result = null;
if( exception == null ) {
// Note: exception should never be null here since we will
// throw a BAD_INV_ORDER if this is not called from
// receive_exception.
throw wrapper.exceptionWasNull() ;
} else if( exception instanceof SystemException ) {
String name = exception.getClass().getName();
result = ORBUtility.repositoryIdOf(name);
} else if( exception instanceof ApplicationException ) {
result = ((ApplicationException)exception).getId();
}
// _REVISIT_ We need to be able to handle a UserException in the
// DII case. How do we extract the ID from a UserException?
cachedReceivedExceptionId = result;
}
return cachedReceivedExceptionId;
}
public InputStream invoke(org.omg.CORBA.Object self, OutputStream output)
throws
ApplicationException,
RemarshalException
{
ClientRequestDispatcher subcontract = getClientRequestDispatcher();
return (InputStream)
subcontract.marshalingComplete((Object)self, (OutputObject)output);
}
/**
* The CORBA::RepositoryId of the exception to be returned to the client.
*/
public String received_exception_id (){
checkAccess( MID_RECEIVED_EXCEPTION_ID );
if( cachedReceivedExceptionId == null ) {
String result = null;
if( exception == null ) {
// Note: exception should never be null here since we will
// throw a BAD_INV_ORDER if this is not called from
// receive_exception.
throw wrapper.exceptionWasNull() ;
} else if( exception instanceof SystemException ) {
String name = exception.getClass().getName();
result = ORBUtility.repositoryIdOf(name);
} else if( exception instanceof ApplicationException ) {
result = ((ApplicationException)exception).getId();
}
// _REVISIT_ We need to be able to handle a UserException in the
// DII case. How do we extract the ID from a UserException?
cachedReceivedExceptionId = result;
}
return cachedReceivedExceptionId;
}
public InputStream invoke(org.omg.CORBA.Object self, OutputStream output)
throws
ApplicationException,
RemarshalException
{
ClientRequestDispatcher subcontract = getClientRequestDispatcher();
return (InputStream)
subcontract.marshalingComplete((Object)self, (OutputObject)output);
}
/**
* The CORBA::RepositoryId of the exception to be returned to the client.
*/
public String received_exception_id (){
checkAccess( MID_RECEIVED_EXCEPTION_ID );
if( cachedReceivedExceptionId == null ) {
String result = null;
if( exception == null ) {
// Note: exception should never be null here since we will
// throw a BAD_INV_ORDER if this is not called from
// receive_exception.
throw wrapper.exceptionWasNull() ;
} else if( exception instanceof SystemException ) {
String name = exception.getClass().getName();
result = ORBUtility.repositoryIdOf(name);
} else if( exception instanceof ApplicationException ) {
result = ((ApplicationException)exception).getId();
}
// _REVISIT_ We need to be able to handle a UserException in the
// DII case. How do we extract the ID from a UserException?
cachedReceivedExceptionId = result;
}
return cachedReceivedExceptionId;
}
public InputStream invoke(org.omg.CORBA.Object self, OutputStream output)
throws
ApplicationException,
RemarshalException
{
ClientRequestDispatcher subcontract = getClientRequestDispatcher();
return (InputStream)
subcontract.marshalingComplete((Object)self, (OutputObject)output);
}
/**
* The CORBA::RepositoryId of the exception to be returned to the client.
*/
public String received_exception_id (){
checkAccess( MID_RECEIVED_EXCEPTION_ID );
if( cachedReceivedExceptionId == null ) {
String result = null;
if( exception == null ) {
// Note: exception should never be null here since we will
// throw a BAD_INV_ORDER if this is not called from
// receive_exception.
throw wrapper.exceptionWasNull() ;
} else if( exception instanceof SystemException ) {
String name = exception.getClass().getName();
result = ORBUtility.repositoryIdOf(name);
} else if( exception instanceof ApplicationException ) {
result = ((ApplicationException)exception).getId();
}
// _REVISIT_ We need to be able to handle a UserException in the
// DII case. How do we extract the ID from a UserException?
cachedReceivedExceptionId = result;
}
return cachedReceivedExceptionId;
}
public InputStream invoke(org.omg.CORBA.Object self, OutputStream output)
throws
ApplicationException,
RemarshalException
{
ClientRequestDispatcher subcontract = getClientRequestDispatcher();
return (InputStream)
subcontract.marshalingComplete((Object)self, (OutputObject)output);
}
/**
* The CORBA::RepositoryId of the exception to be returned to the client.
*/
public String received_exception_id (){
checkAccess( MID_RECEIVED_EXCEPTION_ID );
if( cachedReceivedExceptionId == null ) {
String result = null;
if( exception == null ) {
// Note: exception should never be null here since we will
// throw a BAD_INV_ORDER if this is not called from
// receive_exception.
throw wrapper.exceptionWasNull() ;
} else if( exception instanceof SystemException ) {
String name = exception.getClass().getName();
result = ORBUtility.repositoryIdOf(name);
} else if( exception instanceof ApplicationException ) {
result = ((ApplicationException)exception).getId();
}
// _REVISIT_ We need to be able to handle a UserException in the
// DII case. How do we extract the ID from a UserException?
cachedReceivedExceptionId = result;
}
return cachedReceivedExceptionId;
}
public InputStream invoke(org.omg.CORBA.Object self, OutputStream output)
throws
ApplicationException,
RemarshalException
{
ClientRequestDispatcher subcontract = getClientRequestDispatcher();
return (InputStream)
subcontract.marshalingComplete((Object)self, (OutputObject)output);
}
/**
* The CORBA::RepositoryId of the exception to be returned to the client.
*/
public String received_exception_id (){
checkAccess( MID_RECEIVED_EXCEPTION_ID );
if( cachedReceivedExceptionId == null ) {
String result = null;
if( exception == null ) {
// Note: exception should never be null here since we will
// throw a BAD_INV_ORDER if this is not called from
// receive_exception.
throw wrapper.exceptionWasNull() ;
} else if( exception instanceof SystemException ) {
String name = exception.getClass().getName();
result = ORBUtility.repositoryIdOf(name);
} else if( exception instanceof ApplicationException ) {
result = ((ApplicationException)exception).getId();
}
// _REVISIT_ We need to be able to handle a UserException in the
// DII case. How do we extract the ID from a UserException?
cachedReceivedExceptionId = result;
}
return cachedReceivedExceptionId;
}