001: /*
002: * JBoss, Home of Professional Open Source.
003: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
004: * as indicated by the @author tags. See the copyright.txt file in the
005: * distribution for a full listing of individual contributors.
006: *
007: * This is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU Lesser General Public License as
009: * published by the Free Software Foundation; either version 2.1 of
010: * the License, or (at your option) any later version.
011: *
012: * This software is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this software; if not, write to the Free
019: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021: */
022: package org.jboss.deployment.scanner;
023:
024: import javax.management.ObjectName;
025:
026: import org.jboss.system.Service;
027:
028: /**
029: * Provides the basic interface for a deployment scanner.
030: *
031: * <p>A deployment scanner scans for new, removed or changed
032: * deployments.
033: *
034: * @jmx:mbean extends="org.jboss.system.ServiceMBean"
035: *
036: * @version <tt>$Revision: 57205 $</tt>
037: * @author <a href="mailto:jason@planet57.com">Jason Dillon</a>
038: */
039: public interface DeploymentScanner extends Service {
040: /**
041: * The ObjectName of the {@link Deployer} which we will use.
042: *
043: * @param deployerName The object name of the deployer to use.
044: *
045: * @jmx:managed-attribute
046: */
047: void setDeployer(ObjectName deployerName);
048:
049: /**
050: * Get the ObjectName of the {@link Deployer} which we are using.
051: *
052: * @return The object name of the deployer we are using.
053: *
054: * @jmx:managed-attribute
055: */
056: ObjectName getDeployer();
057:
058: /**
059: * Set the scan period for the scanner.
060: *
061: * @param period This is the time in milliseconds between scans.
062: *
063: * @throws IllegalArgumentException Period value out of range.
064: *
065: * @jmx:managed-attribute
066: */
067: void setScanPeriod(long period);
068:
069: /**
070: * Get the scan period for the scanner.
071: *
072: * @return This is the time in milliseconds between scans.
073: */
074: long getScanPeriod();
075:
076: /**
077: * Disable or enable the period based deployment scanning.
078: *
079: * <p>Manual scanning can still be performed by calling
080: * {@link #scan}.
081: *
082: * @param flag True to enable or false to disable period
083: * based scanning.
084: *
085: * @jmx:managed-attribute
086: */
087: void setScanEnabled(boolean flag);
088:
089: /**
090: * Check if period based scanning is enabled.
091: *
092: * @return True if enabled, false if disabled.
093: *
094: * @jmx:managed-attribute
095: */
096: boolean isScanEnabled();
097:
098: /**
099: * Scan for deployment changes.
100: *
101: * @throws IllegalStateException Not initialized.
102: * @throws Exception Scan failed.
103: *
104: * @jmx:managed-operation
105: */
106: void scan() throws Exception;
107: }
|