import com.sun.star.uno.XComponentContext;
public final class Relay implements XRelay, XSource {
public void start(XSource source) {
this.source = source;
XComponentContext context;
try {
context = Bootstrap.createInitialComponentContext(null);
} catch (RuntimeException e) {
throw e;
} 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 = (XBridgeFactory) 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() {