[jboss-cvs] JBossAS SVN: r69702 - in trunk/system/src/main/org/jboss: system/server/profile/basic and 2 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Feb 7 13:59:45 EST 2008
Author: scott.stark at jboss.org
Date: 2008-02-07 13:59:45 -0500 (Thu, 07 Feb 2008)
New Revision: 69702
Modified:
trunk/system/src/main/org/jboss/profileservice/spi/DeploymentRepository.java
trunk/system/src/main/org/jboss/profileservice/spi/Profile.java
trunk/system/src/main/org/jboss/system/server/profile/basic/ProfileImpl.java
trunk/system/src/main/org/jboss/system/server/profile/repository/ProfileImpl.java
trunk/system/src/main/org/jboss/system/server/profileservice/repository/RepositoryAdminAdaptor.java
trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java
Log:
Add a lastModified property to the profile and repository spi.
Modified: trunk/system/src/main/org/jboss/profileservice/spi/DeploymentRepository.java
===================================================================
--- trunk/system/src/main/org/jboss/profileservice/spi/DeploymentRepository.java 2008-02-07 18:57:30 UTC (rev 69701)
+++ trunk/system/src/main/org/jboss/profileservice/spi/DeploymentRepository.java 2008-02-07 18:59:45 UTC (rev 69702)
@@ -43,6 +43,7 @@
public void create() throws Exception;
public void load() throws Exception;
public void remove() throws Exception;
+ public long getLastModified();
public URI getDeploymentURI(DeploymentPhase phase);
public void setDeploymentURI(URI uri, DeploymentPhase phase);
Modified: trunk/system/src/main/org/jboss/profileservice/spi/Profile.java
===================================================================
--- trunk/system/src/main/org/jboss/profileservice/spi/Profile.java 2008-02-07 18:57:30 UTC (rev 69701)
+++ trunk/system/src/main/org/jboss/profileservice/spi/Profile.java 2008-02-07 18:59:45 UTC (rev 69702)
@@ -52,6 +52,12 @@
String getVersion();
/**
+ * Get the system time in milliseconds the profile was last modified.
+ * @return System.currentTimeMillis of last modification
+ */
+ long getLastModified();
+
+ /**
* Get the names of the deployments in the profile
* @return names of deployments
*/
Modified: trunk/system/src/main/org/jboss/system/server/profile/basic/ProfileImpl.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profile/basic/ProfileImpl.java 2008-02-07 18:57:30 UTC (rev 69701)
+++ trunk/system/src/main/org/jboss/system/server/profile/basic/ProfileImpl.java 2008-02-07 18:59:45 UTC (rev 69702)
@@ -68,6 +68,8 @@
private LinkedHashMap<String, VFSDeployment> deployers = new LinkedHashMap<String, VFSDeployment>();
/** Is hot deployment checking enabled */
private volatile boolean hotdeployEnabled;
+ /** The last time the profile was modified */
+ private long lastModified;
public ProfileImpl(String profileRoot, ProfileKey key)
{
@@ -91,6 +93,12 @@
return null;
}
+
+ public long getLastModified()
+ {
+ return this.lastModified;
+ }
+
/**
* Get the names of the applications in the profile
* @return names of applications
@@ -137,7 +145,8 @@
case APPLICATION:
this.addApplication(d);
break;
- }
+ }
+ this.lastModified = System.currentTimeMillis();
}
public void updateDeployment(VFSDeployment d, DeploymentPhase phase)
throws Exception
@@ -331,6 +340,8 @@
applications.put(d.getName(), d);
}
}
+ if(modified.size() > 0)
+ lastModified = System.currentTimeMillis();
return modified;
}
Modified: trunk/system/src/main/org/jboss/system/server/profile/repository/ProfileImpl.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profile/repository/ProfileImpl.java 2008-02-07 18:57:30 UTC (rev 69701)
+++ trunk/system/src/main/org/jboss/system/server/profile/repository/ProfileImpl.java 2008-02-07 18:59:45 UTC (rev 69702)
@@ -81,6 +81,13 @@
{
return version;
}
+
+
+ public long getLastModified()
+ {
+ return repository.getLastModified();
+ }
+
/**
* Get the names of the deployments in the profile
* @return names of deployments
Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/RepositoryAdminAdaptor.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/RepositoryAdminAdaptor.java 2008-02-07 18:57:30 UTC (rev 69701)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/RepositoryAdminAdaptor.java 2008-02-07 18:59:45 UTC (rev 69702)
@@ -76,6 +76,8 @@
private File adminEditsRoot;
/** The profile key this repository is associated with */
private ProfileKey key;
+ /** The last time the profile was modified */
+ private long lastModified;
public void addDeployment(String vfsPath, VFSDeployment d, DeploymentPhase phase)
throws Exception
@@ -97,7 +99,13 @@
MutableRepository repo = this.getRepository(adminEditsRoot.toURI());
AttachmentsResource attachments = new AttachmentsResource(vfsPath, edits, repo);
repo.addResource(attachments);
+ lastModified = System.currentTimeMillis();
}
+
+ public long getLastModified()
+ {
+ return this.lastModified;
+ }
public void create() throws Exception
{
@@ -136,6 +144,7 @@
if( adminEditsRoot.mkdirs() == false )
throw new IOException("Failed to create profile adminEdits dir: "+adminEditsRoot);
delegate.addRepository(adminEditsRoot.toURI());
+ lastModified = System.currentTimeMillis();
}
public VFSDeployment getDeployment(String name, DeploymentPhase phase)
@@ -363,6 +372,8 @@
}
}
}
+ if(modified.size() > 0)
+ lastModified = System.currentTimeMillis();
return modified;
}
Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java 2008-02-07 18:57:30 UTC (rev 69701)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java 2008-02-07 18:59:45 UTC (rev 69702)
@@ -94,6 +94,8 @@
private LinkedHashMap<String,VFSDeployment> applicationCtxs = new LinkedHashMap<String,VFSDeployment>();
/** The {@link VFSDeployment#getTransientManagedObjects()} serializer */
private AttachmentsSerializer serializer;
+ /** The last time the profile was modified */
+ private long lastModified;
public SerializableDeploymentRepository(File root, URI[] appURIs, ProfileKey key)
{
@@ -137,6 +139,11 @@
return profileRoot.exists();
}
+ public long getLastModified()
+ {
+ return this.lastModified;
+ }
+
public URI getDeploymentURI(DeploymentPhase phase)
{
URI uri = null;
@@ -365,6 +372,8 @@
}
}
}
+ if(modified.size() > 0)
+ lastModified = System.currentTimeMillis();
return modified;
}
@@ -508,6 +517,7 @@
VFS deployVFS = VFS.getVFS(applicationDir.toURI());
loadApplications(deployVFS.getRoot());
}
+ this.lastModified = System.currentTimeMillis();
}
/**
@@ -538,6 +548,7 @@
oos.writeObject(map);
oos.close();
fos.close();
+ lastModified = System.currentTimeMillis();
}
protected void addDeployer(String vfsPath, VFSDeployment ctx)
More information about the jboss-cvs-commits
mailing list