leif 2002/10/25 12:05:25
Modified: altrmi/src/java/org/apache/excalibur/altrmi/client/impl
DefaultProxyHelper.java
Log:
Added some code so that failures executing a GarbageCollectionRequest do not
cause an error to be thrown. This seems safe as there is nothing to do about it
anyway. This was necessary in the case where the server process is restarted
quickly. The client will try to GC a remote object created in server #1 in the the
new server #2. That object does not exist and an error is thrown.
Revision Changes Path
1.13 +16 -3
jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/DefaultProxyHelper.java
Index: DefaultProxyHelper.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/client/impl/DefaultProxyHelper.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- DefaultProxyHelper.java 4 Sep 2002 11:01:23 -0000 1.12
+++ DefaultProxyHelper.java 25 Oct 2002 19:05:25 -0000 1.13
@@ -379,8 +379,21 @@
.handleInvocation( new GarbageCollectionRequest(
mPublishedServiceName,
mObjectName,
mSession,
mReferenceID ) );
- if (!(reply instanceof GarbageCollectionReply)) {
- System.err.println("----> Some problem during DGC! Make sure
factory is closed.");
+ if (reply instanceof ExceptionReply) {
+ // This happens if the object can not be GCed on the remote server
+ // for any reason.
+ // There is nothing that we can do about it from here, so just let
+ // this fall through.
+ // One case where this can happen is if the server is restarted
quickly.
+ // An object created in one ivocation will try to be gced in the
second
+ // invocation. As the object does not exist, an error is thrown.
+ /*
+ System.out.println("----> Got an ExceptionReply in response to a
GarbageCollectionRequest" );
+ ExceptionReply er = (ExceptionReply)reply;
+ er.getReplyException().printStackTrace();
+ */
+ } else if (!(reply instanceof GarbageCollectionReply)) {
+ System.err.println("----> Some problem during DGC! Make sure
factory is closed. ");
}
}
super.finalize();
--
To unsubscribe, e-mail: <mailto:avalon-cvs-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@;jakarta.apache.org>