Search in sources :

Example 1 with OpenEJBNamingResource

use of org.apache.tomee.catalina.OpenEJBNamingResource in project tomee by apache.

the class OpenEJBContextConfig method contextConfig.

@Override
protected void contextConfig(final Digester digester) {
    final NamingResourcesImpl resources;
    if (context != null) {
        resources = context.getNamingResources();
    } else {
        resources = null;
    }
    if (resources instanceof OpenEJBNamingResource) {
        ((OpenEJBNamingResource) resources).setTomcatResource(true);
    }
    super.contextConfig(digester);
    if (resources instanceof OpenEJBNamingResource) {
        ((OpenEJBNamingResource) resources).setTomcatResource(false);
    }
    if (context instanceof StandardContext) {
        final StandardContext standardContext = (StandardContext) context;
        final NamingContextListener namingContextListener = standardContext.getNamingContextListener();
        if (null != namingContextListener) {
            namingContextListener.setExceptionOnFailedWrite(standardContext.getJndiExceptionOnFailedWrite());
        }
    }
}
Also used : IgnoredStandardContext(org.apache.tomee.catalina.IgnoredStandardContext) StandardContext(org.apache.catalina.core.StandardContext) NamingResourcesImpl(org.apache.catalina.deploy.NamingResourcesImpl) NamingContextListener(org.apache.catalina.core.NamingContextListener) OpenEJBNamingResource(org.apache.tomee.catalina.OpenEJBNamingResource)

Aggregations

NamingContextListener (org.apache.catalina.core.NamingContextListener)1 StandardContext (org.apache.catalina.core.StandardContext)1 NamingResourcesImpl (org.apache.catalina.deploy.NamingResourcesImpl)1 IgnoredStandardContext (org.apache.tomee.catalina.IgnoredStandardContext)1 OpenEJBNamingResource (org.apache.tomee.catalina.OpenEJBNamingResource)1