下面列出了怎么用org.omg.CORBA.portable.RemarshalException的API类实例代码及写法,或者点击链接到github查看源代码。
public InputStream invoke(org.omg.CORBA.Object self, OutputStream output)
throws
ApplicationException,
RemarshalException
{
ClientRequestDispatcher subcontract = getClientRequestDispatcher();
return (InputStream)
subcontract.marshalingComplete((Object)self, (OutputObject)output);
}
public InputStream invoke(org.omg.CORBA.Object self, OutputStream output)
throws
ApplicationException,
RemarshalException
{
ClientRequestDispatcher subcontract = getClientRequestDispatcher();
return (InputStream)
subcontract.marshalingComplete((Object)self, (OutputObject)output);
}
public InputStream invoke(org.omg.CORBA.Object self, OutputStream output)
throws
ApplicationException,
RemarshalException
{
ClientRequestDispatcher subcontract = getClientRequestDispatcher();
return (InputStream)
subcontract.marshalingComplete((Object)self, (OutputObject)output);
}
public InputStream invoke(org.omg.CORBA.Object self, OutputStream output)
throws
ApplicationException,
RemarshalException
{
ClientRequestDispatcher subcontract = getClientRequestDispatcher();
return (InputStream)
subcontract.marshalingComplete((Object)self, (OutputObject)output);
}
public InputStream invoke(org.omg.CORBA.Object self, OutputStream output)
throws
ApplicationException,
RemarshalException
{
ClientRequestDispatcher subcontract = getClientRequestDispatcher();
return (InputStream)
subcontract.marshalingComplete((Object)self, (OutputObject)output);
}
public InputStream invoke(org.omg.CORBA.Object self, OutputStream output)
throws
ApplicationException,
RemarshalException
{
ClientRequestDispatcher subcontract = getClientRequestDispatcher();
return (InputStream)
subcontract.marshalingComplete((Object)self, (OutputObject)output);
}
public InputStream invoke(org.omg.CORBA.Object self, OutputStream output)
throws
ApplicationException,
RemarshalException
{
ClientRequestDispatcher subcontract = getClientRequestDispatcher();
return (InputStream)
subcontract.marshalingComplete((Object)self, (OutputObject)output);
}
public InputStream invoke(org.omg.CORBA.Object self, OutputStream output)
throws
ApplicationException,
RemarshalException
{
ClientRequestDispatcher subcontract = getClientRequestDispatcher();
return (InputStream)
subcontract.marshalingComplete((Object)self, (OutputObject)output);
}
public InputStream invoke(org.omg.CORBA.Object self, OutputStream output)
throws
ApplicationException,
RemarshalException
{
ClientRequestDispatcher subcontract = getClientRequestDispatcher();
return (InputStream)
subcontract.marshalingComplete((Object)self, (OutputObject)output);
}
public InputStream invoke(org.omg.CORBA.Object self, OutputStream output)
throws
ApplicationException,
RemarshalException
{
ClientRequestDispatcher subcontract = getClientRequestDispatcher();
return (InputStream)
subcontract.marshalingComplete((Object)self, (OutputObject)output);
}
public InputObject marshalingComplete1(
ORB orb, CorbaMessageMediator messageMediator)
throws
ApplicationException,
org.omg.CORBA.portable.RemarshalException
{
try {
messageMediator.finishSendingRequest();
if (orb.subcontractDebugFlag) {
dprint(".marshalingComplete: " + opAndId(messageMediator)
+ ": finished sending request");
}
return messageMediator.waitForResponse();
} catch (RuntimeException e) {
if (orb.subcontractDebugFlag) {
dprint(".marshalingComplete: " + opAndId(messageMediator)
+ ": exception: " + e.toString());
}
boolean retry =
getContactInfoListIterator(orb)
.reportException(messageMediator.getContactInfo(), e);
//Bug 6382377: must not lose exception in PI
// Must run interceptor end point before retrying.
Exception newException =
orb.getPIHandler().invokeClientPIEndingPoint(
ReplyMessage.SYSTEM_EXCEPTION, e);
if (retry) {
if (newException == e) {
continueOrThrowSystemOrRemarshal(messageMediator,
new RemarshalException());
} else {
continueOrThrowSystemOrRemarshal(messageMediator,
newException);
}
} else {
if (newException instanceof RuntimeException){
throw (RuntimeException)newException;
}
else if (newException instanceof RemarshalException)
{
throw (RemarshalException)newException;
}
// NOTE: Interceptor ending point will run in releaseReply.
throw e;
}
return null; // for compiler
}
}
protected void continueOrThrowSystemOrRemarshal(
CorbaMessageMediator messageMediator, Exception exception)
throws
SystemException, RemarshalException
{
ORB orb = (ORB) messageMediator.getBroker();
if( exception == null ) {
// do nothing.
} else if( exception instanceof RemarshalException ) {
// REVISIT - unify with PI handling
orb.getInvocationInfo().setIsRetryInvocation(true);
// NOTE - We must unregister the waiter NOW for this request
// since the retry will result in a new request id. Therefore
// the old request id would be lost and we would have a memory
// leak in the responseWaitingRoom.
unregisterWaiter(orb);
if (orb.subcontractDebugFlag) {
dprint(".continueOrThrowSystemOrRemarshal: "
+ opAndId(messageMediator)
+ ": throwing Remarshal");
}
throw (RemarshalException)exception;
} else {
if (orb.subcontractDebugFlag) {
dprint(".continueOrThrowSystemOrRemarshal: "
+ opAndId(messageMediator)
+ ": throwing sex:"
+ exception);
}
throw (SystemException)exception;
}
}
public void invokeClientPIStartingPoint()
throws RemarshalException
{
if( !hasClientInterceptors ) return;
if( !isClientPIEnabledForThisThread() ) return;
// Invoke the starting interception points and record exception
// and reply status info in the info object:
ClientRequestInfoImpl info = peekClientRequestInfoImplStack();
interceptorInvoker.invokeClientInterceptorStartingPoint( info );
// Check reply status. If we will not have another chance later
// to invoke the client ending points, do it now.
short replyStatus = info.getReplyStatus();
if( (replyStatus == SYSTEM_EXCEPTION.value) ||
(replyStatus == LOCATION_FORWARD.value) )
{
// Note: Transport retry cannot happen here since this happens
// before the request hits the wire.
Exception exception = invokeClientPIEndingPoint(
convertPIReplyStatusToReplyMessage( replyStatus ),
info.getException() );
if( exception == null ) {
// Do not throw anything. Otherwise, it must be a
// SystemException, UserException or RemarshalException.
} if( exception instanceof SystemException ) {
throw (SystemException)exception;
} else if( exception instanceof RemarshalException ) {
throw (RemarshalException)exception;
} else if( (exception instanceof UserException) ||
(exception instanceof ApplicationException) ) {
// It should not be possible for an interceptor to throw
// a UserException. By asserting instead of throwing the
// UserException, we need not declare anything but
// RemarshalException in the throws clause.
throw wrapper.exceptionInvalid() ;
}
}
else if( replyStatus != ClientRequestInfoImpl.UNINITIALIZED ) {
throw wrapper.replyStatusNotInit() ;
}
}
public void invokeClientPIStartingPoint()
throws RemarshalException
{
}
public InputObject marshalingComplete1(
ORB orb, CorbaMessageMediator messageMediator)
throws
ApplicationException,
org.omg.CORBA.portable.RemarshalException
{
try {
messageMediator.finishSendingRequest();
if (orb.subcontractDebugFlag) {
dprint(".marshalingComplete: " + opAndId(messageMediator)
+ ": finished sending request");
}
return messageMediator.waitForResponse();
} catch (RuntimeException e) {
if (orb.subcontractDebugFlag) {
dprint(".marshalingComplete: " + opAndId(messageMediator)
+ ": exception: " + e.toString());
}
boolean retry =
getContactInfoListIterator(orb)
.reportException(messageMediator.getContactInfo(), e);
//Bug 6382377: must not lose exception in PI
// Must run interceptor end point before retrying.
Exception newException =
orb.getPIHandler().invokeClientPIEndingPoint(
ReplyMessage.SYSTEM_EXCEPTION, e);
if (retry) {
if (newException == e) {
continueOrThrowSystemOrRemarshal(messageMediator,
new RemarshalException());
} else {
continueOrThrowSystemOrRemarshal(messageMediator,
newException);
}
} else {
if (newException instanceof RuntimeException){
throw (RuntimeException)newException;
}
else if (newException instanceof RemarshalException)
{
throw (RemarshalException)newException;
}
// NOTE: Interceptor ending point will run in releaseReply.
throw e;
}
return null; // for compiler
}
}
protected void continueOrThrowSystemOrRemarshal(
CorbaMessageMediator messageMediator, Exception exception)
throws
SystemException, RemarshalException
{
ORB orb = (ORB) messageMediator.getBroker();
if( exception == null ) {
// do nothing.
} else if( exception instanceof RemarshalException ) {
// REVISIT - unify with PI handling
orb.getInvocationInfo().setIsRetryInvocation(true);
// NOTE - We must unregister the waiter NOW for this request
// since the retry will result in a new request id. Therefore
// the old request id would be lost and we would have a memory
// leak in the responseWaitingRoom.
unregisterWaiter(orb);
if (orb.subcontractDebugFlag) {
dprint(".continueOrThrowSystemOrRemarshal: "
+ opAndId(messageMediator)
+ ": throwing Remarshal");
}
throw (RemarshalException)exception;
} else {
if (orb.subcontractDebugFlag) {
dprint(".continueOrThrowSystemOrRemarshal: "
+ opAndId(messageMediator)
+ ": throwing sex:"
+ exception);
}
throw (SystemException)exception;
}
}
public void invokeClientPIStartingPoint()
throws RemarshalException
{
if( !hasClientInterceptors ) return;
if( !isClientPIEnabledForThisThread() ) return;
// Invoke the starting interception points and record exception
// and reply status info in the info object:
ClientRequestInfoImpl info = peekClientRequestInfoImplStack();
interceptorInvoker.invokeClientInterceptorStartingPoint( info );
// Check reply status. If we will not have another chance later
// to invoke the client ending points, do it now.
short replyStatus = info.getReplyStatus();
if( (replyStatus == SYSTEM_EXCEPTION.value) ||
(replyStatus == LOCATION_FORWARD.value) )
{
// Note: Transport retry cannot happen here since this happens
// before the request hits the wire.
Exception exception = invokeClientPIEndingPoint(
convertPIReplyStatusToReplyMessage( replyStatus ),
info.getException() );
if( exception == null ) {
// Do not throw anything. Otherwise, it must be a
// SystemException, UserException or RemarshalException.
} if( exception instanceof SystemException ) {
throw (SystemException)exception;
} else if( exception instanceof RemarshalException ) {
throw (RemarshalException)exception;
} else if( (exception instanceof UserException) ||
(exception instanceof ApplicationException) ) {
// It should not be possible for an interceptor to throw
// a UserException. By asserting instead of throwing the
// UserException, we need not declare anything but
// RemarshalException in the throws clause.
throw wrapper.exceptionInvalid() ;
}
}
else if( replyStatus != ClientRequestInfoImpl.UNINITIALIZED ) {
throw wrapper.replyStatusNotInit() ;
}
}
public void invokeClientPIStartingPoint()
throws RemarshalException
{
}
public InputObject marshalingComplete1(
ORB orb, CorbaMessageMediator messageMediator)
throws
ApplicationException,
org.omg.CORBA.portable.RemarshalException
{
try {
messageMediator.finishSendingRequest();
if (orb.subcontractDebugFlag) {
dprint(".marshalingComplete: " + opAndId(messageMediator)
+ ": finished sending request");
}
return messageMediator.waitForResponse();
} catch (RuntimeException e) {
if (orb.subcontractDebugFlag) {
dprint(".marshalingComplete: " + opAndId(messageMediator)
+ ": exception: " + e.toString());
}
boolean retry =
getContactInfoListIterator(orb)
.reportException(messageMediator.getContactInfo(), e);
//Bug 6382377: must not lose exception in PI
// Must run interceptor end point before retrying.
Exception newException =
orb.getPIHandler().invokeClientPIEndingPoint(
ReplyMessage.SYSTEM_EXCEPTION, e);
if (retry) {
if (newException == e) {
continueOrThrowSystemOrRemarshal(messageMediator,
new RemarshalException());
} else {
continueOrThrowSystemOrRemarshal(messageMediator,
newException);
}
} else {
if (newException instanceof RuntimeException){
throw (RuntimeException)newException;
}
else if (newException instanceof RemarshalException)
{
throw (RemarshalException)newException;
}
// NOTE: Interceptor ending point will run in releaseReply.
throw e;
}
return null; // for compiler
}
}
protected void continueOrThrowSystemOrRemarshal(
CorbaMessageMediator messageMediator, Exception exception)
throws
SystemException, RemarshalException
{
ORB orb = (ORB) messageMediator.getBroker();
if( exception == null ) {
// do nothing.
} else if( exception instanceof RemarshalException ) {
// REVISIT - unify with PI handling
orb.getInvocationInfo().setIsRetryInvocation(true);
// NOTE - We must unregister the waiter NOW for this request
// since the retry will result in a new request id. Therefore
// the old request id would be lost and we would have a memory
// leak in the responseWaitingRoom.
unregisterWaiter(orb);
if (orb.subcontractDebugFlag) {
dprint(".continueOrThrowSystemOrRemarshal: "
+ opAndId(messageMediator)
+ ": throwing Remarshal");
}
throw (RemarshalException)exception;
} else {
if (orb.subcontractDebugFlag) {
dprint(".continueOrThrowSystemOrRemarshal: "
+ opAndId(messageMediator)
+ ": throwing sex:"
+ exception);
}
throw (SystemException)exception;
}
}
public void invokeClientPIStartingPoint()
throws RemarshalException
{
if( !hasClientInterceptors ) return;
if( !isClientPIEnabledForThisThread() ) return;
// Invoke the starting interception points and record exception
// and reply status info in the info object:
ClientRequestInfoImpl info = peekClientRequestInfoImplStack();
interceptorInvoker.invokeClientInterceptorStartingPoint( info );
// Check reply status. If we will not have another chance later
// to invoke the client ending points, do it now.
short replyStatus = info.getReplyStatus();
if( (replyStatus == SYSTEM_EXCEPTION.value) ||
(replyStatus == LOCATION_FORWARD.value) )
{
// Note: Transport retry cannot happen here since this happens
// before the request hits the wire.
Exception exception = invokeClientPIEndingPoint(
convertPIReplyStatusToReplyMessage( replyStatus ),
info.getException() );
if( exception == null ) {
// Do not throw anything. Otherwise, it must be a
// SystemException, UserException or RemarshalException.
} if( exception instanceof SystemException ) {
throw (SystemException)exception;
} else if( exception instanceof RemarshalException ) {
throw (RemarshalException)exception;
} else if( (exception instanceof UserException) ||
(exception instanceof ApplicationException) ) {
// It should not be possible for an interceptor to throw
// a UserException. By asserting instead of throwing the
// UserException, we need not declare anything but
// RemarshalException in the throws clause.
throw wrapper.exceptionInvalid() ;
}
}
else if( replyStatus != ClientRequestInfoImpl.UNINITIALIZED ) {
throw wrapper.replyStatusNotInit() ;
}
}
public void invokeClientPIStartingPoint()
throws RemarshalException
{
}
public InputObject marshalingComplete1(
ORB orb, CorbaMessageMediator messageMediator)
throws
ApplicationException,
org.omg.CORBA.portable.RemarshalException
{
try {
messageMediator.finishSendingRequest();
if (orb.subcontractDebugFlag) {
dprint(".marshalingComplete: " + opAndId(messageMediator)
+ ": finished sending request");
}
return messageMediator.waitForResponse();
} catch (RuntimeException e) {
if (orb.subcontractDebugFlag) {
dprint(".marshalingComplete: " + opAndId(messageMediator)
+ ": exception: " + e.toString());
}
boolean retry =
getContactInfoListIterator(orb)
.reportException(messageMediator.getContactInfo(), e);
//Bug 6382377: must not lose exception in PI
// Must run interceptor end point before retrying.
Exception newException =
orb.getPIHandler().invokeClientPIEndingPoint(
ReplyMessage.SYSTEM_EXCEPTION, e);
if (retry) {
if (newException == e) {
continueOrThrowSystemOrRemarshal(messageMediator,
new RemarshalException());
} else {
continueOrThrowSystemOrRemarshal(messageMediator,
newException);
}
} else {
if (newException instanceof RuntimeException){
throw (RuntimeException)newException;
}
else if (newException instanceof RemarshalException)
{
throw (RemarshalException)newException;
}
// NOTE: Interceptor ending point will run in releaseReply.
throw e;
}
return null; // for compiler
}
}
protected void continueOrThrowSystemOrRemarshal(
CorbaMessageMediator messageMediator, Exception exception)
throws
SystemException, RemarshalException
{
ORB orb = (ORB) messageMediator.getBroker();
if( exception == null ) {
// do nothing.
} else if( exception instanceof RemarshalException ) {
// REVISIT - unify with PI handling
orb.getInvocationInfo().setIsRetryInvocation(true);
// NOTE - We must unregister the waiter NOW for this request
// since the retry will result in a new request id. Therefore
// the old request id would be lost and we would have a memory
// leak in the responseWaitingRoom.
unregisterWaiter(orb);
if (orb.subcontractDebugFlag) {
dprint(".continueOrThrowSystemOrRemarshal: "
+ opAndId(messageMediator)
+ ": throwing Remarshal");
}
throw (RemarshalException)exception;
} else {
if (orb.subcontractDebugFlag) {
dprint(".continueOrThrowSystemOrRemarshal: "
+ opAndId(messageMediator)
+ ": throwing sex:"
+ exception);
}
throw (SystemException)exception;
}
}
public void invokeClientPIStartingPoint()
throws RemarshalException
{
if( !hasClientInterceptors ) return;
if( !isClientPIEnabledForThisThread() ) return;
// Invoke the starting interception points and record exception
// and reply status info in the info object:
ClientRequestInfoImpl info = peekClientRequestInfoImplStack();
interceptorInvoker.invokeClientInterceptorStartingPoint( info );
// Check reply status. If we will not have another chance later
// to invoke the client ending points, do it now.
short replyStatus = info.getReplyStatus();
if( (replyStatus == SYSTEM_EXCEPTION.value) ||
(replyStatus == LOCATION_FORWARD.value) )
{
// Note: Transport retry cannot happen here since this happens
// before the request hits the wire.
Exception exception = invokeClientPIEndingPoint(
convertPIReplyStatusToReplyMessage( replyStatus ),
info.getException() );
if( exception == null ) {
// Do not throw anything. Otherwise, it must be a
// SystemException, UserException or RemarshalException.
} if( exception instanceof SystemException ) {
throw (SystemException)exception;
} else if( exception instanceof RemarshalException ) {
throw (RemarshalException)exception;
} else if( (exception instanceof UserException) ||
(exception instanceof ApplicationException) ) {
// It should not be possible for an interceptor to throw
// a UserException. By asserting instead of throwing the
// UserException, we need not declare anything but
// RemarshalException in the throws clause.
throw wrapper.exceptionInvalid() ;
}
}
else if( replyStatus != ClientRequestInfoImpl.UNINITIALIZED ) {
throw wrapper.replyStatusNotInit() ;
}
}
public void invokeClientPIStartingPoint()
throws RemarshalException
{
}
public InputObject marshalingComplete1(
ORB orb, CorbaMessageMediator messageMediator)
throws
ApplicationException,
org.omg.CORBA.portable.RemarshalException
{
try {
messageMediator.finishSendingRequest();
if (orb.subcontractDebugFlag) {
dprint(".marshalingComplete: " + opAndId(messageMediator)
+ ": finished sending request");
}
return messageMediator.waitForResponse();
} catch (RuntimeException e) {
if (orb.subcontractDebugFlag) {
dprint(".marshalingComplete: " + opAndId(messageMediator)
+ ": exception: " + e.toString());
}
boolean retry =
getContactInfoListIterator(orb)
.reportException(messageMediator.getContactInfo(), e);
//Bug 6382377: must not lose exception in PI
// Must run interceptor end point before retrying.
Exception newException =
orb.getPIHandler().invokeClientPIEndingPoint(
ReplyMessage.SYSTEM_EXCEPTION, e);
if (retry) {
if (newException == e) {
continueOrThrowSystemOrRemarshal(messageMediator,
new RemarshalException());
} else {
continueOrThrowSystemOrRemarshal(messageMediator,
newException);
}
} else {
if (newException instanceof RuntimeException){
throw (RuntimeException)newException;
}
else if (newException instanceof RemarshalException)
{
throw (RemarshalException)newException;
}
// NOTE: Interceptor ending point will run in releaseReply.
throw e;
}
return null; // for compiler
}
}
protected void continueOrThrowSystemOrRemarshal(
CorbaMessageMediator messageMediator, Exception exception)
throws
SystemException, RemarshalException
{
ORB orb = (ORB) messageMediator.getBroker();
if( exception == null ) {
// do nothing.
} else if( exception instanceof RemarshalException ) {
// REVISIT - unify with PI handling
orb.getInvocationInfo().setIsRetryInvocation(true);
// NOTE - We must unregister the waiter NOW for this request
// since the retry will result in a new request id. Therefore
// the old request id would be lost and we would have a memory
// leak in the responseWaitingRoom.
unregisterWaiter(orb);
if (orb.subcontractDebugFlag) {
dprint(".continueOrThrowSystemOrRemarshal: "
+ opAndId(messageMediator)
+ ": throwing Remarshal");
}
throw (RemarshalException)exception;
} else {
if (orb.subcontractDebugFlag) {
dprint(".continueOrThrowSystemOrRemarshal: "
+ opAndId(messageMediator)
+ ": throwing sex:"
+ exception);
}
throw (SystemException)exception;
}
}
public void invokeClientPIStartingPoint()
throws RemarshalException
{
if( !hasClientInterceptors ) return;
if( !isClientPIEnabledForThisThread() ) return;
// Invoke the starting interception points and record exception
// and reply status info in the info object:
ClientRequestInfoImpl info = peekClientRequestInfoImplStack();
interceptorInvoker.invokeClientInterceptorStartingPoint( info );
// Check reply status. If we will not have another chance later
// to invoke the client ending points, do it now.
short replyStatus = info.getReplyStatus();
if( (replyStatus == SYSTEM_EXCEPTION.value) ||
(replyStatus == LOCATION_FORWARD.value) )
{
// Note: Transport retry cannot happen here since this happens
// before the request hits the wire.
Exception exception = invokeClientPIEndingPoint(
convertPIReplyStatusToReplyMessage( replyStatus ),
info.getException() );
if( exception == null ) {
// Do not throw anything. Otherwise, it must be a
// SystemException, UserException or RemarshalException.
} if( exception instanceof SystemException ) {
throw (SystemException)exception;
} else if( exception instanceof RemarshalException ) {
throw (RemarshalException)exception;
} else if( (exception instanceof UserException) ||
(exception instanceof ApplicationException) ) {
// It should not be possible for an interceptor to throw
// a UserException. By asserting instead of throwing the
// UserException, we need not declare anything but
// RemarshalException in the throws clause.
throw wrapper.exceptionInvalid() ;
}
}
else if( replyStatus != ClientRequestInfoImpl.UNINITIALIZED ) {
throw wrapper.replyStatusNotInit() ;
}
}
public void invokeClientPIStartingPoint()
throws RemarshalException
{
}