You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

How do I share a single object between different service units?

You need to register your singleton bean inside ServiceMix' internal JNDI registry. This is done by modifying the conf/jndi.xml configuration file:

<util:map id="jndiEntries">
  ...
  <entry key="mySingletonJndiName">
    <bean .... Put your singleton bean here ... />
  </entry> 
</util:map>

Then, in your xbean.xml files for your SUs, you can use:

<jee:jndi-lookup id="mySingletonId" jndi-name="mySingletonJndiName" />
  • No labels