Search in sources :

Example 1 with ServerCreated

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));
}
Also used : WebContext(org.apache.openejb.core.WebContext) AppContext(org.apache.openejb.AppContext) ServerCreated(org.apache.openejb.server.cxf.rs.event.ServerCreated) AppFinder(org.apache.openejb.util.AppFinder)

Aggregations

AppContext (org.apache.openejb.AppContext)1 WebContext (org.apache.openejb.core.WebContext)1 ServerCreated (org.apache.openejb.server.cxf.rs.event.ServerCreated)1 AppFinder (org.apache.openejb.util.AppFinder)1