} catch (com.sun.star.uno.Exception e) {
throw new WrappedTargetRuntimeException(e.toString(), this, e);
} catch (Exception e) {
throw new com.sun.star.uno.RuntimeException(e.toString(), this);
}
final XAcceptor acceptor = Acceptor.create(context);
final XBridgeFactory factory;
try {
factory = UnoRuntime.queryInterface(
XBridgeFactory.class,
context.getServiceManager().createInstanceWithContext(
"com.sun.star.bridge.BridgeFactory", context));
} catch (com.sun.star.uno.Exception e) {
throw new WrappedTargetRuntimeException(e.toString(), this, e);
}
new Thread() {
public void run() {
try {
// Use "127.0.0.1" instead of "localhost", see #i32281#:
factory.createBridge(
"", "urp",
acceptor.accept("socket,host=127.0.0.1,port=3831"),
new XInstanceProvider() {
public Object getInstance(String instanceName) {
return Relay.this;
}
});