-
1. Re: Use of JBoss MC Pojo from in distributed env
alesj Aug 13, 2009 6:27 AM (in response to mukulb)MC only provides the means to "connect" to existing distributable envs.
e.g. @JMX, @JndiBinding
You will have to provide your own distributed env:
* RMI
* Hessian or Burlap
* Infinispan
* ...
And then simply register your beans against it. -
2. Re: Use of JBoss MC Pojo from in distributed env
manik Aug 13, 2009 6:29 AM (in response to mukulb)One way to do this - and this would involve extending or modifying the MC - is to replace whatever backing container the MC uses to store beans it creates (probably a Map) with an Infinispan Cache.
This should be trivial since org.infinispan.Cache extends java.util.concurrent.ConcurrentMap.
Maybe alesj can comment more on whether this is something viable from a MC standpoint. -
3. Re: Use of JBoss MC Pojo from in distributed env
alesj Aug 13, 2009 6:39 AM (in response to mukulb)"manik.surtani@jboss.com" wrote:
One way to do this - and this would involve extending or modifying the MC - is to replace whatever backing container the MC uses to store beans it creates (probably a Map) with an Infinispan Cache.
You can easily achieve this with the bean implementing KernelRegistryPlugin.public interface KernelRegistryPlugin { /** * Get a registration * * @param name the name of the object * @return the registration * @throws IllegalArgumentException for a null name */ KernelRegistryEntry getEntry(Object name); }
Every such bean becomes part of MC registry,
and as such it's always "asked" if it knows how to provide a bean per name parameter.
e.g. JNDI KRPpublic 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()); if (target != null) return new AbstractKernelRegistryEntry(name, target); } catch (NamingException e) { } return null; } }
In Infinispan's case you would simply replace context with cache. -
4. Re: Use of JBoss MC Pojo from in distributed env
manik Aug 13, 2009 6:42 AM (in response to mukulb)Nice and easy! :-) We should document this on a wiki somewhere.
-
5. Re: Use of JBoss MC Pojo from in distributed env
alesj Aug 13, 2009 6:44 AM (in response to mukulb)"manik.surtani@jboss.com" wrote:
We should document this on a wiki somewhere.
I guess we can ask mukulb if he's willing to do this once he's done? :-) -
6. Re: Use of JBoss MC Pojo from in distributed env
manik Aug 13, 2009 6:44 AM (in response to mukulb)@mukulb wdyt? :)
-
7. Re: Use of JBoss MC Pojo from in distributed env
mukulb Aug 13, 2009 9:44 AM (in response to mukulb)Thanks Ales and Manik. I can definitely add information to Wiki but i haven't used infinispan. But if whatever we discussed only needs to be documented then i will do it.
Thanks,