geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: incubator-geronimo/modules/core/src/java/org/apache/geronimo/deployment/scanner DeploymentScannerMBean.java DeploymentScanner.java
Date Sat, 16 Aug 2003 23:16:30 GMT
dain        2003/08/16 16:16:30

  Modified:    modules/core/src/java/org/apache/geronimo/deployment/scanner
                        DeploymentScannerMBean.java DeploymentScanner.java
  Log:
  Initial revision of deployment dependency management system.
  
  Revision  Changes    Path
  1.5       +4 -6      incubator-geronimo/modules/core/src/java/org/apache/geronimo/deployment/scanner/DeploymentScannerMBean.java
  
  Index: DeploymentScannerMBean.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/deployment/scanner/DeploymentScannerMBean.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DeploymentScannerMBean.java	13 Aug 2003 01:56:06 -0000	1.4
  +++ DeploymentScannerMBean.java	16 Aug 2003 23:16:30 -0000	1.5
  @@ -59,13 +59,15 @@
   import java.net.URL;
   import java.util.Set;
   
  +import org.apache.geronimo.common.StateManageable;
  +
   /**
    *
    *
    *
    * @version $Revision$ $Date$
    */
  -public interface DeploymentScannerMBean {
  +public interface DeploymentScannerMBean extends StateManageable {
       static final String SCAN_COMPLETE = "org.apache.geronimo.deployment.SCAN_COMPLETE";
   
       long getScanInterval();
  @@ -81,10 +83,6 @@
       void removeURL(String url) throws MalformedURLException;
   
       void scanNow();
  -
  -    void start();
  -
  -    void stop();
   
       Set getWatchedURLs();
   }
  
  
  
  1.7       +8 -20     incubator-geronimo/modules/core/src/java/org/apache/geronimo/deployment/scanner/DeploymentScanner.java
  
  Index: DeploymentScanner.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/deployment/scanner/DeploymentScanner.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DeploymentScanner.java	13 Aug 2003 01:56:06 -0000	1.6
  +++ DeploymentScanner.java	16 Aug 2003 23:16:30 -0000	1.7
  @@ -73,6 +73,7 @@
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   import org.apache.geronimo.jmx.JMXUtil;
  +import org.apache.geronimo.common.AbstractStateManageable;
   
   /**
    * An MBean that maintains a list of URLs and periodically invokes a Scanner
  @@ -81,31 +82,17 @@
    *
    * @version $Revision$ $Date$
    */
  -public class DeploymentScanner implements DeploymentScannerMBean, MBeanRegistration {
  +public class DeploymentScanner extends AbstractStateManageable implements DeploymentScannerMBean
{
       private static final Log log = LogFactory.getLog(DeploymentScanner.class);
  -    private MBeanServer server;
       private RelationServiceMBean relationService;
  -    private ObjectName objectName;
  -
       private final Map scanners = new HashMap();
       private long scanInterval;
       private boolean run;
       private Thread scanThread;
   
  -    public ObjectName preRegister(MBeanServer mBeanServer, ObjectName objectName) throws
Exception {
  -        this.server = mBeanServer;
  -        this.objectName = objectName;
  +    public ObjectName preRegister(MBeanServer server, ObjectName objectName) throws Exception
{
           relationService = JMXUtil.getRelationService(server);
  -        return objectName;
  -    }
  -
  -    public void postRegister(Boolean aBoolean) {
  -    }
  -
  -    public void preDeregister() throws Exception {
  -    }
  -
  -    public void postDeregister() {
  +        return super.preRegister(server, objectName);
       }
   
       public synchronized long getScanInterval() {
  @@ -154,7 +141,7 @@
           return run;
       }
   
  -    public synchronized void start() {
  +    public synchronized void doStart() throws Exception {
           if (scanThread == null) {
               run = true;
               scanThread = new Thread("DeploymentScanner: ObjectName=" + objectName) {
  @@ -172,7 +159,7 @@
           }
       }
   
  -    public synchronized void stop() {
  +    public synchronized void doStop() throws Exception {
           run = false;
           if (scanThread != null) {
               scanThread.interrupt();
  @@ -208,6 +195,7 @@
   
           try {
               Map controllers = relationService.findAssociatedMBeans(objectName, "DeploymentController-DeploymentScanner",
"DeploymentScanner");
  +            log.trace("Found " + controllers.size() + " controller(s)");
               if (!controllers.isEmpty()) {
                   Set set = controllers.keySet();
                   ObjectName controller = (ObjectName) set.iterator().next();
  
  
  

Mime
View raw message