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));