This content has been marked as final.
Show 1 reply
-
1. Re: how to set a jndi name for a mbean
rixc Nov 4, 2004 11:25 AM (in response to jotsetung)In the jboss docs they provide a jboss specific implementation for binding your mbean to the jndio namespace
private void rebind() throws NamingException { InitialContext rootCtx = new InitialContext(); Name fullName = rootCtx.getNameParser("").parse(jndiName); NonSerializableFactory.rebind(fullName, contextMap, true); } private void unbind(String jndiName) { try { InitialContext rootCtx = new InitialContext(); rootCtx.unbind(jndiName); NonSerializableFactory.unbind(jndiName); } catch(NamingException e) { e.printStackTrace(); } }
This works well but obviously ties you to Jboss. I am just now in the process of trying to find a non-jboss specific implementation but as yet have not found one.