// just return the first address
return addresses.iterator().next();
}
public static boolean addServlet(final String classname, final WebContext wc, final String mapping) {
final HttpListenerRegistry registry = SystemInstance.get().getComponent(HttpListenerRegistry.class);
if (registry == null || mapping == null) {
return false;
}
final ServletListener listener;
try {
listener = new ServletListener((Servlet) wc.newInstance(wc.getClassLoader().loadClass(classname)), wc.getContextRoot());
listener.getDelegate().init(null);
} catch (final Exception e) {
throw new OpenEJBRuntimeException(e);
}
registry.addHttpListener(listener, pattern(wc.getContextRoot(), mapping));
return true;
}