use of org.apache.openejb.server.cxf.rs.event.ServerCreated in project tomee by apache.
the class CxfRsHttpListener method fireServerCreated.
private void fireServerCreated(final ClassLoader oldLoader) {
final Object ctx = AppFinder.findAppContextOrWeb(oldLoader, new AppFinder.Transformer<Object>() {
@Override
public Object from(final AppContext appCtx) {
return appCtx;
}
@Override
public Object from(final WebContext webCtx) {
return webCtx;
}
});
final AppContext appCtx = AppContext.class.isInstance(ctx) ? AppContext.class.cast(ctx) : WebContext.class.cast(ctx).getAppContext();
WebContext webContext = appCtx == ctx ? null : WebContext.class.cast(ctx);
if (webContext == null && appCtx.getWebContexts().size() == 1 && appCtx.getWebContexts().get(0).getClassLoader() == oldLoader) {
webContext = appCtx.getWebContexts().get(0);
}
SystemInstance.get().fireEvent(new ServerCreated(server, appCtx, webContext, this.context));
}
Aggregations