Announcement Announcement Module
Collapse
No announcement yet.
Can MC4J modify MBean's properties? Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can MC4J modify MBean's properties?

    MC4J shows each MBean I exported from normal beans, i.e. Quartz task beans and I see 2 properties: "CronExpression" and "NextFireTime" and their getter/setter.

    But it seems that MC4J doesn't make effect after I modify values of the "CronExpression" and "NextFireTime" even I click "Execute" button of these methods.

    Here is my spring xml configuration and the MC4J shows:

    schedule-config.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
    
    	<bean	class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
    		<property name="triggers">
    			<list>
    				<ref bean="poScheduleTask" />
    			</list>
    		</property>
    	</bean>
    	<bean id="baseJobDetail" abstract="true">
    		<property name="concurrent" value="false" />
    	</bean>
    
    	<bean id="poScheduleTask"
    		class="org.springframework.scheduling.quartz.CronTriggerBean">
    		<property name="jobDetail">
    			<bean
    				class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"
    				parent="baseJobDetail">
    				<property name="targetObject" ref="poService" />
    				<property name="targetMethod" value="printDate" />
    			</bean>
    		</property>
    		<property name="cronExpression" value="0/5 * * * * ?" />
    	</bean>
    
    </beans>
    jmx-config.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
    
    	<bean
    		class="org.springframework.jmx.support.ConnectorServerFactoryBean"
    		depends-on="rmiRegistry">
    		<property name="objectName" value="connector:name=rmi" />
    		<property name="serviceUrl"
    			value="service:jmx:rmi:///jndi/rmi://localhost:1099/myframework" />
    	</bean>
    	<bean id="rmiRegistry"
    		class="org.springframework.remoting.rmi.RmiRegistryFactoryBean">
    		<property name="alwaysCreate" value="true" />
    	</bean>
    
    	<bean class="org.springframework.jmx.export.MBeanExporter">
    		<property name="beans">
    			<map>
    				<entry key="myframework:name=poScheduleTask"
    					value-ref="poScheduleTask" />
    			</map>
    		</property>
    		<property name="assembler">
    			<bean
    				class="org.springframework.jmx.export.assembler.MethodNameBasedMBeanInfoAssembler">
    				<property name="managedMethods">
    					<list>
    						<value>getCronExpression</value>
    						<value>setCronExpression</value>
    						<value>getNextFireTime</value>
    						<value>setNextFireTime</value>
    					</list>
    				</property>
    			</bean>
    		</property>
    	</bean>
    
    </beans>
    MC4J
    see the attachment.
    Last edited by charles-xie; Mar 21st, 2009, 04:55 AM.

  • #2
    I make it more clear:
    I change the cronExpresstion from "0/5 * * * * ?" to "0/10 * * * * ?" and the nextFireTime in MC4J, but it seems that the task still run every 5 seconds.

    Comment


    • #3
      I am facing exactly the same problem. Does anyone have a solution for this?

      Comment


      • #4
        Iam facing same problem with jconsole.

        Iam facing same problem with jconsole.

        Comment

        Working...
        X