Is there a better way to get StandardServer's NamingContext than this?  I'm
writing a custom realm and I need some puggable resources (I'm using
GlobalNamingResources to configure these, it's the cleanest way I could come
up with)

// code is from a RealmBase-derived class start() method

Container c;
for(c = this.container; c.getParent() != null; c = c.getParent());

if(!(c instanceof Service)) {
    throw new SomeException("Can't find my Service, that's wierd.");
}

Service service = (Service)c;
StandardServer server = (StandardServer)service.getServer();
for(LifecycleListener ll : server.findLifecycleListeners()) {
    if(ll instanceof NamingContextListener) {
        rootNamingContext = ((NamingContextListener)ll).getNamingContext();
    }
}

Thanks,
Daniel

-- 
View this message in context: 
http://www.nabble.com/Getting-StandardServer%27s-NamingContext--tf2679812.html#a7474313
Sent from the Tomcat - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to