dev@glassfish.java.net

How to get instance of org.glassfish.grizzly.config.dom.NetworkConfig

From: David BRASSELY <brasseld_at_gmail.com>
Date: Tue, 11 Jun 2013 15:04:40 +0200

Hello all,

I'm trying to migrate a Startup / Lifecycle module from GFv3 to GFv4.
I saw that the Startup class is now deprecated so I moved to InstanceLifecycleListener.

What I need is to get an instance of org.glassfish.grizzly.config.dom.NetworkConfig to retrieve some configuration values (HTTP Listener for example).
In the past (GFv3), I've used org.glassfish.internal.api.Globals.getDefaultHabitat().getComponent(MyComponent.class) but this method does not exist anyway.

I'm trying to do the same by injecting a ServiceLocator but I'm not able to retrieve an instance of NetworkConfig (service locator returns null while calling getService()).
What is the good way to migrate from org.glassfish.internal.api.Globals for GFv4 ?

Thanks,
-- 
David BRASSELY