org.jboss.deployment.scanner
Class URLDeploymentScanner

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src) 
      extended byorg.jboss.system.ServiceMBeanSupport (src) 
          extended byorg.jboss.deployment.scanner.AbstractDeploymentScanner (src) 
              extended byorg.jboss.deployment.scanner.URLDeploymentScanner
All Implemented Interfaces:
DeploymentScanner (src) , MBeanRegistration (src) , NotificationBroadcaster (src) , NotificationEmitter (src) , Service (src) , ServiceMBean (src)
Direct Known Subclasses:
FarmMemberService (src) , HttpURLDeploymentScanner (src)

public class URLDeploymentScanner
extends AbstractDeploymentScanner (src)
implements DeploymentScanner (src)

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


Nested Class Summary
protected  class URLDeploymentScanner.DeployedURL (src)
          A container and help class for a deployed URL.
 
Nested classes inherited from class org.jboss.deployment.scanner.AbstractDeploymentScanner (src)
AbstractDeploymentScanner.ScannerThread (src)
 
Field Summary
protected  java.util.Set deployedSet
          A set of scanned urls which have been deployed.
protected  boolean doRecursiveSearch
           
protected  URLLister.URLFilter (src) filter
          Allow a filter for scanned directories
protected  IncompleteDeploymentException (src) lastIncompleteDeploymentException
           
protected  java.io.File serverHome
          The server's home directory, for relative paths.
protected  java.net.URL serverHomeURL
           
protected  java.util.Comparator sorter
          A sorter urls from a scaned directory to allow for coarse dependency ordering based on file type
protected  java.util.List urlList
          The list of URLs to scan.
 
Fields inherited from class org.jboss.deployment.scanner.AbstractDeploymentScanner (src)
deployer, mainDeployer, scanEnabled, scannerThread, scanPeriod
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport (src)
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean (src)
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(java.lang.String urlspec)
           
 void addURL(java.net.URL url)
           
protected  void deploy(URLDeploymentScanner.DeployedURL (src)  du)
          A helper to deploy the given URL with the deployer.
 java.lang.String getFilter()
           
 URLLister.URLFilter (src) getFilterInstance()
           
 boolean getRecursiveSearch()
           
 java.lang.String getURLComparator()
           
 java.util.List getURLList()
           
 boolean hasURL(java.lang.String urlspec)
           
 boolean hasURL(java.net.URL url)
           
protected  boolean isDeployed(java.net.URL url)
          Checks if the url is in the deployed set.
protected  java.net.URL makeURL(java.lang.String urlspec)
          A helper to make a URL from a full url, or a filespec.
 ObjectName (src) preRegister(MBeanServer (src)  server, ObjectName (src)  name)
          Callback method of MBeanRegistration before the MBean is registered at the JMX Agent.
 void removeURL(java.lang.String urlspec)
           
 void removeURL(java.net.URL url)
           
 void scan()
          Scan for deployment changes.
 void setFilter(java.lang.String classname)
           
 void setFilterInstance(URLLister.URLFilter (src)  filter)
           
 void setRecursiveSearch(boolean recurse)
           
 void setURLComparator(java.lang.String classname)
           
 void setURLList(java.util.List list)
           
 void setURLs(java.lang.String listspec)
           
protected  void undeploy(URLDeploymentScanner.DeployedURL (src)  du)
          A helper to undeploy the given URL from the deployer.
protected  boolean updateSorter()
           
 
Methods inherited from class org.jboss.deployment.scanner.AbstractDeploymentScanner (src)
createService, destroyService, getDeployer, getScanPeriod, isScanEnabled, setDeployer, setScanEnabled, setScanPeriod, startService, stopService
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport (src)
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 (src)
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 (src)
getDeployer, getScanPeriod, isScanEnabled, setDeployer, setScanEnabled, setScanPeriod
 
Methods inherited from interface org.jboss.system.Service (src)
create, destroy, start, stop
 

Field Detail

urlList

protected java.util.List urlList
The list of URLs to scan.


deployedSet

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


serverHome

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


serverHomeURL

protected java.net.URL serverHomeURL

sorter

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


filter

protected URLLister.URLFilter (src)  filter
Allow a filter for scanned directories


lastIncompleteDeploymentException

protected IncompleteDeploymentException (src)  lastIncompleteDeploymentException

doRecursiveSearch

protected boolean doRecursiveSearch
Constructor Detail

URLDeploymentScanner

public URLDeploymentScanner()
Method Detail

setRecursiveSearch

public void setRecursiveSearch(boolean recurse)

getRecursiveSearch

public boolean getRecursiveSearch()

setURLList

public void setURLList(java.util.List list)

setURLComparator

public void setURLComparator(java.lang.String classname)
                      throws java.lang.ClassNotFoundException,
                             java.lang.IllegalAccessException,
                             java.lang.InstantiationException
Parameters:
classname - The name of a Comparator class.
Throws:
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.InstantiationException

getURLComparator

public java.lang.String getURLComparator()

setFilter

public void setFilter(java.lang.String classname)
               throws java.lang.ClassNotFoundException,
                      java.lang.IllegalAccessException,
                      java.lang.InstantiationException
Parameters:
classname - The name of a FileFilter class.
Throws:
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.InstantiationException

getFilter

public java.lang.String getFilter()

setFilterInstance

public void setFilterInstance(URLLister.URLFilter (src)  filter)
Parameters:
filter - The URLFilter instance

getFilterInstance

public URLLister.URLFilter (src)  getFilterInstance()

getURLList

public java.util.List getURLList()

addURL

public void addURL(java.net.URL url)

removeURL

public void removeURL(java.net.URL url)

hasURL

public boolean hasURL(java.net.URL url)

setURLs

public void setURLs(java.lang.String listspec)
             throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException

makeURL

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

Throws:
java.net.MalformedURLException

addURL

public void addURL(java.lang.String urlspec)
            throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException

removeURL

public void removeURL(java.lang.String urlspec)
               throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException

hasURL

public boolean hasURL(java.lang.String urlspec)
               throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException

deploy

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


undeploy

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


isDeployed

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


scan

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

Specified by:
scan in interface DeploymentScanner (src)
Specified by:
scan in class AbstractDeploymentScanner (src)
Throws:
java.lang.Exception

updateSorter

protected boolean updateSorter()

preRegister

public ObjectName (src)  preRegister(MBeanServer (src)  server,
                              ObjectName (src)  name)
                       throws java.lang.Exception
Description copied from class: ServiceMBeanSupport (src)
Callback method of MBeanRegistration (src) 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 MBeanRegistration (src)
Overrides:
preRegister in class ServiceMBeanSupport (src)
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:
java.lang.Exception