diff options
author | Audrius Meskauskas <audriusa@Bioinformatics.org> | 2006-09-05 21:19:20 +0000 |
---|---|---|
committer | Audrius Meskauskas <audriusa@Bioinformatics.org> | 2006-09-05 21:19:20 +0000 |
commit | bcb0edb7fa2743b694970e929953f28bf275461b (patch) | |
tree | efc9df0da25a82cc18f466e5e5e66be1c72239b7 /gnu/CORBA/Poa | |
parent | a81a9561144992baee2de82317b600ea46c4c8af (diff) | |
download | classpath-bcb0edb7fa2743b694970e929953f28bf275461b.tar.gz |
2006-09-05 Audrius Meskauskas <AudriusA@Bioinformatics.org>
* gnu/CORBA/CollocatedOrbs.java,
gnu/CORBA/SafeForDirectCalls.java: New files.
* gnu/CORBA/NamingService/Binding_iterator_impl.java:
Implement gnu.CORBA.SafeForDirectCalls.
* gnu/CORBA/NamingService/Ext.java: Likewise.
* gnu/CORBA/NamingService/TransientContext.java: Likewise.
* gnu/CORBA/OrbFunctional.java (createIor):Cache the address
of the local host. (ior_to_object): Return the local object
where possible. (run): Register/unregister this ORB.
* gnu/CORBA/Poa/LocalRequest.java (v_invoke): Call gnuPOA.checkDiscarding.
* gnu/CORBA/Poa/gnuPOA.java (checkDiscarding): Made package private.
* gnu/CORBA/Poa/gnuServantObject.java (noRetain): New field.
(constructors): Initialize noRetain. (_invoke): Drop servant
if noRetain is true. (getHandler): Always seach for the new servant
if noRetain is true.
* gnu/CORBA/SimpleDelegate.java (create_request): Implemented.
* NEWS: Added note about the new feature.
Diffstat (limited to 'gnu/CORBA/Poa')
-rw-r--r-- | gnu/CORBA/Poa/LocalRequest.java | 7 | ||||
-rw-r--r-- | gnu/CORBA/Poa/gnuPOA.java | 2 | ||||
-rw-r--r-- | gnu/CORBA/Poa/gnuServantObject.java | 15 |
3 files changed, 19 insertions, 5 deletions
diff --git a/gnu/CORBA/Poa/LocalRequest.java b/gnu/CORBA/Poa/LocalRequest.java index a2c0bb106..4a9ef8d90 100644 --- a/gnu/CORBA/Poa/LocalRequest.java +++ b/gnu/CORBA/Poa/LocalRequest.java @@ -193,11 +193,14 @@ public class LocalRequest extends gnuRequest implements ResponseHandler, /** * Make an invocation and return a stream from where the results can be read. * - * @param the invoke handler (can be null, then it is obtained self + * @param handler the invoke handler (can be null, then it is obtained self * dependently). */ public org.omg.CORBA.portable.InputStream v_invoke(InvokeHandler handler) { + // Check maybe POA is in the discarding mode (will throw TRANSIENT if it is). + poa.checkDiscarding(); + // Local request must be intercepted both by server and request // interceptors. boolean s_intercept = false; @@ -246,7 +249,7 @@ public class LocalRequest extends gnuRequest implements ResponseHandler, s_interceptor.receive_request_service_contexts(s_info); } - + if (handler == null) { handler = object.getHandler(operation(), cookie, false); diff --git a/gnu/CORBA/Poa/gnuPOA.java b/gnu/CORBA/Poa/gnuPOA.java index 460a0a602..34a9f713b 100644 --- a/gnu/CORBA/Poa/gnuPOA.java +++ b/gnu/CORBA/Poa/gnuPOA.java @@ -1582,7 +1582,7 @@ public class gnuPOA * * @throws TRANSIENT if the POA is in discarding mode. */ - private void checkDiscarding() + void checkDiscarding() throws TRANSIENT { if (m_manager.get_state() == State.DISCARDING) diff --git a/gnu/CORBA/Poa/gnuServantObject.java b/gnu/CORBA/Poa/gnuServantObject.java index 020897a45..77b0ff467 100644 --- a/gnu/CORBA/Poa/gnuServantObject.java +++ b/gnu/CORBA/Poa/gnuServantObject.java @@ -129,6 +129,12 @@ public class gnuServantObject extends ObjectImpl * ids are requested from the servant. */ public final String[] repository_ids; + + /** + * True indicates that the NO_RETAIN policy applies for the servant. + * The servant must be discarded after the each call. + */ + boolean noRetain; /** * Create an object with no connected servant. The servant must be set later. @@ -147,6 +153,8 @@ public class gnuServantObject extends ObjectImpl manager = a_poa.the_POAManager(); poa = a_poa; orb = an_orb; + + noRetain = poa.applies(ServantRetentionPolicyValue.NON_RETAIN); } /** @@ -182,6 +190,8 @@ public class gnuServantObject extends ObjectImpl } repository_ids = null; orb = an_orb; + + noRetain = poa != null && poa.applies(ServantRetentionPolicyValue.NON_RETAIN); } /** @@ -222,7 +232,7 @@ public class gnuServantObject extends ObjectImpl boolean forwarding_allowed ) throws gnuForwardRequest { - if (servant != null) + if (servant != null && !noRetain) { return servantToHandler(servant); } @@ -641,13 +651,14 @@ public class gnuServantObject extends ObjectImpl poa.servant_locator.postinvoke(Id, poa, method, cookie.value, servant ); - servant = null; } } } finally { orb.currents.remove(Thread.currentThread()); + if (noRetain) + servant = null; } } catch (ForwardRequest fex) |