@Service @RunLevel(value=1, mode=0) public class GlassFishNamingBuilder extends Object implements InitialContextFactoryBuilder, org.glassfish.hk2.api.PostConstruct, org.glassfish.hk2.api.PreDestroy
InitialContextFactoryBuilder
. When GlassFish starts up, this
startup service configures NamingManager with appropriate builder by calling
NamingManager.setInitialContextFactoryBuilder(javax.naming.spi.InitialContextFactoryBuilder)
.
Once the builder is setup, when ever new InitialContext() is called,
builder can either instantiate SerialInitContextFactory
, which is our
implementation of InitialContextFactory
, or any user specified
InitialContextFactory class. While loading user specified class, it first
uses Thread's context class loader and then CommonClassLoader.
Please note that this is setup as an init level service to ensure that JNDI subsystem is setup
before applications are loaded.Modifier and Type | Field and Description |
---|---|
static String |
FAILED_TO_LOAD_CLASS |
Constructor and Description |
---|
GlassFishNamingBuilder() |
Modifier and Type | Method and Description |
---|---|
InitialContextFactory |
createInitialContextFactory(Hashtable<?,?> environment) |
void |
postConstruct() |
void |
preDestroy() |
public static final String FAILED_TO_LOAD_CLASS
public InitialContextFactory createInitialContextFactory(Hashtable<?,?> environment) throws NamingException
createInitialContextFactory
in interface InitialContextFactoryBuilder
NamingException
public void postConstruct()
postConstruct
in interface org.glassfish.hk2.api.PostConstruct
public void preDestroy()
preDestroy
in interface org.glassfish.hk2.api.PreDestroy
Copyright © 2019. All rights reserved.