站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 system API Documentation 英文版文档

URLDeploymentScanner (JBoss System API) - JBoss 4.0.1 sp1 system API Documentation 英文版文档


org.jboss.deployment.scanner
Class URLDeploymentScanner

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended byorg.jboss.system.ServiceMBeanSupport
          extended byorg.jboss.deployment.scanner.AbstractDeploymentScanner
              extended byorg.jboss.deployment.scanner.URLDeploymentScanner
All Implemented Interfaces:
DeploymentScanner, DeploymentScannerMBean, javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, Service, ServiceMBean, URLDeploymentScannerMBean
Direct Known Subclasses:
HttpURLDeploymentScanner

public class URLDeploymentScanner
extends AbstractDeploymentScanner
implements DeploymentScanner, URLDeploymentScannerMBean

A URL-based deployment scanner. Supports local directory scanning for file-based urls.

Version:
$Revision: 1.32 $
Author:
Jason Dillon

Nested Class Summary
protected  class URLDeploymentScanner.DeployedURL
          A container and help class for a deployed URL.
 
Nested classes inherited from class org.jboss.deployment.scanner.AbstractDeploymentScanner
AbstractDeploymentScanner.ScannerThread
 
Field Summary
protected  Set deployedSet
          A set of scanned urls which have been deployed.
protected  boolean doRecursiveSearch
           
protected  org.jboss.net.protocol.URLLister.URLFilter filter
          Allow a filter for scanned directories
protected  IncompleteDeploymentException lastIncompleteDeploymentException
           
protected  File serverHome
          The server's home directory, for relative paths.
protected  URL serverHomeURL
           
protected  Comparator sorter
          A sorter urls from a scaned directory to allow for coarse dependency ordering based on file type
protected  List urlList
          The list of URLs to scan.
 
Fields inherited from class org.jboss.deployment.scanner.AbstractDeploymentScanner
deployer, mainDeployer, scanEnabled, scannerThread, scanPeriod
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
URLDeploymentScanner()
           
 
Method Summary
 void addURL(String urlspec)
           
 void addURL(URL url)
           
protected  void deploy(URLDeploymentScanner.DeployedURL du)
          A helper to deploy the given URL with the deployer.
 String getFilter()
           
 boolean getRecursiveSearch()
           
 String getURLComparator()
           
 List getURLList()
           
 boolean hasURL(String urlspec)
           
 boolean hasURL(URL url)
           
protected  boolean isDeployed(URL url)
          Checks if the url is in the deployed set.
protected  URL makeURL(String urlspec)
          A helper to make a URL from a full url, or a filespec.
 javax.management.ObjectName preRegister(javax.management.MBeanServer server, javax.management.ObjectName name)
          Callback method of MBeanRegistration before the MBean is registered at the JMX Agent.
 void removeURL(String urlspec)
           
 void removeURL(URL url)
           
 void scan()
          Scan for deployment changes.
 void setFilter(String classname)
           
 void setRecursiveSearch(boolean recurse)
           
 void setURLComparator(String classname)
           
 void setURLList(List list)
           
 void setURLs(String listspec)
           
protected  void undeploy(URLDeploymentScanner.DeployedURL du)
          A helper to undeploy the given URL from the deployer.
protected  boolean updateSorter()
           
 
Methods inherited from class org.jboss.deployment.scanner.AbstractDeploymentScanner
createService, destroyService, getDeployer, getScanPeriod, isScanEnabled, setDeployer, setScanEnabled, setScanPeriod, startService, stopService
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport
create, destroy, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, start, stop
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.deployment.scanner.DeploymentScanner
getDeployer, getScanPeriod, isScanEnabled, setDeployer, setScanEnabled, setScanPeriod
 
Methods inherited from interface org.jboss.system.Service
create, destroy, start, stop
 
Methods inherited from interface org.jboss.deployment.scanner.DeploymentScannerMBean
getDeployer, isScanEnabled, setDeployer, setScanEnabled, setScanPeriod
 
Methods inherited from interface org.jboss.system.ServiceMBean
getName, getState, getStateString, jbossInternalLifecycle
 

Field Detail

urlList

protected List urlList
The list of URLs to scan.


deployedSet

protected Set deployedSet
A set of scanned urls which have been deployed.


serverHome

protected File serverHome
The server's home directory, for relative paths.


serverHomeURL

protected URL serverHomeURL

sorter

protected Comparator sorter
A sorter urls from a scaned directory to allow for coarse dependency ordering based on file type


filter

protected org.jboss.net.protocol.URLLister.URLFilter filter
Allow a filter for scanned directories


lastIncompleteDeploymentException

protected IncompleteDeploymentException lastIncompleteDeploymentException

doRecursiveSearch

protected boolean doRecursiveSearch
Constructor Detail

URLDeploymentScanner

public URLDeploymentScanner()
Method Detail

setRecursiveSearch

public void setRecursiveSearch(boolean recurse)
Specified by:
setRecursiveSearch in interface URLDeploymentScannerMBean

getRecursiveSearch

public boolean getRecursiveSearch()
Specified by:
getRecursiveSearch in interface URLDeploymentScannerMBean

setURLList

public void setURLList(List list)
Specified by:
setURLList in interface URLDeploymentScannerMBean

setURLComparator

public void setURLComparator(String classname)
                      throws ClassNotFoundException,
                             IllegalAccessException,
                             InstantiationException
Specified by:
setURLComparator in interface URLDeploymentScannerMBean
Parameters:
classname - The name of a Comparator class.
Throws:
ClassNotFoundException
IllegalAccessException
InstantiationException

getURLComparator

public String getURLComparator()
Specified by:
getURLComparator in interface URLDeploymentScannerMBean

setFilter

public void setFilter(String classname)
               throws ClassNotFoundException,
                      IllegalAccessException,
                      InstantiationException
Specified by:
setFilter in interface URLDeploymentScannerMBean
Parameters:
classname - The name of a FileFilter class.
Throws:
ClassNotFoundException
IllegalAccessException
InstantiationException

getFilter

public String getFilter()
Specified by:
getFilter in interface URLDeploymentScannerMBean

getURLList

public List getURLList()
Specified by:
getURLList in interface URLDeploymentScannerMBean

addURL

public void addURL(URL url)
Specified by:
addURL in interface URLDeploymentScannerMBean

removeURL

public void removeURL(URL url)
Specified by:
removeURL in interface URLDeploymentScannerMBean

hasURL

public boolean hasURL(URL url)
Specified by:
hasURL in interface URLDeploymentScannerMBean

setURLs

public void setURLs(String listspec)
             throws MalformedURLException
Specified by:
setURLs in interface URLDeploymentScannerMBean
Throws:
MalformedURLException

makeURL

protected URL makeURL(String urlspec)
               throws MalformedURLException
A helper to make a URL from a full url, or a filespec.

Throws:
MalformedURLException

addURL

public void addURL(String urlspec)
            throws MalformedURLException
Specified by:
addURL in interface URLDeploymentScannerMBean
Throws:
MalformedURLException

removeURL

public void removeURL(String urlspec)
               throws MalformedURLException
Specified by:
removeURL in interface URLDeploymentScannerMBean
Throws:
MalformedURLException

hasURL

public boolean hasURL(String urlspec)
               throws MalformedURLException
Specified by:
hasURL in interface URLDeploymentScannerMBean
Throws:
MalformedURLException

deploy

protected void deploy(URLDeploymentScanner.DeployedURL du)
A helper to deploy the given URL with the deployer.


undeploy

protected void undeploy(URLDeploymentScanner.DeployedURL du)
A helper to undeploy the given URL from the deployer.


isDeployed

protected boolean isDeployed(URL url)
Checks if the url is in the deployed set.


scan

public void scan()
          throws Exception
Description copied from interface: DeploymentScanner
Scan for deployment changes.

Specified by:
scan in interface DeploymentScanner
Specified by:
scan in class AbstractDeploymentScanner
Throws:
Exception

updateSorter

protected boolean updateSorter()

preRegister

public javax.management.ObjectName preRegister(javax.management.MBeanServer server,
                                               javax.management.ObjectName name)
                                        throws Exception
Description copied from class: ServiceMBeanSupport
Callback method of MBeanRegistration before the MBean is registered at the JMX Agent.

Attention: Always call this method when you overwrite it in a subclass because it saves the Object Name of the MBean.

Specified by:
preRegister in interface javax.management.MBeanRegistration
Overrides:
preRegister in class ServiceMBeanSupport
Parameters:
server - Reference to the JMX Agent this MBean is registered on
name - Name specified by the creator of the MBean. Note that you can overwrite it when the given ObjectName is null otherwise the change is discarded (maybe a bug in JMX-RI).
Throws:
Exception


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.