The intention of supply/demand is to provide a dependency on something
that is "not known" to the MC. I have not done any extensive testing on this
feature yet (other than the proof of concept classloading dependency tests).
It works with the KernelRegistryPlugin to see whether the thing exists.
You could for example register a POJO that implements KernelRegistryPlugin
to do lookups on JNDI to see whether the binding exists.
| public JNDIRegistryPlugin implements KernelRegistryPlugin
| {
| public KernelRegistryEntry getEntry(Object name)
| {
| try
| {
| Object o = context.lookup((String) name);
| return createRegistryEntry(name, o);
| }
| catch (NameNotFoundException e)
| {
| return null;
| }
| }
| }
|
Then use it in a demands
| <bean ...>
| <demands>jnp://remotehost:1099/something</demands>
| </bean>
|
The supplies is so you can have abitrary dependency names without
having to create a registry plugin...
| <bean ...>
| <demands>LogicalName</demands>
| </bean>
| <bean ...>
| <supplies>LogicalName</supplies>
| </bean>
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3887325#3887325
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3887325
|