[JBossCache] - cachelistener configuration
by confuz
Hi All,
How to configure the cache listener in the xml configuration file?
and I tested the POJOCache with 1.4.0.GA use policy and cacheloader like follow
| <attribute name="EvictionPolicyClass">org.jboss.cache.aop.eviction.AopLRUPolicy</attribute>
|
| <!-- Specific eviction policy configurations. This is LRU -->
| <attribute name="EvictionPolicyConfig">
| <config>
| <attribute name="wakeUpIntervalSeconds">5</attribute>
| <!-- Cache wide default -->
| <region name="/_default_">
| <attribute name="maxNodes">5000</attribute>
| <attribute name="timeToLiveSeconds">1000</attribute>
| </region>
| <region name="/test">
| <attribute name="maxNodes">500</attribute>
| <attribute name="timeToLiveSeconds">4</attribute>
| </region>
| </config>
| </attribute>
|
| <attribute name="CacheLoaderConfiguration">
| <config>
| <passivation>true</passivation>
| <preload></preload>
| <shared>false</shared>
|
| <cacheloader>
| <class>org.jboss.cache.loader.jdbm.JdbmCacheLoader</class>
| <properties>
| location=c:/tmp/aop/filetore2
| </properties>
| <async>false</async>
|
| <fetchPersistentState>false</fetchPersistentState>
| <ignoreModifications>false</ignoreModifications>
| <purgeOnStartup>false</purgeOnStartup>
| </cacheloader>
|
| </config>
| </attribute>
|
then i wrote the following test code
| for(int j = 0; j < 1000; j ++){
| SamplePojo pojo=new SamplePojo(j, "Hany"+(i*1000+j));
| pojo.getHobbies().add("Running");
| pojo.getHobbies().add("Beerathlon");
| pojo.getHobbies().add("Triathlon");
| cache.putObject("/test/"+(j), pojo);
| }
| Thread.sleep(6000);
| System.out.println(tester.cache.getObject(Fqn.fromString("/test/3")));
|
|
|
the last print will be null, why can not retrieve data from cache?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961466#3961466
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961466
19 years, 9 months
[Clustering/JBoss] - Need help trying to expose singleton mbean interface to all
by markfrench
Hi,
I currently have an mbean deployed in the deploy-hasingleton directory which I need to have its interface accessible via jndi to all nodes. The following is it's related deployment descriptor:
<?xml version="1.0" encoding="UTF-8"?>
| <server>
| <mbean
| code="com.transtoll.modules.eventmanager.management.EventContainer" name="eventmanager:service=eventcontainer">
| </mbean>
|
|
| <mbean code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
| name="jboss.jmx:type=adaptor,name=HASingletonEventContainerInvoker,protocol=jrmp,service=proxyFactory">
| <depends optional-attribute-name="InvokerName">
| jboss:service=invoker,type=pooled
| </depends>
| <depends optional-attribute-name="TargetName">
| eventmanager:service=eventcontainer
| </depends>
| <attribute name="JndiName">HASingletonEventContainer</attribute>
| <attribute name="InvokeTargetMethod">true</attribute>
| <attribute name="ExportedInterfaces">
| com.transtoll.modules.eventmanager.management.EventContainerMBean
| </attribute>
| <attribute name="ClientInterceptors">
| <interceptors>
| <interceptor>
| org.jboss.proxy.ClientMethodInterceptor
| </interceptor>
| <interceptor>
| org.jboss.invocation.InvokerInterceptor
| </interceptor>
| </interceptors>
| </attribute>
| </mbean>
| </server>
This bean based on the hajndi wiki page but for some reason the JNDI entry doesn't appear in any of the slave nodes. Is something wrong or is it not possible with jboss 4.0.4 and I have to use the RMIAdaptor and JMX calls?
Cheers
Mark
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961460#3961460
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961460
19 years, 9 months