| /**
| * JNDI aware KernelRegistryPlugin.
| *
| * @author <a href="mailto:ales.justin@gmail.com">Ales
Justin</a>
| */
| public class JNDIKernelRegistryPlugin implements KernelRegistryPlugin
| {
| private Hashtable properties;
| private Context context;
|
| public void setProperties(Hashtable properties)
| {
| this.properties = properties;
| }
|
| public void create() throws NamingException
| {
| if (properties != null)
| context = new InitialContext(properties);
| else
| context = new InitialContext();
| }
|
| public void destroy() throws NamingException
| {
| if (context != null)
| context.close();
| context = null;
| }
|
| public KernelRegistryEntry getEntry(Object name)
| {
| try
| {
| Object target = context.lookup(name.toString());
| return new AbstractKernelRegistryEntry(name, target);
| }
| catch (NamingException e)
| {
| }
| return null;
| }
| }
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4079108#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...