8 Replies Latest reply: Apr 14, 2009 7:44 AM by Manik Surtani RSS

Deploying JBoss Cache as MBean in microcontainer

Amit Bhayani Newbie

This is in continuation to
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=148625

Since this question is related to MC I thought I should post here.

I can start the JBoss cache programmatically by using

Configuration config = new Configuration();
 config.setTransactionManagerLookupClass( JBossTransactionManagerLookup.class.getName() );
 config.setIsolationLevel(IsolationLevel.REPEATABLE_READ);
 config.setNodeLockingScheme(Configuration.NodeLockingScheme.MVCC);
 config.setCacheMode(Configuration.CacheMode.LOCAL);
 CacheFactory factory = new DefaultCacheFactory();
 Cache cache = factory.createCache(config);
 return cache;


However this way if user needs to make any changes he/she needs to re-compile the code.

I tried deploying the Cache as MBean using JMX annotation

<bean name="MobicentsCacheConfig"
 class="org.jboss.cache.config.Configuration">

 <!-- Externally injected services -->
 <property name="runtimeConfig">
 <bean name="ExampleCacheRuntimeConfig"
 class="org.jboss.cache.config.RuntimeConfig">
 <property name="transactionManager">
 <inject bean="TransactionManager"
 property="transactionManager" />
 </property>
 <property name="muxChannelFactory">
 <inject bean="JChannelFactory" />
 </property>
 </bean>
 </property>

 <!--
 Node locking level : SERIALIZABLE
 REPEATABLE_READ (default)
 READ_COMMITTED
 READ_UNCOMMITTED
 NONE
 -->
 <property name="isolationLevel">REPEATABLE_READ</property>

 <!-- Valid modes are LOCAL
 REPL_ASYNC
 REPL_SYNC
 -->
 <property name="cacheMode">LOCAL</property>

 <!-- Max number of milliseconds to wait for a lock acquisition -->
 <property name="lockAcquisitionTimeout">15000</property>

 <property name="exposeManagementStatistics">true</property>

 <!-- Specific eviction policy configurations. This is LRU -->
 <property name="evictionConfig">
 <bean name="ExampleEvictionConfig"
 class="org.jboss.cache.config.EvictionConfig">
 <property name="defaultEvictionPolicyClass">
 org.jboss.cache.eviction.LRUPolicy
 </property>
 <property name="wakeupIntervalSeconds">5</property>
 <property name="evictionRegionConfigs">
 <list>
 <bean name="ExampleDefaultEvictionRegionConfig"
 class="org.jboss.cache.config.EvictionRegionConfig">
 <property name="regionName">
 /_default_
 </property>
 <property name="evictionPolicyConfig">
 <bean name="ExampleDefaultLRUConfig"
 class="org.jboss.cache.eviction.LRUConfiguration">
 <property name="maxNodes">
 5000
 </property>
 <property
 name="timeToLiveSeconds">
 1000
 </property>
 </bean>
 </property>
 </bean>
 </list>
 </property>
 </bean>
 </property>

 </bean>


 <bean name="Mobicents.JAINSLEE.RuntimeTreeCache"
 class="org.jboss.cache.Cache">
 <constructor factoryMethod="createCache">
 <factory bean="DefaultCacheFactory" />
 <parameter class="org.jboss.cache.config.Configuration">
 <inject bean="MobicentsCacheConfig" />
 </parameter>
 <parameter class="boolean">false</parameter>
 </constructor>
 </bean>

 <bean name="Mobicents.JAINSLEE.RuntimeTreeCacheMBean"
 class="org.jboss.cache.jmx.CacheJmxWrapper">

 <annotation>
 @org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.cache:service=RuntimeTreeCache",exposedInterface=org.jboss.cache.jmx.CacheJmxWrapperMBean.class,
 registerDirectly=true)
 </annotation>
 <constructor>
 <parameter class="org.jboss.cache.Cache">
 <inject bean="Mobicents.JAINSLEE.RuntimeTreeCache" />
 </parameter>
 </constructor>
 </bean>


However I get


2009-01-15 09:32:05,653 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error installing to PreInstall: name=Mobicents.JAINSLEE.TransactionManagerMBean state=Real
java.lang.RuntimeException: Error creating annotation for
@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="slee:name=TransactionManagerMBean",exposedInterface=org.mobicents.slee.runtime.transaction.TransactionManagerImpl.class,
registerDirectly=true)

at org.jboss.beans.metadata.plugins.AbstractAnnotationMetaData.getAnnotationInstance(AbstractAnnotationMetaData.java:128)
at org.jboss.kernel.plugins.dependency.KernelScopeInfo.updateAnnotations(KernelScopeInfo.java:319)
at org.jboss.kernel.plugins.dependency.KernelScopeInfo.updateClassAnnotations(KernelScopeInfo.java:151)
.............
..............
...............
Caused by: java.lang.RuntimeException: Error getting root expression
@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="slee:name=TransactionManagerMBean",exposedInterface=org.mobicents.slee.runtime.transaction.TransactionManagerImpl.class,
registerDirectly=true)

at org.jboss.annotation.factory.AnnotationCreator.getRootExpr(AnnotationCreator.java:361)

Is there some mistake in how the annotation is used?

Thanks

  • 1. Re: Deploying JBoss Cache as MBean in microcontainer
    Amit Bhayani Newbie

    here is complete bean.xml

    <?xml version="1.0" encoding="UTF-8"?>
    
    <deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns="urn:jboss:bean-deployer:2.0">
    
     <bean name="Mobicents.JAINSLEE.TransactionManagerMBean"
     class="org.mobicents.slee.runtime.transaction.TransactionManagerImpl">
    
     <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="slee:name=TransactionManagerMBean",exposedInterface=org.mobicents.slee.runtime.transaction.TransactionManagerImpl.class,registerDirectly=true)</annotation>
     <!-- jboss as tx manager bean -->
     <property name="treeCacheName">
     jboss.cache:service=TreeCache
     </property>
     <property name="deploymentTreeCacheName">
     jboss.cache:service=DeploymentTreeCache
     </property>
     <property name="profileTreeCacheName">
     jboss.cache:service=ProfileTreeCache
     </property>
     <property name="runtimeTreeCacheName">
     jboss.cache:service=RuntimeTreeCache
     </property>
     <demand>TransactionManager</demand>
     <demand>Mobicents.JAINSLEE.ServiceCacheMBean</demand>
     <demand>Mobicents.JAINSLEE.DeploymentTreeCacheMBean</demand>
     <demand>Mobicents.JAINSLEE.ProfileTreeCacheMBean</demand>
     <demand>Mobicents.JAINSLEE.RuntimeTreeCacheMBean</demand>
     </bean>
    
     <!-- JBOSS CACHE -->
    
     <!-- First we create a Configuration object for the cache -->
     <bean name="MobicentsCacheConfig"
     class="org.jboss.cache.config.Configuration">
    
     <!-- Externally injected services -->
     <property name="runtimeConfig">
     <bean name="ExampleCacheRuntimeConfig"
     class="org.jboss.cache.config.RuntimeConfig">
     <property name="transactionManager">
     <inject bean="TransactionManager"
     property="transactionManager" />
     </property>
     <property name="muxChannelFactory">
     <inject bean="JChannelFactory" />
     </property>
     </bean>
     </property>
    
     <!--
     Node locking level : SERIALIZABLE
     REPEATABLE_READ (default)
     READ_COMMITTED
     READ_UNCOMMITTED
     NONE
     -->
     <property name="isolationLevel">REPEATABLE_READ</property>
    
     <!-- Valid modes are LOCAL
     REPL_ASYNC
     REPL_SYNC
     -->
     <property name="cacheMode">LOCAL</property>
    
     <!-- Max number of milliseconds to wait for a lock acquisition -->
     <property name="lockAcquisitionTimeout">15000</property>
    
     <property name="exposeManagementStatistics">true</property>
    
     <!-- Specific eviction policy configurations. This is LRU -->
     <property name="evictionConfig">
     <bean name="ExampleEvictionConfig"
     class="org.jboss.cache.config.EvictionConfig">
     <property name="defaultEvictionPolicyClass">
     org.jboss.cache.eviction.LRUPolicy
     </property>
     <property name="wakeupIntervalSeconds">5</property>
     <property name="evictionRegionConfigs">
     <list>
     <bean name="ExampleDefaultEvictionRegionConfig"
     class="org.jboss.cache.config.EvictionRegionConfig">
     <property name="regionName">
     /_default_
     </property>
     <property name="evictionPolicyConfig">
     <bean name="ExampleDefaultLRUConfig"
     class="org.jboss.cache.eviction.LRUConfiguration">
     <property name="maxNodes">
     5000
     </property>
     <property
     name="timeToLiveSeconds">
     1000
     </property>
     </bean>
     </property>
     </bean>
     </list>
     </property>
     </bean>
     </property>
    
     </bean>
    
     <!-- Factory to build the Cache. -->
     <bean name="DefaultCacheFactory"
     class="org.jboss.cache.DefaultCacheFactory">
     <constructor factoryClass="org.jboss.cache.DefaultCacheFactory"
     factoryMethod="getInstance" />
     </bean>
    
     <!-- The caches themselves -->
    
     <bean name="Mobicents.JAINSLEE.ServiceCache"
     class="org.jboss.cache.Cache">
     <constructor factoryMethod="createCache">
     <factory bean="DefaultCacheFactory" />
     <parameter class="org.jboss.cache.config.Configuration">
     <inject bean="MobicentsCacheConfig" />
     </parameter>
     <parameter class="boolean">false</parameter>
     </constructor>
     </bean>
    
     <bean name="Mobicents.JAINSLEE.DeploymentTreeCache"
     class="org.jboss.cache.Cache">
     <constructor factoryMethod="createCache">
     <factory bean="DefaultCacheFactory" />
     <parameter class="org.jboss.cache.config.Configuration">
     <inject bean="MobicentsCacheConfig" />
     </parameter>
     <parameter class="boolean">false</parameter>
     </constructor>
     </bean>
    
     <bean name="Mobicents.JAINSLEE.ProfileTreeCache"
     class="org.jboss.cache.Cache">
     <constructor factoryMethod="createCache">
     <factory bean="DefaultCacheFactory" />
     <parameter class="org.jboss.cache.config.Configuration">
     <inject bean="MobicentsCacheConfig" />
     </parameter>
     <parameter class="boolean">false</parameter>
     </constructor>
     </bean>
    
     <bean name="Mobicents.JAINSLEE.RuntimeTreeCache"
     class="org.jboss.cache.Cache">
     <constructor factoryMethod="createCache">
     <factory bean="DefaultCacheFactory" />
     <parameter class="org.jboss.cache.config.Configuration">
     <inject bean="MobicentsCacheConfig" />
     </parameter>
     <parameter class="boolean">false</parameter>
     </constructor>
     </bean>
    
     <bean name="Mobicents.JAINSLEE.ServiceCacheMBean"
     class="org.jboss.cache.jmx.CacheJmxWrapper">
    
     <annotation>
     @org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.cache:service=TreeCache",exposedInterface=org.jboss.cache.jmx.CacheJmxWrapperMBean.class,
     registerDirectly=true)
     </annotation>
     <constructor>
     <parameter class="org.jboss.cache.Cache">
     <inject bean="Mobicents.JAINSLEE.ServiceCache" />
     </parameter>
     </constructor>
     </bean>
    
     <bean name="Mobicents.JAINSLEE.DeploymentTreeCacheMBean"
     class="org.jboss.cache.jmx.CacheJmxWrapper">
    
     <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.cache:service=DeploymentTreeCache",exposedInterface=org.jboss.cache.jmx.CacheJmxWrapperMBean.class,registerDirectly=true)</annotation>
     <constructor>
     <parameter class="org.jboss.cache.Cache">
     <inject bean="Mobicents.JAINSLEE.DeploymentTreeCache" />
     </parameter>
     </constructor>
     </bean>
    
     <bean name="Mobicents.JAINSLEE.ProfileTreeCacheMBean"
     class="org.jboss.cache.jmx.CacheJmxWrapper">
    
     <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.cache:service=ProfileTreeCache",exposedInterface=org.jboss.cache.jmx.CacheJmxWrapperMBean.class,registerDirectly=true)</annotation>
     <constructor>
     <parameter class="org.jboss.cache.Cache">
     <inject bean="Mobicents.JAINSLEE.ProfileTreeCache" />
     </parameter>
     </constructor>
     </bean>
    
     <bean name="Mobicents.JAINSLEE.RuntimeTreeCacheMBean"
     class="org.jboss.cache.jmx.CacheJmxWrapper">
    
     <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.cache:service=RuntimeTreeCache",exposedInterface=org.jboss.cache.jmx.CacheJmxWrapperMBean.class,registerDirectly=true)</annotation>
     <constructor>
     <parameter class="org.jboss.cache.Cache">
     <inject bean="Mobicents.JAINSLEE.RuntimeTreeCache" />
     </parameter>
     </constructor>
     </bean>
    
    </deployment>


  • 2. Re: Deploying JBoss Cache as MBean in microcontainer
    Amit Bhayani Newbie

    I was able to get this solved. There was an error in xml file


    Here is right one

    <?xml version="1.0" encoding="UTF-8"?>
    
    <deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:bean-deployer:2.0">
    
     <bean name="Mobicents.JAINSLEE.TransactionManagerMBean"
     class="org.mobicents.slee.runtime.transaction.TransactionManagerImpl">
     <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="slee:name=TransactionManagerMBean",exposedInterface=org.mobicents.slee.runtime.transaction.TransactionManagerImpl.class, registerDirectly=true)</annotation>
     <demand>TransactionManager</demand>
     <!-- jboss as tx manager bean -->
     <property name="treeCacheName">jboss.cache:service=TreeCache</property>
     <property name="deploymentTreeCacheName">jboss.cache:service=DeploymentTreeCache</property>
     <property name="profileTreeCacheName">jboss.cache:service=ProfileTreeCache</property>
     <property name="runtimeTreeCacheName">jboss.cache:service=RuntimeTreeCache</property>
    
     <demand>Mobicents.JAINSLEE.ServiceCacheMBean</demand>
     <demand>Mobicents.JAINSLEE.DeploymentTreeCacheMBean</demand>
     <demand>Mobicents.JAINSLEE.ProfileTreeCacheMBean</demand>
     <demand>Mobicents.JAINSLEE.RuntimeTreeCacheMBean</demand>
     </bean>
    
    
    <!-- JBOSS CACHE -->
    
     <!-- First we create a Configuration object for the cache -->
     <bean name="MobicentsCacheConfig" class="org.jboss.cache.config.Configuration">
    
     <!-- Externally injected services -->
     <property name="runtimeConfig">
     <bean name="ExampleCacheRuntimeConfig" class="org.jboss.cache.config.RuntimeConfig">
     <property name="transactionManager">
     <inject bean="TransactionManager" property="transactionManager"/>
     </property>
    
     </bean>
     </property>
    
     <!--
     Node locking level : SERIALIZABLE
     REPEATABLE_READ (default)
     READ_COMMITTED
     READ_UNCOMMITTED
     NONE
     -->
     <property name="isolationLevel">REPEATABLE_READ</property>
    
     <!-- Valid modes are LOCAL
     REPL_ASYNC
     REPL_SYNC
     -->
     <property name="cacheMode">LOCAL</property>
    
     <!-- Max number of milliseconds to wait for a lock acquisition -->
     <property name="lockAcquisitionTimeout">15000</property>
    
     <property name="exposeManagementStatistics">true</property>
    
     <!-- Specific eviction policy configurations. This is LRU -->
     <property name="evictionConfig">
     <bean name="ExampleEvictionConfig" class="org.jboss.cache.config.EvictionConfig">
     <property name="defaultEvictionPolicyClass">org.jboss.cache.eviction.LRUPolicy</property>
     <property name="wakeupIntervalSeconds">5</property>
     <property name="evictionRegionConfigs">
     <list>
     <bean name="ExampleDefaultEvictionRegionConfig" class="org.jboss.cache.config.EvictionRegionConfig">
     <property name="regionName">/_default_</property>
     <property name="evictionPolicyConfig">
     <bean name="ExampleDefaultLRUConfig" class="org.jboss.cache.eviction.LRUConfiguration">
     <property name="maxNodes">5000</property>
     <property name="timeToLiveSeconds">1000</property>
     </bean>
     </property>
     </bean>
     </list>
     </property>
     </bean>
     </property>
    
     </bean>
    
     <!-- Factory to build the Cache. -->
     <bean name="DefaultCacheFactory" class="org.jboss.cache.DefaultCacheFactory">
     <constructor factoryClass="org.jboss.cache.DefaultCacheFactory" factoryMethod="getInstance"/>
     </bean>
    
     <!-- The caches themselves -->
    
     <bean name="Mobicents.JAINSLEE.ServiceCache" class="org.jboss.cache.Cache">
     <constructor factoryMethod="createCache">
     <factory bean="DefaultCacheFactory"/>
     <parameter class="org.jboss.cache.config.Configuration"><inject bean="MobicentsCacheConfig"/></parameter>
     <parameter class="boolean">false</parameter>
     </constructor>
     </bean>
    
     <bean name="Mobicents.JAINSLEE.DeploymentTreeCache" class="org.jboss.cache.Cache">
     <constructor factoryMethod="createCache">
     <factory bean="DefaultCacheFactory"/>
     <parameter class="org.jboss.cache.config.Configuration"><inject bean="MobicentsCacheConfig"/></parameter>
     <parameter class="boolean">false</parameter>
     </constructor>
     </bean>
    
     <bean name="Mobicents.JAINSLEE.ProfileTreeCache" class="org.jboss.cache.Cache">
     <constructor factoryMethod="createCache">
     <factory bean="DefaultCacheFactory"/>
     <parameter class="org.jboss.cache.config.Configuration"><inject bean="MobicentsCacheConfig"/></parameter>
     <parameter class="boolean">false</parameter>
     </constructor>
     </bean>
    
     <bean name="Mobicents.JAINSLEE.RuntimeTreeCache" class="org.jboss.cache.Cache">
     <constructor factoryMethod="createCache">
     <factory bean="DefaultCacheFactory"/>
     <parameter class="org.jboss.cache.config.Configuration"><inject bean="MobicentsCacheConfig"/></parameter>
     <parameter class="boolean">false</parameter>
     </constructor>
     </bean>
    
     <bean name="Mobicents.JAINSLEE.ServiceCacheMBean" class="org.jboss.cache.jmx.CacheJmxWrapper">
    
     <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.cache:service=TreeCache",exposedInterface=org.jboss.cache.jmx.CacheJmxWrapperMBean.class,registerDirectly=true)</annotation>
     <constructor>
     <parameter class="org.jboss.cache.Cache"><inject bean="Mobicents.JAINSLEE.ServiceCache"/></parameter>
     </constructor>
     </bean>
    
     <bean name="Mobicents.JAINSLEE.DeploymentTreeCacheMBean" class="org.jboss.cache.jmx.CacheJmxWrapper">
    
     <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.cache:service=DeploymentTreeCache",exposedInterface=org.jboss.cache.jmx.CacheJmxWrapperMBean.class, registerDirectly=true)</annotation>
     <constructor>
     <parameter class="org.jboss.cache.Cache"><inject bean="Mobicents.JAINSLEE.DeploymentTreeCache"/></parameter>
     </constructor>
     </bean>
    
     <bean name="Mobicents.JAINSLEE.ProfileTreeCacheMBean" class="org.jboss.cache.jmx.CacheJmxWrapper">
    
    <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.cache:service=ProfileTreeCache",exposedInterface=org.jboss.cache.jmx.CacheJmxWrapperMBean.class,registerDirectly=true)</annotation>
     <constructor>
     <parameter class="org.jboss.cache.Cache"><inject bean="Mobicents.JAINSLEE.ProfileTreeCache"/></parameter>
     </constructor>
     </bean>
    
     <bean name="Mobicents.JAINSLEE.RuntimeTreeCacheMBean" class="org.jboss.cache.jmx.CacheJmxWrapper">
    
     <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.cache:service=RuntimeTreeCache",exposedInterface=org.jboss.cache.jmx.CacheJmxWrapperMBean.class, registerDirectly=true)</annotation>
     <constructor>
     <parameter class="org.jboss.cache.Cache"><inject bean="Mobicents.JAINSLEE.RuntimeTreeCache"/></parameter>
     </constructor>
     </bean>
    
    
     <bean name="Mobicents.JAINSLEE.RmiServerInterfaceMBean" class="org.mobicents.slee.container.management.jmx.RmiServerInterfaceMBeanImpl">
     <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="slee:service=RmiServerInterfaceMBean",exposedInterface=org.mobicents.slee.container.management.jmx.RmiServerInterfaceMBeanImplMBean.class, registerDirectly=true)</annotation>
     </bean>
    
     <bean name="Mobicents.JAINSLEE.AlarmMBean" class="org.mobicents.slee.container.management.jmx.AlarmMBeanImpl">
     <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="slee:name=AlarmMBean",exposedInterface=javax.slee.management.AlarmMBean.class, registerDirectly=true)</annotation>
     <demand>Mobicents.JAINSLEE.TransactionManagerMBean</demand>
     </bean>
    
     <bean name="Mobicents.JAINSLEE.DeploymentMBean" class="org.mobicents.slee.container.management.jmx.DeploymentMBeanImpl">
     <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="slee:name=DeploymentMBean",exposedInterface=javax.slee.management.DeploymentMBean.class, registerDirectly=true)</annotation>
     </bean>
    
     <bean name="Mobicents.JAINSLEE.ServiceManagementMBean"
     class="org.mobicents.slee.container.management.jmx.ServiceManagementMBeanImpl">
     <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="slee:name=ServiceManagementMBean",exposedInterface=javax.slee.management.ServiceManagementMBean.class, registerDirectly=true)</annotation>
     </bean>
    
     <bean name="Mobicents.JAINSLEE.TraceMBean"
     class="org.mobicents.slee.container.management.jmx.TraceMBeanImpl">
     <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="slee:name=TraceMBean",exposedInterface=javax.slee.management.TraceMBean.class, registerDirectly=true)</annotation>
     <demand>Mobicents.JAINSLEE.TransactionManagerMBean</demand>
     </bean>
    
     <bean name="Mobicents.JAINSLEE.ProfileProvisoningMBean"
     class="org.mobicents.slee.container.management.jmx.ProfileProvisioningMBeanImpl">
     <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="slee:name=ProfileProvisoningMBean",exposedInterface=javax.slee.management.ProfileProvisioningMBean.class, registerDirectly=true)</annotation>
     <demand>Mobicents.JAINSLEE.TransactionManagerMBean</demand>
     </bean>
    
     <bean name="Mobicents.JAINSLEE.ResourceManagementMBean"
     class="org.mobicents.slee.container.management.jmx.ResourceManagementMBeanImpl">
     <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="slee:name=ResourceManagementMBean",exposedInterface=javax.slee.management.ResourceManagementMBean.class, registerDirectly=true)</annotation>
     </bean>
    
     <bean name="Mobicents.JAINSLEE.SbbEntitiesMBean"
     class="org.mobicents.slee.container.management.jmx.SbbEntitiesMBeanImpl">
     <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="slee:name=SbbEntitiesMBean",exposedInterface=org.mobicents.slee.container.management.jmx.SbbEntitiesMBeanImplMBean.class, registerDirectly=true)</annotation>
     <demand>Mobicents.JAINSLEE.TransactionManagerMBean</demand>
     </bean>
    
     <bean name="Mobicents.JAINSLEE.SleeManagement"
     class="org.mobicents.slee.container.management.jmx.SleeManagementMBeanImpl">
     <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="slee:service=SleeManagement",exposedInterface=org.mobicents.slee.container.management.jmx.SleeManagementMBeanImplMBean.class, registerDirectly=true)</annotation>
     <property name="alarmMBean">slee:name=AlarmMBean</property>
     <property name="deploymentMBean">slee:name=DeploymentMBean</property>
     <property name="serviceManagementMBean">slee:name=ServiceManagementMBean</property>
     <property name="traceMBean">slee:name=TraceMBean</property>
     <property name="profileProvisioningMBean">slee:name=ProfileProvisoningMBean</property>
     <property name="resourceManagementMBean">slee:name=ResourceManagementMBean</property>
     <property name="sbbEntitiesMBean">slee:name=SbbEntitiesMBean</property>
     <property name="rmiServerInterfaceMBean">slee:service=RmiServerInterfaceMBean</property>
     <property name="activityManagementMBean">slee:name=ActivityManagementMBean</property>
     <demand>Mobicents.JAINSLEE.TransactionManagerMBean</demand>
     <demand>Mobicents.JAINSLEE.RmiServerInterfaceMBean</demand>
     </bean>
    
     <bean name="Mobicents.JAINSLEE.ActivityManagementMBean"
     class="org.mobicents.slee.container.management.jmx.ActivityManagementMBeanImpl">
     <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="slee:name=ActivityManagementMBean",exposedInterface=org.mobicents.slee.container.management.jmx.ActivityManagementMBeanImplMBean.class, registerDirectly=true)</annotation>
     <demand>Mobicents.JAINSLEE.SleeManagement</demand>
     </bean>
    
     <bean name="Mobicents.JAINSLEE.LogManagementMBean"
     class="org.mobicents.slee.container.management.jmx.log.MobicentsLogManagerMBeanImpl">
     <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="slee:name=LogManagementMBean",exposedInterface=org.mobicents.slee.container.management.jmx.log.MobicentsLogManagerMBeanImplMBean.class, registerDirectly=true)</annotation>
     <demand>Mobicents.JAINSLEE.SleeManagement</demand>
     </bean>
    
     <bean name="Mobicents.JAINSLEE.MobicentsManagement"
     class="org.mobicents.slee.container.management.jmx.MobicentsManagement">
     <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="slee:service=MobicentsManagement",exposedInterface=org.mobicents.slee.container.management.jmx.MobicentsManagementMBean.class, registerDirectly=true)</annotation>
     <property name="entitiesRemovalDelay">1</property>
     <demand>Mobicents.JAINSLEE.SleeManagement</demand>
    
     </bean>
    
    </deployment>


  • 3. Re: Deploying JBoss Cache as MBean in microcontainer
    Ales Justin Master

     

    "amit.bhayani@jboss.com" wrote:
    I was able to get this solved. There was an error in xml file

    What was the error?
    It's just too much xml code to look at. :-)

  • 4. Re: Deploying JBoss Cache as MBean in microcontainer
    Brian Stansberry Master

    Ales, I couldn't find it either. :-)

    Amit, FYI, the nested beans inside the "MobicentsCacheConfig" bean no longer need to have names (unless you want to access them somehow). Ales added that for me a while back. So, you could do this:

    <bean name="MobicentsCacheConfig" class="org.jboss.cache.config.Configuration">
    
     <!-- Externally injected services -->
     <property name="runtimeConfig">
     <bean class="org.jboss.cache.config.RuntimeConfig">
     <property name="transactionManager">
     <inject bean="TransactionManager" property="transactionManager"/>
     </property>
    
     </bean>
     </property>
    
     ... other simple properties
    
     <!-- Specific eviction policy configurations. This is LRU -->
     <property name="evictionConfig">
     <bean class="org.jboss.cache.config.EvictionConfig">
     <property name="defaultEvictionPolicyClass">org.jboss.cache.eviction.LRUPolicy</property>
     <property name="wakeupIntervalSeconds">5</property>
     <property name="evictionRegionConfigs">
     <list>
     <bean class="org.jboss.cache.config.EvictionRegionConfig">
     <property name="regionName">/_default_</property>
     <property name="evictionPolicyConfig">
     <bean class="org.jboss.cache.eviction.LRUConfiguration">
     <property name="maxNodes">5000</property>
     <property name="timeToLiveSeconds">1000</property>
     </bean>
     </property>
     </bean>
     </list>
     </property>
     </bean>
     </property>
    
     </bean>
    


    which is a bit less verbose and saves the need to make up bean names.

  • 5. Re: Deploying JBoss Cache as MBean in microcontainer
    Mariusz Smykula Newbie

    Stupid question, how to acces cache beans from MBean?

  • 6. Re: Deploying JBoss Cache as MBean in microcontainer
    Ales Justin Master

     

    "mariuszs" wrote:
    Stupid question, how to acces cache beans from MBean?

    Check the API of cache's MBean.
    Or the javadocs should explain it - if it's not trivial to see it from the method names.

  • 7. Re: Deploying JBoss Cache as MBean in microcontainer
    Mariusz Smykula Newbie

    Thanks, I have resolved my problem. Documentation of JbossCache is wrong

    5.2. Via JBoss Microcontainer (JBoss AS 5.x)

    Beginning with AS 5, JBoss AS supports deployment of POJO services via deployment of a file whose name ends with -beans.xml. A POJO service is one whose implementation is via a "Plain Old Java Object", meaning a simple java bean that isn't required to implement any special interfaces or extend any particular superclass.

    After changing -beans.xml to -jboss-beans.xml now I can access my cache ;) JBoss Cache folks are bad guys :)


  • 8. Re: Deploying JBoss Cache as MBean in microcontainer
    Manik Surtani Master

     


    JBoss Cache folks are bad guys :)


    You bet we are! ;-) Fixed the docs in JBC trunk.