static public void main(String args[]) throws IOException, com.sun.star.uno.Exception {
com.sun.star.comp.servicemanager.ServiceManager smgr = new com.sun.star.comp.servicemanager.ServiceManager();
smgr.addFactories(neededServices, null);
XConnectionBroker connectionBroker = (XConnectionBroker)smgr.createInstance("com.sun.star.bridge.ConnectionBroker");
if(connectionBroker.acceptConnections("socket:5001", new MyConnectCallback())) {
System.in.read();
connectionBroker.stopAccepting();
}
ThreadPool.reset();
UnoRuntime.reset();
}