diff options
author | Audrius Meskauskas <audriusa@Bioinformatics.org> | 2005-08-28 11:23:35 +0000 |
---|---|---|
committer | Audrius Meskauskas <audriusa@Bioinformatics.org> | 2005-08-28 11:23:35 +0000 |
commit | 0c6db14fe37c570414a6f9d9ea41538675363ecc (patch) | |
tree | 92fb65bc25fa27c6bd9740628b816206cdd3e460 /gnu/CORBA/Poa/LocalDelegate.java | |
parent | 5d6e63e8fc39b60710c81700f3faa7cdd21eeb60 (diff) | |
download | classpath-0c6db14fe37c570414a6f9d9ea41538675363ecc.tar.gz |
2005-08-28 <AudriusA@Bioinformatics.org>
* gnu/CORBA/Interceptor/ForwardRequestHolder.java,
gnu/CORBA/Interceptor/gnuClientRequestInfo.java,
gnu/CORBA/Interceptor/gnuIcCurrent.java,
gnu/CORBA/Interceptor/gnuIorInfo.java,
gnu/CORBA/Interceptor/gnuServerRequestInfo.java,
gnu/CORBA/Interceptor/IORInterceptors.java,
gnu/CORBA/Interceptor/ClientRequestInterceptors.java,
gnu/CORBA/Interceptor/Registrator.java,
gnu/CORBA/Interceptor/ServerRequestInterceptors.java,
gnu/CORBA/GIOP/contextSupportingHeader.java,
org/omg/PortableInterceptor/ClientRequestInfo.java,
org/omg/PortableInterceptor/ClientRequestInfoOperations.java,
org/omg/PortableInterceptor/ClientRequestInterceptor.java,
org/omg/PortableInterceptor/ClientRequestInterceptorOperations.java,
org/omg/PortableInterceptor/Current.java,
org/omg/PortableInterceptor/CurrentHelper.java,
org/omg/PortableInterceptor/CurrentOperations.java,
org/omg/PortableInterceptor/ForwardRequest.java,
org/omg/PortableInterceptor/ForwardRequestHelper.java,
org/omg/PortableInterceptor/InvalidSlot.java,
org/omg/PortableInterceptor/InvalidSlotHelper.java,
org/omg/PortableInterceptor/ORBInitInfo.java,
org/omg/PortableInterceptor/ORBInitInfoOperations.java,
org/omg/PortableInterceptor/ORBInitializer.java,
org/omg/PortableInterceptor/ORBInitializerOperations.java,
org/omg/PortableInterceptor/PolicyFactory.java,
org/omg/PortableInterceptor/PolicyFactoryOperations.java,
org/omg/PortableInterceptor/RequestInfo.java,
org/omg/PortableInterceptor/RequestInfoOperations.java,
org/omg/PortableInterceptor/ServerRequestInfo.java,
org/omg/PortableInterceptor/ServerRequestInfoOperations.java,
org/omg/PortableInterceptor/ServerRequestInterceptor.java,
org/omg/PortableInterceptor/ServerRequestInterceptorOperations.java,
org/omg/PortableInterceptor/package.html: New files.
* gnu/CORBA/ExceptionCreator.java,
gnu/CORBA/Functional_ORB.java,
gnu/CORBA/IOR.java,
gnu/CORBA/IOR_Delegate.java,
gnu/CORBA/ObjectCreator.java,
gnu/CORBA/Restricted_ORB.java,
gnu/CORBA/bufferedResponseHandler.java,
gnu/CORBA/gnuCodecFactory.java,
gnu/CORBA/gnuRequest.java,
gnu/CORBA/primitiveArrayTypeCode.java,
gnu/CORBA/primitiveTypeCode.java,
gnu/CORBA/CDR/Vio.java,
gnu/CORBA/CDR/cdrOutput.java,
gnu/CORBA/DynAn/gnuDynAny.java,
gnu/CORBA/DynAn/gnuDynEnum.java,
gnu/CORBA/DynAn/gnuDynFixed.java,
gnu/CORBA/DynAn/gnuDynValue.java,
gnu/CORBA/GIOP/ReplyHeader.java,
gnu/CORBA/GIOP/RequestHeader.java,
gnu/CORBA/GIOP/ServiceContext.java,
gnu/CORBA/GIOP/v1_0/RequestHeader.java,
gnu/CORBA/Poa/LocalDelegate.java,
gnu/CORBA/Poa/LocalRequest.java,
gnu/CORBA/Poa/ORB_1_4.java,
gnu/CORBA/Poa/gnuServantObject.java,
gnu/CORBA/Poa/servantDelegate.java,
org/omg/CORBA/ServiceDetailHelper.java,
org/omg/CORBA/DynAnyPackage/Invalid.java,
org/omg/CORBA/DynAnyPackage/InvalidSeq.java,
org/omg/CORBA/DynAnyPackage/InvalidValue.java,
org/omg/CORBA/DynAnyPackage/TypeMismatch.java,
org/omg/DynamicAny/NameDynAnyPairSeqHelper.java,
org/omg/DynamicAny/_DynAnyFactoryStub.java,
org/omg/DynamicAny/_DynAnyStub.java,
org/omg/DynamicAny/_DynArrayStub.java,
org/omg/DynamicAny/_DynEnumStub.java,
org/omg/DynamicAny/_DynFixedStub.java,
org/omg/DynamicAny/_DynSequenceStub.java,
org/omg/DynamicAny/_DynStructStub.java,
org/omg/DynamicAny/_DynUnionStub.java,
org/omg/DynamicAny/_DynValueStub.java,
org/omg/IOP/ServiceContext.java,
org/omg/IOP/TaggedComponentHelper.java,
org/omg/IOP/TaggedProfileHelper.java,
org/omg/PortableInterceptor/IORInfo.java,
org/omg/PortableInterceptor/IORInfoOperations.java,
org/omg/PortableInterceptor/IORInterceptor.java,
org/omg/PortableInterceptor/IORInterceptorOperations.java,
org/omg/PortableInterceptor/Interceptor.java,
org/omg/PortableInterceptor/LOCATION_FORWARD.java,
org/omg/PortableInterceptor/SUCCESSFUL.java,
org/omg/PortableInterceptor/SYSTEM_EXCEPTION.java,
org/omg/PortableInterceptor/TRANSPORT_RETRY.java,
org/omg/PortableInterceptor/USER_EXCEPTION.java,
org/omg/PortableInterceptor/ORBInitInfoPackage/DuplicateName.java,
org/omg/PortableInterceptor/ORBInitInfoPackage/DuplicateNameHelper.java,
org/omg/PortableInterceptor/ORBInitInfoPackage/InvalidName.java,
org/omg/PortableInterceptor/ORBInitInfoPackage/InvalidNameHelper.java,
org/omg/PortableInterceptor/ORBInitInfoPackage/ObjectIdHelper.java: Rewritten.
* org/omg/CORBA/ORB.java,
org/omg/CORBA/package.html,
NEWS: Documentation update.
Diffstat (limited to 'gnu/CORBA/Poa/LocalDelegate.java')
-rw-r--r-- | gnu/CORBA/Poa/LocalDelegate.java | 160 |
1 files changed, 90 insertions, 70 deletions
diff --git a/gnu/CORBA/Poa/LocalDelegate.java b/gnu/CORBA/Poa/LocalDelegate.java index 950e6e2ff..7af3369d2 100644 --- a/gnu/CORBA/Poa/LocalDelegate.java +++ b/gnu/CORBA/Poa/LocalDelegate.java @@ -59,21 +59,19 @@ import org.omg.CORBA.portable.InputStream; import org.omg.CORBA.portable.InvokeHandler; import org.omg.CORBA.portable.ObjectImpl; import org.omg.CORBA.portable.OutputStream; -import org.omg.CORBA_2_3.portable.Delegate; +import org.omg.CORBA.portable.RemarshalException; import org.omg.PortableServer.ServantLocatorPackage.CookieHolder; import java.util.Arrays; /** - * A local delegate, transferring all object requests to the locally - * available servant. This class is involved in handling the method - * invocations on the local object, obtained by - * POA.create_reference_with_id. + * A local delegate, transferring all object requests to the locally available + * servant. This class is involved in handling the method invocations on the + * local object, obtained by POA.create_reference_with_id. * * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) */ -public class LocalDelegate - extends org.omg.CORBA_2_3.portable.Delegate +public class LocalDelegate extends org.omg.CORBA_2_3.portable.Delegate { /** * The same servant as an invocation handler. @@ -84,8 +82,8 @@ public class LocalDelegate final byte[] Id; /** - * Create a local delegate, forwarding requests to the - * servant that must also be an invocation handler. + * Create a local delegate, forwarding requests to the servant that must also + * be an invocation handler. */ public LocalDelegate(gnuServantObject an_object, gnuPOA a_poa, byte[] an_id) { @@ -109,8 +107,8 @@ public class LocalDelegate } public boolean is_equivalent(org.omg.CORBA.Object target, - org.omg.CORBA.Object other - ) + org.omg.CORBA.Object other + ) { if (target == other) return true; @@ -159,10 +157,10 @@ public class LocalDelegate /** * Check if this object could be named by the given repository id. + * * @param idl_id the repository id to check. * - * @return true if it is one of the possible repository ids of this - * object. + * @return true if it is one of the possible repository ids of this object. */ public boolean is_a(org.omg.CORBA.Object a_servant, String idl_id) { @@ -187,10 +185,9 @@ public class LocalDelegate * Create request for using with DII. */ public Request create_request(org.omg.CORBA.Object target, Context context, - String method, NVList parameters, - NamedValue returns, ExceptionList exceptions, - ContextList ctx_list - ) + String method, NVList parameters, NamedValue returns, + ExceptionList exceptions, ContextList ctx_list + ) { operation = method; @@ -207,9 +204,8 @@ public class LocalDelegate * Create request for using with DII. */ public Request create_request(org.omg.CORBA.Object target, Context context, - String method, NVList parameters, - NamedValue returns - ) + String method, NVList parameters, NamedValue returns + ) { operation = method; @@ -237,10 +233,11 @@ public class LocalDelegate * * @return the stream where the method arguments should be written. */ - public org.omg.CORBA.portable.OutputStream request(org.omg.CORBA.Object target, - String method, - boolean response_expected - ) + public org.omg.CORBA.portable.OutputStream request( + org.omg.CORBA.Object target, + String method, + boolean response_expected + ) { operation = method; @@ -285,74 +282,97 @@ public class LocalDelegate * Make an invocation. * * @param target not in use. - * @param output the stream request that should be returned by {@link #request} - * in this method. - * @throws ApplicationException if the use exception is thrown by - * the servant method. + * @param output the stream request that should be returned by + * {@link #m_request} in this method. + * @throws ApplicationException if the use exception is thrown by the servant + * method. */ public InputStream invoke(org.omg.CORBA.Object target, OutputStream output) - throws ApplicationException + throws ApplicationException { - streamRequest sr = (streamRequest) output; - - LocalRequest lr = (LocalRequest) sr.request; - InvokeHandler handler = lr.object.getHandler(lr.operation(), lr.cookie, false); - - if (handler instanceof dynImpHandler) + try { - // The local request known how to handle it, but the different - // method must be called. - lr.invoke(); + streamRequest sr = (streamRequest) output; - // The encapsulation will inherit orb, endian, charsets, etc. - cdrOutput buf = sr.createEncapsulation(); + LocalRequest lr = (LocalRequest) sr.request; + InvokeHandler handler = + lr.object.getHandler(lr.operation(), lr.cookie, false); - // Write all request parameters to the buffer stream. - if (lr.env().exception() != null) + if (handler instanceof dynImpHandler) { + // The local request known how to handle it, but the different + // method must be called. + lr.invoke(); + + // The encapsulation will inherit orb, endian, charsets, etc. + cdrOutput buf = sr.createEncapsulation(); + + // Write all request parameters to the buffer stream. + if (lr.env().exception() != null) + { + try + { + UnknownUserException uex = + (UnknownUserException) lr.env().exception(); + throw new ApplicationException(uex.except.type().id(), + uex.except.create_input_stream() + ); + } + catch (BadKind ex) + { + InternalError ierr = new InternalError(); + ierr.initCause(ex); + throw ierr; + } + } + if (lr.return_value() != null) + lr.return_value().write_value(buf); + + NamedValue a; try { - UnknownUserException uex = - (UnknownUserException) lr.env().exception(); - throw new ApplicationException(uex.except.type().id(), - uex.except.create_input_stream() - ); + for (int i = 0; i < lr.arguments().count(); i++) + { + a = lr.arguments().item(i); + if (a.flags() == ARG_INOUT.value || + a.flags() == ARG_INOUT.value + ) + { + a.value().write_value(buf); + } + } } - catch (BadKind ex) + catch (Bounds ex) { InternalError ierr = new InternalError(); ierr.initCause(ex); throw ierr; } - } - if (lr.return_value() != null) - lr.return_value().write_value(buf); - NamedValue a; + return buf.create_input_stream(); + } + else + { + LocalRequest lrq = (LocalRequest) sr.request; + return lrq.s_invoke(handler); + } + } + catch (gnuForwardRequest f) + { try { - for (int i = 0; i < lr.arguments().count(); i++) - { - a = lr.arguments().item(i); - if (a.flags() == ARG_INOUT.value || - a.flags() == ARG_INOUT.value - ) - { - a.value().write_value(buf); - } - } + return ((ObjectImpl) f.forward_reference)._invoke(f.forward_reference._request( + operation, + true + ) + ); } - catch (Bounds ex) + catch (RemarshalException e) { - InternalError ierr = new InternalError(); - ierr.initCause(ex); - throw ierr; + // Never thrown in this place by Classpath implementation. + throw new NO_IMPLEMENT(); } - - return buf.create_input_stream(); } - else - return ((LocalRequest) sr.request).s_invoke(handler); } public void releaseReply(org.omg.CORBA.Object target, InputStream input) |