diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2003-08-13 16:22:19 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2003-08-13 16:22:19 +0000 |
commit | 3009091ee7e79a1595506ec367f9f7a08eb3229b (patch) | |
tree | 3d0c80aa746bacb7cfab959c0f612b100d96e32d /jurt/com/sun | |
parent | 878541e725ec3b69b1e674088299cbf10b06861e (diff) |
INTEGRATION: CWS sb7 (1.2.18); FILE MERGED
2003/08/07 12:43:49 sb 1.2.18.3: #i16264# Correctly implement URP spec of not acquiring (oid,t) upon mapping out if (oid,t') with t' subtype of t was mapped in.
2003/07/23 11:16:32 sb 1.2.18.2: #110892# ProxyFactory.isProxy has to check for matching types.
2003/07/18 07:43:43 sb 1.2.18.1: #110892# In java_remote_bridge.mapInterfaceTo, only add a refHolder for objects that did not get proxied in from the remote side.
Diffstat (limited to 'jurt/com/sun')
-rw-r--r-- | jurt/com/sun/star/lib/uno/bridges/java_remote/ProxyFactory.java | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/jurt/com/sun/star/lib/uno/bridges/java_remote/ProxyFactory.java b/jurt/com/sun/star/lib/uno/bridges/java_remote/ProxyFactory.java index 7f4184f85751..a180a264737b 100644 --- a/jurt/com/sun/star/lib/uno/bridges/java_remote/ProxyFactory.java +++ b/jurt/com/sun/star/lib/uno/bridges/java_remote/ProxyFactory.java @@ -2,9 +2,9 @@ * * $RCSfile: ProxyFactory.java,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: rt $ $Date: 2003-04-23 17:03:38 $ + * last change: $Author: hr $ $Date: 2003-08-13 17:22:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -66,6 +66,7 @@ import com.sun.star.uno.Type; import com.sun.star.uno.UnoRuntime; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; +import java.lang.reflect.Proxy; /** * A factory for proxies specific to the <code>java_remote_bridge</code>. @@ -80,13 +81,22 @@ final class ProxyFactory { } public Object create(String oid, Type type) { - return java.lang.reflect.Proxy.newProxyInstance( + return Proxy.newProxyInstance( getClass().getClassLoader(), new Class[] { com.sun.star.lib.uno.Proxy.class, IQueryInterface.class, type.getZClass() }, new Handler(oid, type)); } + public boolean isProxy(Object obj) { + if (Proxy.isProxyClass(obj.getClass())) { + InvocationHandler h = Proxy.getInvocationHandler(obj); + return h instanceof Handler && ((Handler) h).matches(this); + } else { + return false; + } + } + static int getDebugCount() { synchronized (debugCountLock) { return debugCount; @@ -112,6 +122,10 @@ final class ProxyFactory { incrementDebugCount(); } + public boolean matches(ProxyFactory factory) { + return ProxyFactory.this == factory; + } + public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { |