package org.jpos.q2.qbean;

import org.jdom.Element;
import org.jdom.Comment;
import org.jpos.iso.ISOUtil;
import org.jpos.q2.Q2;
import org.jpos.q2.QBean;
import org.jpos.q2.QBeanSupport;

import org.jpos.util.Logger;
import org.jpos.util.SimpleLogSource;

/**
 * Sample QBean
 *
 * @author <a href="mailto:apr@cs.com.uy">Alejandro P. Revilla</a>
 * @author <a href="mailto:taherkordy@dpi2.dpi.net.ir">Alireza Taherkordi</a>
 * @version $Revision$ $Date$
 */
public class QTest extends QBeanSupport implements Runnable {
    SimpleLogSource log;
    public QTest () {
        super();
        log = new SimpleLogSource (Logger.getLogger (Q2.LOGGER_NAME), "QTest");
        log.info ("constructor");
    }
    public void init () {
        log.info ("init");
        super.init ();
    }
    public void start() {
        log.info ("start");
        super.start ();
    }
    public void stop () {
        log.info ("stop");
        super.stop ();
    }
    public void destroy () {
        log.info ("destroy");
        log = null;
    }
    public void setPersist (Element e) {
        log.info ("setPersist");
        super.setPersist (e);
    }
    public Element getPersist () {
        log.info ("getPersist");
        return super.getPersist ();
    }
    public void run () {
        int tickCount = 0;
        while (running ()) {
            log.info ("tick " + tickCount);
            if (tickCount++ % 10 == 0) {
                super.getPersist ().addContent (
                    new Comment (" tickCount = " + (tickCount-1) + " ")
                );
                setModified (true);
            }
            ISOUtil.sleep (1000);
        }
        setState (QBean.STOPPED);
    }
    public void startService() {
        new Thread(this).start();
    }
    public void setName (String name) {
        log.setRealm ("QTest:" + name);
        super.setName (name);
    }
}


@@ -207,19 +207,16 @@
 util.Log
-ger
 ;%0Aimport
@@ -230,31 +230,22 @@
 os.util.
-SimpleLogSource
+Logger
 ;%0A%0A/**%0A 
@@ -507,31 +507,19 @@
 e %7B%0A    
-SimpleLogSource
+Log
  log;%0A  
@@ -573,45 +573,18 @@
 g = 
-new SimpleLogSource (Logger
+Log
 .getLog
-ger
  (Q2
@@ -595,17 +595,16 @@
 GER_NAME
-)
 , %22QTest

Use Log instead of SimpleLogSource