ConfigurationContext configctx = ConfigurationContextFactory
.createConfigurationContextFromFileSystem(repository, null);
SimpleHTTPServer receiver = new SimpleHTTPServer(configctx, port);
Runtime.getRuntime().addShutdownHook(new ShutdownThread(receiver));
receiver.start();
ListenerManager listenerManager = configctx .getListenerManager();
TransportInDescription trsIn = new TransportInDescription(Constants.TRANSPORT_HTTP);
trsIn.setReceiver(receiver);
if (listenerManager == null) {
listenerManager = new ListenerManager();
listenerManager.init(configctx);
}
listenerManager.addListener(trsIn, true);
// should all transports be started? specified as "-t all"
if (startAllTransports) {
Iterator iter = configctx.getAxisConfiguration().
getTransportsIn().keySet().iterator();
while (iter.hasNext()) {
QName trp = (QName) iter.next();
if (!new QName(Constants.TRANSPORT_HTTP).equals(trp)) {
trsIn = (TransportInDescription)
configctx.getAxisConfiguration().getTransportsIn().get(trp);
listenerManager.addListener(trsIn, false);
}
}
}
System.out.println("[SimpleHTTPServer] Started");