INTEGRATION: CWS kso11 (1.3.36); FILE MERGED

2004/03/11 08:49:32 sb 1.3.36.1: #115880# Cloned 112066.
This commit is contained in:
Kurt Zenker
2004-03-25 10:03:32 +00:00
parent 4afe515fda
commit df09295c0a

View File

@@ -2,9 +2,9 @@
*
* $RCSfile: ProxyFactory.java,v $
*
* $Revision: 1.3 $
* $Revision: 1.4 $
*
* last change: $Author: hr $ $Date: 2003-08-13 17:22:19 $
* last change: $Author: kz $ $Date: 2004-03-25 11:03:32 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -61,6 +61,7 @@
package com.sun.star.lib.uno.bridges.java_remote;
import com.sun.star.bridge.XBridge;
import com.sun.star.uno.IQueryInterface;
import com.sun.star.uno.Type;
import com.sun.star.uno.UnoRuntime;
@@ -76,8 +77,9 @@ import java.lang.reflect.Proxy;
* generic proxy class.</p>
*/
final class ProxyFactory {
public ProxyFactory(RequestHandler requestHandler) {
public ProxyFactory(RequestHandler requestHandler, XBridge bridge) {
this.requestHandler = requestHandler;
this.bridge = bridge;
}
public Object create(String oid, Type type) {
@@ -97,6 +99,16 @@ final class ProxyFactory {
}
}
public static XBridge getBridge(Object obj) {
if (Proxy.isProxyClass(obj.getClass())) {
InvocationHandler h = Proxy.getInvocationHandler(obj);
if (h instanceof Handler) {
return ((Handler) h).getBridge();
}
}
return null;
}
static int getDebugCount() {
synchronized (debugCountLock) {
return debugCount;
@@ -126,6 +138,10 @@ final class ProxyFactory {
return ProxyFactory.this == factory;
}
public XBridge getBridge() {
return bridge;
}
public Object invoke(Object proxy, Method method, Object[] args)
throws Throwable
{
@@ -191,4 +207,5 @@ final class ProxyFactory {
private static int debugCount = 0;
private final RequestHandler requestHandler;
private final XBridge bridge;
}