org.abstracthorizon.extend.server.deployment.support
Class RedeployURLScanner

java.lang.Object
  extended by org.abstracthorizon.extend.server.deployment.support.RedeployURLScanner
All Implemented Interfaces:
Runnable

public class RedeployURLScanner
extends Object
implements Runnable

This class scanns for list of URLs at intervals defined in scheduler and checks if there are changes. In case of changes it removes, adds or redploys modules from given URLs.

Author:
Daniel Sendula

Nested Class Summary
protected static class RedeployURLScanner.URLDetails
          Internal representation of URL details
 
Field Summary
protected  DeploymentManager manager
          Reference to the deployment manager
protected  Map<URL,RedeployURLScanner.URLDetails> map
          Map of URLs and URL details
protected  SimpleScheduler scheduler
          Scheduler to check changes in this directory
 
Constructor Summary
RedeployURLScanner()
          Constructor
 
Method Summary
 void addURL(URL url, Module module)
          Adds new URL to be scanned for changes
 void destroy()
          Removes this object from scheduler
 DeploymentManager getDeploymentManager()
          Returns main deployer (DeploymentManager);
 SimpleScheduler getScheduler()
          Returns scheduler (SimpleScheduler)
protected  SimpleScheduler getSchedulerInternal()
          This method is used internally for scheduler to be obtained.
 void init()
          Schedules running of this runnable object
 void removeURL(URL url)
          Removes url
 void run()
          Main method that scans for changes
 void setDeploymentManager(DeploymentManager manager)
          Sets main deployer (DeploymentManager);
 void setScheduler(SimpleScheduler scheduler)
          Sets scheduler (SimpleScheduler).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

manager

protected DeploymentManager manager
Reference to the deployment manager


scheduler

protected SimpleScheduler scheduler
Scheduler to check changes in this directory


map

protected Map<URL,RedeployURLScanner.URLDetails> map
Map of URLs and URL details

Constructor Detail

RedeployURLScanner

public RedeployURLScanner()
Constructor

Method Detail

init

public void init()
Schedules running of this runnable object


destroy

public void destroy()
Removes this object from scheduler


run

public void run()
Main method that scans for changes

Specified by:
run in interface Runnable

getDeploymentManager

public DeploymentManager getDeploymentManager()
Returns main deployer (DeploymentManager);

Returns:
main deployer (DeploymentManager);

setDeploymentManager

public void setDeploymentManager(DeploymentManager manager)
Sets main deployer (DeploymentManager);

Parameters:
manager - main deployer (DeploymentManager);

setScheduler

public void setScheduler(SimpleScheduler scheduler)
Sets scheduler (SimpleScheduler).

Parameters:
scheduler - scheduler

getScheduler

public SimpleScheduler getScheduler()
Returns scheduler (SimpleScheduler)

Returns:
scheduler

getSchedulerInternal

protected SimpleScheduler getSchedulerInternal()
This method is used internally for scheduler to be obtained. If scheduler is not assigned then KernelScheduler is going to be used.

Returns:
scheduler or newly created scheduler

addURL

public void addURL(URL url,
                   Module module)
Adds new URL to be scanned for changes

Parameters:
url - url (currently must be of file protocol)
module - moduel that is already loaded

removeURL

public void removeURL(URL url)
Removes url

Parameters:
url - url to be removed


Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.