[jboss-jira] [JBoss JIRA] Commented: (JBCLUSTER-189) Avoid service to start at startup
Brian Stansberry (JIRA)
jira-events at lists.jboss.org
Tue Jan 29 10:02:59 EST 2008
[ http://jira.jboss.com/jira/browse/JBCLUSTER-189?page=comments#action_12397358 ]
Brian Stansberry commented on JBCLUSTER-189:
--------------------------------------------
This is not a clustering issue. I'm going to move it to the JBoss Application Server (JBAS) project and let it be automatically assigned.
The priority (blocker, etc) is to be determined by whoever handles it.
If you need a workaround I think it would be fairly easy to:
1) Subclass ScheduleManager.
2) Add a boolean started field.
3) Change isStarted() to return the value of 'started'
4) Set started = true in startSchedules(), started=false in stopSchedules()
> Avoid service to start at startup
> ---------------------------------
>
> Key: JBCLUSTER-189
> URL: http://jira.jboss.com/jira/browse/JBCLUSTER-189
> Project: JBoss Clustering
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Reporter: web websson
> Assigned To: Brian Stansberry
> Priority: Blocker
>
> According documentation, if attribute "StartAtStartup" of ScheduleManager is set to false, the service should not trigger, which happends regardless the state of the element.
> I've create a very simple test project similar to ExampleHelloWorldService:
> The Management Interface:
> package com.demo;
> public interface HelloWorldServiceMBean extends ServiceMBean{
> public void perform(Date now, long remainingRepetitions);
> }
> The Service Implementation:
> package com.demo.mbean;
> public class HelloWorldService extends ServiceMBeanSupport implements HelloWorldServiceMBean{
> public void perform( Date now, long remainingRepetitions ){
> log.info( "[perform]: " + now.toString() );
> }
> }
> The deployment descriptor (jboss-service.xml):
> <server>
> <mbean code="org.jboss.varia.scheduler.ScheduleManager"
> name="jboss:service=ScheduleManagerDemo">
>
> <attribute name="StartAtStartup">false</attribute>
> </mbean>
>
> <mbean code="com.demo.mbean.HelloWorldService"
> name="com.demo:service=HelloWorldService">
> </mbean>
>
> <mbean code="org.jboss.varia.scheduler.SingleScheduleProvider"
> name="jboss:service=HAImportScheduleProviderDemo">
>
> <depends>jboss:service=ScheduleManagerDemo</depends>
> <depends>com.demo:service=HelloWorldService</depends>
>
> <attribute name="ScheduleManagerName">jboss:service=ScheduleManagerDemo</attribute>
> <attribute name="TargetName">com.demo:service=HelloWorldService</attribute>
> <attribute name="TargetMethod">perform( DATE, REPETITIONS )</attribute>
> <attribute name="DateFormat" />
> <attribute name="StartDate">NOW</attribute>
> <attribute name="Period">2000</attribute>
> <attribute name="Repetitions">-1</attribute>
> </mbean>
> </server>
>
> And everything deployed in a sar file with the following structure:
> hello-world.sar
> hello-world.sar/META-INF/jboss-service.xml
> hello-world.sar/com/demo/HelloWorldService.class
> hello-world.sar/com/demo/HelloWorldServiceMBean.class
>
> Despite the element StartAtStartup of ScheduleManager is set to false, the service trigger anyway.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list