User: acoliver
Date: 06/04/16 20:29:00
Modified: src/main/org/jboss/deployment/scanner Tag: Branch_4_0
URLDeploymentScanner.java
URLDeploymentScannerMBean.java
Log:
Add abillity to ignore a file while it is being updated and then
re-attend to it once it is updated (assuming that some other
service will attend to bringing the runtime in sync without
re-deployment)
Revision Changes Path
No revision
No revision
1.32.2.6 +81 -11
jboss-system/src/main/org/jboss/deployment/scanner/URLDeploymentScanner.java
(In the diff below, changes in quantity of whitespace are not
shown.)
Index: URLDeploymentScanner.java
===================================================================
RCS file:
/cvsroot/jboss/jboss-system/src/main/org/jboss/deployment/scanner/URLDeploymentScanner.java,v
retrieving revision 1.32.2.5
retrieving revision 1.32.2.6
diff -u -b -r1.32.2.5 -r1.32.2.6
--- URLDeploymentScanner.java 29 Oct 2005 05:06:09 -0000
1.32.2.5
+++ URLDeploymentScanner.java 17 Apr 2006 00:29:00 -0000
1.32.2.6
@@ -56,12 +56,14 @@
*
* @jmx:mbean
extends="org.jboss.deployment.scanner.DeploymentScannerMBean"
*
- * @version <tt>$Revision: 1.32.2.5 $</tt>
+ * @version <tt>$Revision: 1.32.2.6 $</tt>
* @author <a href="mailto:[EMAIL PROTECTED]">Jason Dillon</a>
*/
public class URLDeploymentScanner extends AbstractDeploymentScanner
implements DeploymentScanner, URLDeploymentScannerMBean
{
+ /** The list of URLs to skip **/
+ protected List skipList = Collections.synchronizedList(new
ArrayList());
/** The list of URLs to scan. */
protected List urlList = Collections.synchronizedList(new
ArrayList());
@@ -251,6 +253,66 @@
return urlList.contains(url);
}
+ /**
+ * You can ask the deployment scanner NOT to update a URL that
you are + * about to change. This must be the same as the
actual deployment URL and
+ * not the minor watchURL (deployment descriptor). This
operation ADDs a
+ * url to the list of "not" urls. The actual time/datestamp of
the deployed
+ * url will be modified to reflect the timestamp as if the url
were actually
+ * deployed the first time scan is called either
programmatically as an + * mbean operation call or during normal
temporal operations. Note that this
+ * only affects UPDATES (redeploy) not undeploy or
deploy(obviously).
+ *
+ * @jmx:managed-operation
+ */
+ public void addNotURL(final URL url) + { //ACO wuz here
+ if (url == null)
+ throw new NullArgumentException("url");
+ if (!skipList.contains(url)) + {
+ skipList.add(url);
+ } + }
+
+ /**
+ * removes a url from the list of urls NOT to update. Make
sure that you
+ * call scan before removing urls or if the scan window is wide
enough the + * timestamp may not get updated. (the scan window
IS wide enough by default)
+ *
+ * @jmx:managed-operation
+ */
+ public void removeNotURL(final URL url) + { //ACO wuz here
+ if (url == null)
+ throw new NullArgumentException("url");
+ if (skipList.contains(url)) + {
+ skipList.remove(url);
+ }
+ }
+
+ /**
+ * list all deployed urls for this deployment scanner instance
in a big comma + * and carriage return seperated list
+ *
+ * @jmx:managed-operation
+ */
+ public String listDeployed() {
+ String retval = "";
+ Iterator i = deployedSet.iterator();
+ while (i.hasNext()) {
+ String url = i.next().toString();
+ if (!retval.equals("")) {
+ retval += ",\n"+url;
+ } + else + {
+ retval += url;
+ }
+ }
+ return retval;
+ }
/////////////////////////////////////////////////////////////////////////
// Management/Configuration
Helpers //
@@ -331,8 +393,15 @@
}
try
{
+ if(!skipList.contains(du.url)) + {
deployer.deploy(du.url);
}
+ else + {
+ du.deployed();
+ }
+ }
catch (IncompleteDeploymentException e)
{
lastIncompleteDeploymentException = e;
@@ -361,7 +430,10 @@
{
log.trace("Undeploying: " + du);
}
+ if (!skipList.contains(du.url)) + {
deployer.undeploy(du.url);
+ }
deployedSet.remove(du);
}
catch (Exception e)
@@ -606,7 +678,8 @@
protected class DeployedURL
{
public URL url;
- public URL watchUrl;
+ public URL watchUrl; // the url to watch to decide if we
need to redeploy
+ // usually the deployment descriptor
public long deployedLastModified;
public DeployedURL(final URL url)
@@ -642,11 +715,7 @@
{
if (watchUrl == null)
{
- //
- // jason: getWatchUrl() is not part of Deployer
interface.. wtf is this?
- //
- try
- {
+ try {
Object o = getServer().invoke(getDeployer(),
"getWatchUrl",
new Object[] { url },
new String[] { URL.class.getName() });
@@ -666,7 +735,8 @@
if (watchUrl != null)
{
connection = watchUrl.openConnection();
- } else
+ } + else
{
connection = url.openConnection();
}
1.4.2.4 +25 -0
jboss-system/src/main/org/jboss/deployment/scanner/URLDeploymentScannerMBean.java
(In the diff below, changes in quantity of whitespace are not
shown.)
Index: URLDeploymentScannerMBean.java
===================================================================
RCS file:
/cvsroot/jboss/jboss-system/src/main/org/jboss/deployment/scanner/URLDeploymentScannerMBean.java,v
retrieving revision 1.4.2.3
retrieving revision 1.4.2.4
diff -u -b -r1.4.2.3 -r1.4.2.4
--- URLDeploymentScannerMBean.java 29 Oct 2005 05:06:09 -0000
1.4.2.3
+++ URLDeploymentScannerMBean.java 17 Apr 2006 00:29:00 -0000
1.4.2.4
@@ -59,10 +59,35 @@
void addURL(java.lang.String urlspec) throws
java.net.MalformedURLException;
+ /** + * You can ask the deployment scanner NOT to
update a URL that you are
+ * about to change. This must be the same as the actual
deployment URL and
+ * not the minor watchURL (deployment descriptor). This
operation ADDs a
+ * url to the list of "not" urls. The actual time/datestamp of
the deployed
+ * url will be modified to reflect the timestamp as if the url
were actually
+ * deployed the first time scan is called either
programmatically as an
+ * mbean operation call or during normal temporal operations.
Note that this
+ * only affects UPDATES (redeploy) not undeploy or
deploy(obviously).
+ */ + void addNotURL(java.net.URL url);
+
+ /** + * removes a url from the list of urls NOT to
update. Make sure that you
+ * call scan before removing urls or if the scan window is wide
enough the
+ * timestamp may not get updated. (the scan window IS wide
enough by default)
+ */
+ public void removeNotURL(java.net.URL url);
+
void removeURL(java.lang.String urlspec) throws
java.net.MalformedURLException;
boolean hasURL(java.lang.String urlspec) throws
java.net.MalformedURLException;
+ /**
+ * list all deployed urls for this deployment scanner instance
in a big comma
+ * and carriage return seperated list
+ */
+ public String listDeployed(); +
void scan() throws java.lang.Exception;
}
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting
language
that extends applications into web and mobile media. Attend the live
webcast
and join the prime developer group breaking into this new coding
territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
jboss-cvs-commits mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-cvs-commits