[jboss-cvs] jboss-docs/jbossas/j2ee/examples/src/main/org/jboss/book/misc/ex2 ...

Norman Richards norman.richards at jboss.com
Wed Nov 1 13:14:20 EST 2006


  User: nrichards
  Date: 06/11/01 13:14:20

  Added:       jbossas/j2ee/examples/src/main/org/jboss/book/misc/ex2  
                        ExSchedulable.java jboss-service.xml
  Log:
  modified for j2ee guide
  
  Revision  Changes    Path
  1.1      date: 2006/11/01 18:14:20;  author: nrichards;  state: Exp;jboss-docs/jbossas/j2ee/examples/src/main/org/jboss/book/misc/ex2/ExSchedulable.java
  
  Index: ExSchedulable.java
  ===================================================================
  package org.jboss.book.misc.ex2;
  
  import java.util.Date;
  import org.jboss.varia.scheduler.Schedulable;
  
  import org.apache.log4j.Logger;
  
  /** A simple Schedulable example.
   * @author Scott.Stark at jboss.org
   * @version $Revision: 1.1 $
   */
  public class ExSchedulable implements Schedulable
  {
     private static final Logger log = Logger.getLogger(ExSchedulable.class);
  
     private String name;
     private long value;
  
     public ExSchedulable(String name, long value)
     {
        this.name = name;
        this.value = value;
        log.info("ctor, name: " + name + ", value: " + value);
     }
  
     public void perform(Date now, long remainingRepetitions)
     {
        log.info("perform, now: " + now +
           ", remainingRepetitions: " + remainingRepetitions +
           ", name: " + name + ", value: " + value);
     }
  }
  
  
  
  1.1      date: 2006/11/01 18:14:20;  author: nrichards;  state: Exp;jboss-docs/jbossas/j2ee/examples/src/main/org/jboss/book/misc/ex2/jboss-service.xml
  
  Index: jboss-service.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <server>    
      <mbean code="org.jboss.varia.scheduler.Scheduler"
             name="jboss.docs:service=Scheduler">
          <attribute name="StartAtStartup">true</attribute>
          <attribute name="SchedulableClass">org.jboss.book.misc.ex2.ExSchedulable</attribute>
          <attribute name="SchedulableArguments">TheName,123456789</attribute>
          <attribute name="SchedulableArgumentTypes">java.lang.String,long</attribute>
          <attribute name="InitialStartDate">NOW</attribute>
          <attribute name="SchedulePeriod">60000</attribute>
          <attribute name="InitialRepetitions">-1</attribute>
      </mbean>
  </server>
  
  
  



More information about the jboss-cvs-commits mailing list