[jboss-cvs] JBossAS SVN: r85289 - in trunk/system/src/main/org/jboss/system/server: profileservice/hotdeploy and 3 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Mar 5 06:11:39 EST 2009
Author: emuckenhuber
Date: 2009-03-05 06:11:38 -0500 (Thu, 05 Mar 2009)
New Revision: 85289
Modified:
trunk/system/src/main/org/jboss/system/server/profile/repository/AbstractImmutableProfile.java
trunk/system/src/main/org/jboss/system/server/profile/repository/AbstractProfile.java
trunk/system/src/main/org/jboss/system/server/profileservice/hotdeploy/HDScanner.java
trunk/system/src/main/org/jboss/system/server/profileservice/persistence/AttachmentPropertyPopulator.java
trunk/system/src/main/org/jboss/system/server/profileservice/persistence/xml/AbstractPersisitedValue.java
trunk/system/src/main/org/jboss/system/server/profileservice/persistence/xml/PersistedCompositeValue.java
trunk/system/src/main/org/jboss/system/server/profileservice/persistence/xml/PersistedSimpleValue.java
trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractProfileDeployment.java
trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractProfileFactory.java
trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractVFSProfileSource.java
trunk/system/src/main/org/jboss/system/server/profileservice/repository/ImmutableDeploymentRepository.java
trunk/system/src/main/org/jboss/system/server/profileservice/repository/MainDeployerAdapter.java
trunk/system/src/main/org/jboss/system/server/profileservice/repository/MutableDeploymentRepository.java
trunk/system/src/main/org/jboss/system/server/profileservice/repository/TypedProfileRepository.java
Log:
minor cleanup
Modified: trunk/system/src/main/org/jboss/system/server/profile/repository/AbstractImmutableProfile.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profile/repository/AbstractImmutableProfile.java 2009-03-05 10:31:17 UTC (rev 85288)
+++ trunk/system/src/main/org/jboss/system/server/profile/repository/AbstractImmutableProfile.java 2009-03-05 11:11:38 UTC (rev 85289)
@@ -33,7 +33,7 @@
import org.jboss.virtual.VirtualFile;
/**
- * A immutable profile.
+ * A immutable vfs based profile.
*
* @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
* @version $Revision$
@@ -83,6 +83,11 @@
return this.subProfiles;
}
+ public void setSubProfiles(List<ProfileKey> subProfiles)
+ {
+ this.subProfiles = subProfiles;
+ }
+
@Override
public ProfileDeployment getDeployment(String vfsPath) throws NoSuchDeploymentException
{
@@ -109,20 +114,15 @@
}
return ctx;
}
-
- public void setSubProfiles(List<ProfileKey> subProfiles)
- {
- this.subProfiles = subProfiles;
- }
public boolean hasDeployment(String name)
{
if(name == null)
throw new IllegalArgumentException("Null name.");
- // FIXME
+
try
{
- return getDeployment(name) != null;
+ return super.getDeployment(name) != null;
}
catch(Exception e)
{
Modified: trunk/system/src/main/org/jboss/system/server/profile/repository/AbstractProfile.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profile/repository/AbstractProfile.java 2009-03-05 10:31:17 UTC (rev 85288)
+++ trunk/system/src/main/org/jboss/system/server/profile/repository/AbstractProfile.java 2009-03-05 11:11:38 UTC (rev 85289)
@@ -30,7 +30,6 @@
import org.jboss.profileservice.spi.ModificationInfo;
import org.jboss.profileservice.spi.MutableProfile;
import org.jboss.profileservice.spi.NoSuchDeploymentException;
-import org.jboss.profileservice.spi.Profile;
import org.jboss.profileservice.spi.ProfileDeployment;
import org.jboss.profileservice.spi.ProfileKey;
@@ -122,11 +121,10 @@
return this.repository.getLastModified();
}
- @SuppressWarnings("unchecked")
public Collection<ModificationInfo> getModifiedDeployments() throws Exception
{
if(this.hotdeployEnabled == false)
- return Collections.EMPTY_SET;
+ return Collections.emptySet();
return this.repository.getModifiedDeployments();
}
Modified: trunk/system/src/main/org/jboss/system/server/profileservice/hotdeploy/HDScanner.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/hotdeploy/HDScanner.java 2009-03-05 10:31:17 UTC (rev 85288)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/hotdeploy/HDScanner.java 2009-03-05 11:11:38 UTC (rev 85289)
@@ -33,6 +33,7 @@
import org.jboss.logging.Logger;
import org.jboss.profileservice.spi.ModificationInfo;
import org.jboss.profileservice.spi.MutableProfile;
+import org.jboss.profileservice.spi.NoSuchProfileException;
import org.jboss.profileservice.spi.Profile;
import org.jboss.profileservice.spi.ProfileDeployment;
import org.jboss.profileservice.spi.ProfileKey;
@@ -268,20 +269,30 @@
boolean modified = false;
for(ProfileKey key : activeProfiles)
{
- Profile profile = profileService.getActiveProfile(key);
- if( profile == null || profile.isMutable() == false)
+ // The profile
+ Profile profile = null;
+ try
{
+ profile = profileService.getActiveProfile(key);
+ }
+ catch(NoSuchProfileException ignore)
+ {
+ if(trace)
+ log.debug("failed to get profile for key: "+ key);
+ continue;
+ }
+ // Check if it's a mutable profile
+ if( profile.isMutable() == false)
+ {
if( trace )
- log.trace("End deployment scan, no activeProfile");
- return;
+ log.trace("Ignoring not mutable profile: "+ key);
+ continue;
}
MutableProfile activeProfile = (MutableProfile) profile;
// Current workaround for JBAS-4206
if(firstProfile == null)
firstProfile = activeProfile;
-
-
Collection<ModificationInfo> modifiedDeployments = activeProfile.getModifiedDeployments();
for(ModificationInfo info : modifiedDeployments)
{
Modified: trunk/system/src/main/org/jboss/system/server/profileservice/persistence/AttachmentPropertyPopulator.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/persistence/AttachmentPropertyPopulator.java 2009-03-05 10:31:17 UTC (rev 85288)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/persistence/AttachmentPropertyPopulator.java 2009-03-05 11:11:38 UTC (rev 85289)
@@ -31,7 +31,6 @@
import org.jboss.managed.api.factory.ManagedObjectFactory;
import org.jboss.managed.spi.factory.InstanceClassFactory;
import org.jboss.metatype.api.types.MetaType;
-import org.jboss.metatype.api.values.CompositeValue;
import org.jboss.metatype.api.values.MetaValue;
import org.jboss.metatype.api.values.MetaValueFactory;
@@ -104,10 +103,5 @@
icf.setValue(beanInfo, property, attachment, value);
}
-
- protected void setObjectNameWorkaround(ManagedProperty property, Object attachment, CompositeValue value) throws Throwable
- {
-
- }
}
Modified: trunk/system/src/main/org/jboss/system/server/profileservice/persistence/xml/AbstractPersisitedValue.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/persistence/xml/AbstractPersisitedValue.java 2009-03-05 10:31:17 UTC (rev 85288)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/persistence/xml/AbstractPersisitedValue.java 2009-03-05 11:11:38 UTC (rev 85289)
@@ -24,8 +24,8 @@
import javax.xml.bind.annotation.XmlAttribute;
/**
+ * A abstract persisted value.
*
- *
* @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
* @version $Revision$
*/
Modified: trunk/system/src/main/org/jboss/system/server/profileservice/persistence/xml/PersistedCompositeValue.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/persistence/xml/PersistedCompositeValue.java 2009-03-05 10:31:17 UTC (rev 85288)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/persistence/xml/PersistedCompositeValue.java 2009-03-05 11:11:38 UTC (rev 85289)
@@ -59,7 +59,7 @@
protected void toString(StringBuilder builder)
{
- builder.append(", keySet = ").append(this.values);
+ builder.append(", values = ").append(this.values);
}
}
Modified: trunk/system/src/main/org/jboss/system/server/profileservice/persistence/xml/PersistedSimpleValue.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/persistence/xml/PersistedSimpleValue.java 2009-03-05 10:31:17 UTC (rev 85288)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/persistence/xml/PersistedSimpleValue.java 2009-03-05 11:11:38 UTC (rev 85289)
@@ -42,7 +42,7 @@
private String value;
/** The modification info. */
- ModificationInfo info;
+ private ModificationInfo info;
public PersistedSimpleValue()
{
Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractProfileDeployment.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractProfileDeployment.java 2009-03-05 10:31:17 UTC (rev 85288)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractProfileDeployment.java 2009-03-05 11:11:38 UTC (rev 85289)
@@ -46,7 +46,7 @@
/** The attachments. */
private Map<String, Object> attachments = new ConcurrentHashMap<String, Object>();
- /** The serialVersionUID */
+ /** The serialVersionUID. */
private static final long serialVersionUID = -2600392045205267112L;
/**
Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractProfileFactory.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractProfileFactory.java 2009-03-05 10:31:17 UTC (rev 85288)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractProfileFactory.java 2009-03-05 11:11:38 UTC (rev 85289)
@@ -35,9 +35,10 @@
/**
* The abstract profile factory.
- * This does actually just creates a abstract profile for now!
*
- * TODO maybe move to spi ?
+ * TODO this should create the profile based on the meta data,
+ * as it only creates a AbstractProfile with it's DeploymentRepository
+ * at the moment.
*
* @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
* @version $Revision$
Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractVFSProfileSource.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractVFSProfileSource.java 2009-03-05 10:31:17 UTC (rev 85288)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractVFSProfileSource.java 2009-03-05 11:11:38 UTC (rev 85289)
@@ -113,7 +113,7 @@
// Unload
this.applicationCtxs.clear();
this.applicationVFCache.clear();
- this.lastModified = 0;
+ updateLastModfied();
}
public void addDeployment(String vfsPath, ProfileDeployment d) throws Exception
@@ -123,7 +123,8 @@
if(d == null)
throw new IllegalArgumentException("Null deployment");
- this.applicationCtxs.put(vfsPath, d);
+ // Add deployment and vfs
+ this.applicationCtxs.put(d.getName(), d);
if(d.getRoot() != null)
this.applicationVFCache.put(d.getName(), d.getRoot());
updateLastModfied();
@@ -263,4 +264,3 @@
this.lastModified = System.currentTimeMillis();
}
}
-
Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/ImmutableDeploymentRepository.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/ImmutableDeploymentRepository.java 2009-03-05 10:31:17 UTC (rev 85288)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/ImmutableDeploymentRepository.java 2009-03-05 11:11:38 UTC (rev 85289)
@@ -55,10 +55,9 @@
updateLastModfied();
}
- @SuppressWarnings("unchecked")
public Collection<ModificationInfo> getModifiedDeployments() throws Exception
{
- return Collections.EMPTY_LIST;
+ return Collections.emptySet();
}
public String addDeploymentContent(String vfsPath, InputStream contentIS) throws IOException
Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/MainDeployerAdapter.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/MainDeployerAdapter.java 2009-03-05 10:31:17 UTC (rev 85288)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/MainDeployerAdapter.java 2009-03-05 11:11:38 UTC (rev 85289)
@@ -109,7 +109,7 @@
}
/**
- * Process...
+ * Process ...
*
*/
public void process()
Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/MutableDeploymentRepository.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/MutableDeploymentRepository.java 2009-03-05 10:31:17 UTC (rev 85288)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/MutableDeploymentRepository.java 2009-03-05 11:11:38 UTC (rev 85289)
@@ -264,10 +264,12 @@
contentLock.writeLock().lock();
try
{
+ // Remove the deployment from the filesystem
ProfileDeployment deployment = getDeployment(vfsPath);
VirtualFile root = deployment.getRoot();
if(root.delete() == false)
throw new IOException("Failed to delete: " + root);
+ // Cleanup
return super.removeDeployment(deployment.getName());
}
finally
Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/TypedProfileRepository.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/TypedProfileRepository.java 2009-03-05 10:31:17 UTC (rev 85288)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/TypedProfileRepository.java 2009-03-05 11:11:38 UTC (rev 85289)
@@ -42,7 +42,6 @@
* the exposed types.
*
* TODO reuse DeploymentRepositories with the same sources ?
- * TODO check if there are
*
* @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
* @version $Revision$
@@ -91,8 +90,7 @@
ProfileSourceMetaData source = metaData.getSource();
- // NOTE this is a hack :)
- // TODO the filtering should be done by the profile itself!
+ // FIXME the filtering should be done by the profile itself!
if(source instanceof FilteredProfileSourceMetaData)
{
((FilteredProfileSourceMetaData) source).setDeployments(metaData.getDeployments());
More information about the jboss-cvs-commits
mailing list