-
Feature Request
-
Resolution: Obsolete
-
Minor
-
JBossAS-4.0.2 Final
-
None
-
None
Hi,
it would be cool, if the URLDeploymentScanner would support a method that allows to add a new URL and
to make an instant deployment of this URL (resp. to remove a URL and instantly to undeploy the URL).
I implemented it this way:
/**
- adds the url to the url list and if required deploys by performing a
- scan.
- @param url
- the added url
- @param scan
- true if scan is required
*/
public void addURL(String url, Boolean scan) throws Exception {
// first we remove the url, otherwise deployment of the same url let the
// urlList grow
if (url == null)
throw new NullArgumentException("url");
urlList.remove(makeURL(url));
addURL(url);
log.info("Added URL called <" + url + ">");
if (scan.booleanValue())
}
/**
- removes the URL from the urllist and performs a scan if required.
- @param url
- the removed url
- @param scan
- true if scan is required
*/
public void removeURL(String url, Boolean scan) throws Exception {
super.removeURL(url);
log.info("Removed URL called <" + url + ">");
if (scan.booleanValue())
}
/**
- performs a scan
- @throws Exception
*/
protected void doScan() throws Exception {
/* - scanning has to run in a doPrivileged block because several
- permissions are needed to deploy its not maintainable to grant all
- those permission to a principal in order to execute addUrl the
- principal must have MBeanPermissions those permissions are granted.
*/
try {
AccessController.doPrivileged(new PrivilegedExceptionAction()Unknown macro: { public Object run() throws Exception { scan(); return null; } });
{ throw e.getException(); }
} catch (PrivilegedActionException e)}
Regards