diff options
author | Kay Ramme <kr@openoffice.org> | 2000-11-24 12:16:38 +0000 |
---|---|---|
committer | Kay Ramme <kr@openoffice.org> | 2000-11-24 12:16:38 +0000 |
commit | 0ea6c1ec4558336e98449436cd9cafcc272842b6 (patch) | |
tree | b1f6c82283d6d0cd3429b073939f9ee8eb4f69fb /jut | |
parent | ac3aed1be8bd08a32e687d2c4a69c2cca710774a (diff) |
#80244# create unique name for bridge; close connection if something bad happens
Diffstat (limited to 'jut')
-rw-r--r-- | jut/com/sun/star/tools/uno/UnoApp.java | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/jut/com/sun/star/tools/uno/UnoApp.java b/jut/com/sun/star/tools/uno/UnoApp.java index 99261104a924..725ddf96c217 100644 --- a/jut/com/sun/star/tools/uno/UnoApp.java +++ b/jut/com/sun/star/tools/uno/UnoApp.java @@ -2,9 +2,9 @@ * * $RCSfile: UnoApp.java,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: kr $ $Date: 2000-11-10 10:06:20 $ + * last change: $Author: kr $ $Date: 2000-11-24 13:16:38 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -101,7 +101,7 @@ import com.sun.star.uno.Type; * <p> */ public class UnoApp { - static public final boolean DEBUG = false; + static public final boolean DEBUG = true; /** * Bootstraps a servicemanager with some base components registered. @@ -293,19 +293,30 @@ public class UnoApp { XBridgeFactory xBridgeFactory = (XBridgeFactory)UnoRuntime.queryInterface(XBridgeFactory.class, _xMultiServiceFactory.createInstance("com.sun.star.bridge.BridgeFactory")); - do { - System.err.println("waiting for connect..."); - XConnection xConnection = xAcceptor.accept(_conDcp); - if(xConnection == null) - break; + int connect_count = 0; - // create the bridge - XBridge xBridge = xBridgeFactory.createBridge(_conDcp + ";" + _protDcp, _protDcp, xConnection, new InstanceProvider(_rootOid, _object)); + do { + XConnection xConnection = null; + try { + System.err.println("waiting for connect [" + _conDcp + "#" + connect_count + "]..."); + xConnection = xAcceptor.accept(_conDcp); + if(xConnection == null) + break; + + // create the bridge + XBridge xBridge = xBridgeFactory.createBridge(_conDcp + ";" + _protDcp + "#" + (connect_count ++), _protDcp, xConnection, new InstanceProvider(_rootOid, _object)); + } + catch(com.sun.star.uno.Exception exception) { + System.err.println(getClass().getName() + " exeception occurred - " + exception); + if(xConnection != null) + xConnection.close(); + } } while(!_singleAccept); } catch(com.sun.star.uno.Exception exception) { System.err.println(getClass().getName() + " exeception occurred - " + exception); + System.err.println(getClass().getName() + " dying..."); } } } |