-
1. Re: Change JNDI variable value
adrian.brock Aug 13, 2002 7:44 AM (in response to jocsch)Not currently. It could probably be added as a
Managed Operation to org.jboss.ejb.Container
Regards,
Adrian -
2. Re: Change JNDI variable value
cepage Aug 13, 2002 10:24 AM (in response to jocsch)Sure, this code sets a JNDI Value:
public void addEntry(String jndiName, String entry)
{
try
{
InitialContext jndiContext = new InitialContext();
Util.bind( jndiContext, jndiName, entry );
}
catch ( NamingException namEx )
{
logger.error( "Exception caught in addEntry", namEx );
}
}
Make this code an exposed MBean method, and you're done.
Corby -
3. Re: Change JNDI variable value
adrian.brock Aug 13, 2002 12:07 PM (in response to jocsch)Well actually that won't work for env entries.
They are classloader based.
You have to temporarily swap in the container's
classloader - see invoke()
You probably also want to validate it is a property, not
an ejb-ref or a resource.
There's some conversion required of the entry
into the required class.
See org.jboss.ejb.Container.setUpEnvironment()
and org.jboss.ejb.MetaData.EnvEntryMetaData()
Regards,
Adrian