|
From: Colin S. <col...@ex...> - 2003-09-15 22:16:51
|
I was trying to use SimpleNamingContext in a J2EE envioronment, but it
this is not possible since it registers itself in the activate call
NamingManager.setInitialContextFactoryBuilder(this);
All I want is a simple memory based jndi provider. If there existed a
SimpleNamingContextFactory class (essentially the same as what is
produced by createInitialContextFactory in the builder, then I could use
it as a secondary JNDI provider:
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
SimpleNamingFactory.class.getName());
InitialContext ctx = new InitialContext(env);
Now all I want to do is stick a few objects in a well know location (and
they're not serializable so I can't use normal JNDI, but I am in the
same vm, so barring some classloading issues, a singleton mechanism of
any sort is fine).
So if I could use a singleton beanfactory in the same fashion, that
would also be ok. As far as I can tell though, the BootStrap method to
get a singleton bean factory will return one that is loaded from the
classpath. I know I could cast it to ListableBeanFactoryImpl, but that
doesn't feel too clean...
|