[jboss-cvs] JBossAS SVN: r102290 - in projects/profileservice/trunk: core/src/main/java/org/jboss/profileservice/dependency and 11 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Mar 11 09:56:15 EST 2010
Author: emuckenhuber
Date: 2010-03-11 09:56:13 -0500 (Thu, 11 Mar 2010)
New Revision: 102290
Added:
projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/actions/
projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/actions/BasicModificationContext.java
projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/actions/BasicProfileModificationActions.java
projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/managed/
projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/managed/ManagedProfile.java
projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/managed/ManagedProfileDeployer.java
Modified:
projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/AbstractProfileService.java
projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/ProfileControllerContext.java
projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/ProfileDeployAction.java
projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/plugin/ProfileLifeCycleCallbackActions.java
projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/hotdeploy/AbstractHDScannerFactory.java
projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/hotdeploy/HDScanner.java
projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/hotdeploy/HDScannerFactory.java
projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/hotdeploy/HDScannerLifeCycleCallback.java
projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/AbstractActionController.java
projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/deployment/test/HDScannerUnitTestCase.java
projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/AggregatingLocalManagementView.java
projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/ManagementViewWrapper.java
projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/RegisteredProfileViewsWrapper.java
projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/actions/ProfileViewUpdateAction.java
projects/profileservice/trunk/spi/pom.xml
projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/engine/ActionController.java
Log:
expose additional profile management information
Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/AbstractProfileService.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/AbstractProfileService.java 2010-03-11 13:47:33 UTC (rev 102289)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/AbstractProfileService.java 2010-03-11 14:56:13 UTC (rev 102290)
@@ -132,18 +132,6 @@
/**
* {@inheritDoc}
*/
- public Profile getActiveProfile(ProfileKey key) throws NoSuchProfileException
- {
- if(key == null)
- {
- throw new IllegalArgumentException("null profile key");
- }
- return controller.getInstalledContext(key).getProfile();
- }
-
- /**
- * {@inheritDoc}
- */
public ProfileKey registerProfile(ProfileMetaData metaData) throws Exception
{
return registerProfile(metaData, null);
Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/ProfileControllerContext.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/ProfileControllerContext.java 2010-03-11 13:47:33 UTC (rev 102289)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/ProfileControllerContext.java 2010-03-11 14:56:13 UTC (rev 102290)
@@ -23,9 +23,13 @@
import org.jboss.beans.metadata.spi.BeanMetaData;
import org.jboss.kernel.plugins.dependency.AbstractKernelControllerContext;
+import org.jboss.managed.api.ManagedDeployment;
import org.jboss.profileservice.deployment.ProfileDeployerPlugin;
import org.jboss.profileservice.spi.Profile;
+import org.jboss.profileservice.spi.ProfileDeployment;
import org.jboss.profileservice.spi.ProfileKey;
+import org.jboss.profileservice.spi.managed.ManagedProfile;
+import org.jboss.profileservice.spi.managed.ManagedProfileDeployer;
import org.jboss.profileservice.spi.metadata.ProfileMetaData;
/**
@@ -34,7 +38,7 @@
* @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
* @version $Revision$
*/
-public class ProfileControllerContext extends AbstractKernelControllerContext
+public class ProfileControllerContext extends AbstractKernelControllerContext implements ManagedProfile
{
/** Some additional meta data information. */
@@ -60,19 +64,62 @@
return getDependencyContext().getProfileMetaData();
}
- public ProfileDeployerPlugin getDeployerPlugin()
+ public ManagedProfileDeployer getManagedDeployer()
{
- return getDependencyContext().getDeployer();
+ return new DelegateDeployer(this);
}
+ public ManagedDeployment getManagedDeployment(ProfileDeployment deployment) throws Exception
+ {
+ return getDeployerPlugin().getManagedDeployment(deployment);
+ }
+
public ProfileDependencyContext getDependencyContext()
{
return metaDataContext;
}
+
+ ProfileDeployerPlugin getDeployerPlugin()
+ {
+ return getDependencyContext().getDeployer();
+ }
void setDependencyContext(ProfileDependencyContext ctx)
{
this.metaDataContext = ctx;
}
+
+ static class DelegateDeployer implements ManagedProfileDeployer
+ {
+
+ private final ProfileControllerContext delegate;
+
+ public DelegateDeployer(ProfileControllerContext context)
+ {
+ this.delegate = context;
+ }
+
+ public void addDeployment(ProfileDeployment deployment) throws Exception
+ {
+ delegate.getDeployerPlugin().addDeployment(delegate.getProfileKey(), deployment);
+ }
+
+ public void checkComplete(String... names) throws Exception
+ {
+ delegate.getDeployerPlugin().checkComplete(names);
+ }
+
+ public void process()
+ {
+ delegate.getDeployerPlugin().process();
+ }
+
+ public void removeDeployment(ProfileDeployment deployment) throws Exception
+ {
+ delegate.getDeployerPlugin().removeDeployment(delegate.getProfileKey(), deployment);
+ }
+
+ }
+
}
Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/ProfileDeployAction.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/ProfileDeployAction.java 2010-03-11 13:47:33 UTC (rev 102289)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/ProfileDeployAction.java 2010-03-11 14:56:13 UTC (rev 102290)
@@ -28,12 +28,11 @@
import org.jboss.kernel.plugins.dependency.InstallsAwareAction;
import org.jboss.kernel.spi.dependency.KernelControllerContext;
import org.jboss.logging.Logger;
-import org.jboss.profileservice.deployment.ProfileDeployerPlugin;
import org.jboss.profileservice.spi.NoSuchProfileException;
import org.jboss.profileservice.spi.Profile;
import org.jboss.profileservice.spi.ProfileDeployment;
-import org.jboss.profileservice.spi.ProfileKey;
import org.jboss.profileservice.spi.deployment.ProfileDeploymentFlag;
+import org.jboss.profileservice.spi.managed.ManagedProfileDeployer;
/**
* deploy/undeploy action. This deploys/undeploys the profile deployments
@@ -80,7 +79,7 @@
if(profile.getDeployments() != null & profile.getDeployments().isEmpty() == false)
{
// Get the deployer plugin
- ProfileDeployerPlugin deployer = context.getDeployerPlugin();
+ ManagedProfileDeployer deployer = context.getManagedDeployer();
if(deployer == null)
{
throw new IllegalStateException("null deployer for profile " + profile.getKey());
@@ -111,7 +110,7 @@
if(profile.getDeployments() != null & profile.getDeployments().isEmpty() == false)
{
// Get the deployer plugin
- ProfileDeployerPlugin deployer = context.getDeployerPlugin();
+ ManagedProfileDeployer deployer = context.getManagedDeployer();
if(deployer == null)
{
throw new IllegalStateException("null deployer for profile " + profile.getKey());
@@ -122,19 +121,18 @@
super.uninstallActionInternal(ctx);
}
- protected void deploy(Profile profile, ProfileDeployerPlugin deployer) throws Exception
+ protected void deploy(Profile profile, ManagedProfileDeployer deployer) throws Exception
{
Collection<? extends ProfileDeployment> deployments = profile.getDeployments();
if (deployments != null && !deployments.isEmpty())
{
- final ProfileKey key = profile.getKey();
// Add deployments
for (ProfileDeployment deployment : profile.getDeployments())
{
try
{
// Add deployment
- deployer.addDeployment(key, deployment);
+ deployer.addDeployment(deployment);
// mark as deployed
deployment.getDeploymentInfo().setFlag(ProfileDeploymentFlag.DEPLOYED);
}
@@ -148,19 +146,18 @@
}
}
- protected void undeploy(Profile profile, ProfileDeployerPlugin deployer)
+ protected void undeploy(Profile profile, ManagedProfileDeployer deployer)
{
Collection<ProfileDeployment> deployments = profile.getDeployments();
if (deployments != null && !deployments.isEmpty())
{
- final ProfileKey key = profile.getKey();
// remove deployments
for (ProfileDeployment deployment : profile.getDeployments())
{
try
{
// remove deployment
- deployer.removeDeployment(key, deployment);
+ deployer.removeDeployment(deployment);
}
catch(Throwable t)
{
Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/plugin/ProfileLifeCycleCallbackActions.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/plugin/ProfileLifeCycleCallbackActions.java 2010-03-11 13:47:33 UTC (rev 102289)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/dependency/plugin/ProfileLifeCycleCallbackActions.java 2010-03-11 14:56:13 UTC (rev 102290)
@@ -141,7 +141,7 @@
processCallbacks(profile, metaDataCtx, true);
// Register the profile
- actionController.addProfile(profile);
+ actionController.addProfile(context);
}
}
}
@@ -157,7 +157,7 @@
if(profile != null && metaDataCtx != null)
{
// Unregister the profile
- actionController.removeProfile(profile);
+ actionController.removeProfile(context);
// Process uninstall callbacks
processCallbacks(profile, metaDataCtx, false);
Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/hotdeploy/AbstractHDScannerFactory.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/hotdeploy/AbstractHDScannerFactory.java 2010-03-11 13:47:33 UTC (rev 102289)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/hotdeploy/AbstractHDScannerFactory.java 2010-03-11 14:56:13 UTC (rev 102290)
@@ -30,7 +30,6 @@
import java.util.concurrent.atomic.AtomicBoolean;
import org.jboss.logging.Logger;
-import org.jboss.profileservice.spi.MutableProfile;
import org.jboss.profileservice.spi.ProfileKey;
import org.jboss.profileservice.spi.action.engine.ActionController;
@@ -94,13 +93,8 @@
* {@inheritDoc}
*/
@Override
- public Scanner registerScanner(MutableProfile profile, ScannerConfiguration configuration)
+ public Scanner registerScanner(ProfileKey key, ScannerConfiguration configuration)
{
- if(profile == null)
- {
- throw new IllegalArgumentException("null profile");
- }
- ProfileKey key = profile.getKey();
if(key == null)
{
throw new IllegalArgumentException("null profile key");
@@ -113,7 +107,7 @@
{
throw new IllegalArgumentException("scanner already registered for profile " + key);
}
- HDScanner scanner = new HDScanner(profile, null);
+ HDScanner scanner = new HDScanner(key, actionController);
ScannerWrapper wrapper = createScannerWrapper(key, scanner, configuration);
if(wrapper.isStartAutomatically() && enabled.get())
{
Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/hotdeploy/HDScanner.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/hotdeploy/HDScanner.java 2010-03-11 13:47:33 UTC (rev 102289)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/hotdeploy/HDScanner.java 2010-03-11 14:56:13 UTC (rev 102290)
@@ -23,15 +23,22 @@
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.logging.Logger;
-import org.jboss.profileservice.deployment.ProfileDeployerPlugin;
+import org.jboss.profileservice.management.actions.BasicProfileModificationActions;
import org.jboss.profileservice.spi.ModificationInfo;
import org.jboss.profileservice.spi.MutableProfile;
import org.jboss.profileservice.spi.ProfileDeployment;
import org.jboss.profileservice.spi.ProfileKey;
-import org.jboss.profileservice.spi.action.deployment.DeploymentAction;
+import org.jboss.profileservice.spi.action.ProfileModificationAction;
+import org.jboss.profileservice.spi.action.ProfileModificationContext;
+import org.jboss.profileservice.spi.action.ProfileModificationType;
+import org.jboss.profileservice.spi.action.engine.ActionController;
+import org.jboss.profileservice.spi.action.engine.ModificationStatus;
+import org.jboss.profileservice.spi.managed.ManagedProfile;
+import org.jboss.profileservice.spi.managed.ManagedProfileDeployer;
/**
* The HDScanner.
@@ -52,18 +59,16 @@
/** The number of scans that have been done. */
private int scanCount = 0;
- /** The mutable profile. */
- private final MutableProfile profile;
+ /** The profile key. */
+ private ProfileKey key;
- /** TODO we should not use the deployer here.
- * @see DeploymentAction
- */
- private final ProfileDeployerPlugin deployer;
+ /** the action controller. */
+ private ActionController controller;
- protected HDScanner(MutableProfile profile, ProfileDeployerPlugin plugin)
+ protected HDScanner(ProfileKey key, ActionController controller)
{
- this.profile = profile;
- this.deployer = plugin;
+ this.key = key;
+ this.controller = controller;
}
/**
@@ -73,7 +78,7 @@
*/
protected ProfileKey getKey()
{
- return profile.getKey();
+ return key;
}
@Override
@@ -121,52 +126,30 @@
boolean trace = log.isTraceEnabled();
if(trace)
{
- log.debug("Begin deployment scan: " + profile.getKey());
+ log.debug("Begin deployment scan: " + getKey());
}
- boolean modified = false;
- Collection<String> modifiedDeploymentNames = new ArrayList<String>();
- Collection<ModificationInfo> modifiedDeployments = profile.getModifiedDeployments();
- for (ModificationInfo info : modifiedDeployments)
+ // Get the profile
+ ManagedProfile managedProfile = controller.getManagedProfile(key);
+ if(managedProfile == null)
{
- ProfileDeployment ctx = info.getDeployment();
- try
- {
- switch (info.getStatus())
- {
- case ADDED:
- case MODIFIED:
- deployer.addDeployment(getKey(), ctx);
- modifiedDeploymentNames.add(ctx.getName());
- break;
- case REMOVED:
- deployer.removeDeployment(getKey(), ctx);
- modified = true;
- break;
- }
- }
- catch(DeploymentException e)
- {
- log.warn("Failed to add deployment: " + ctx.getName(), e);
- }
+ // TODO This should be a warning and disable the check ?
+ log.debug("profile not installed, skipping hot deployment check: " + key);
+ return;
}
- if (modifiedDeployments.size() > 0)
+ // obviously the action installing the HDScanner has to check if this is mutable
+ MutableProfile profile = MutableProfile.class.cast(managedProfile.getProfile());
+
+ ProfileModificationAction<ProfileModificationContext> action = new HDScanAction(profile, managedProfile.getManagedDeployer());
+ BasicProfileModificationActions<ProfileModificationContext> actions = new BasicProfileModificationActions<ProfileModificationContext>(
+ ProfileModificationType.UPDATE, Collections.singletonList(action));
+
+ ModificationStatus modificationStatus = this.controller.perfom(key, actions);
+
+ if(modificationStatus.isFailed())
{
- modified = true;
+ // TODO
}
- // Process the changes
- if (modified)
- {
- deployer.process();
- // Only check the modified deployments to avoid duplicate errors
- for(String name : modifiedDeploymentNames)
- {
- // Can be nulled by a shutdown
- if (deployer != null)
- {
- deployer.checkComplete(name);
- }
- }
- }
+
if(trace)
{
log.trace("End deployment scan: " + profile.getKey());
@@ -181,5 +164,111 @@
scanCount++;
notifyAll();
}
+
+ class HDScanAction implements ProfileModificationAction<ProfileModificationContext>
+ {
+
+ private boolean complete = false;
+ private final MutableProfile profile;
+ private final ManagedProfileDeployer deployer;
+
+ public HDScanAction(MutableProfile profile, ManagedProfileDeployer deployer)
+ {
+ this.profile = profile;
+ this.deployer = deployer;
+ }
+
+ public void cancel()
+ {
+ //
+ }
+
+ public void complete()
+ {
+ try
+ {
+ deploy();
+ complete = true;
+ }
+ catch(Throwable t)
+ {
+ log.warn("Scan failed", t);
+ }
+ }
+
+ public void deploy() throws Exception
+ {
+ boolean trace = log.isTraceEnabled();
+ if(trace)
+ {
+ log.trace("Begin deployment scan: " + profile.getKey());
+ }
+
+ boolean modified = false;
+ Collection<String> modifiedDeploymentNames = new ArrayList<String>();
+ Collection<ModificationInfo> modifiedDeployments = profile.getModifiedDeployments();
+ for (ModificationInfo info : modifiedDeployments)
+ {
+ ProfileDeployment ctx = info.getDeployment();
+ try
+ {
+ switch (info.getStatus())
+ {
+ case ADDED:
+ case MODIFIED:
+ deployer.addDeployment(ctx);
+ modifiedDeploymentNames.add(ctx.getName());
+ break;
+ case REMOVED:
+ deployer.removeDeployment(ctx);
+ modified = true;
+ break;
+ }
+ }
+ catch(DeploymentException e)
+ {
+ log.warn("Failed to add deployment: " + ctx.getName(), e);
+ }
+ }
+ if (modifiedDeployments.size() > 0)
+ {
+ modified = true;
+ }
+ // Process the changes
+ if (modified)
+ {
+ deployer.process();
+ // Only check the modified deployments to avoid duplicate errors
+ for(String name : modifiedDeploymentNames)
+ {
+ // Can be nulled by a shutdown
+ if (deployer != null)
+ {
+ deployer.checkComplete(name);
+ }
+ }
+ }
+ if(trace)
+ {
+ log.trace("End deployment scan: " + profile.getKey());
+ }
+ }
+
+ public ProfileModificationContext getContext()
+ {
+ return null;
+ }
+
+ public boolean isCancelled()
+ {
+ return false;
+ }
+
+ public boolean isComplete()
+ {
+ return complete;
+ }
+ }
+
}
Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/hotdeploy/HDScannerFactory.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/hotdeploy/HDScannerFactory.java 2010-03-11 13:47:33 UTC (rev 102289)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/hotdeploy/HDScannerFactory.java 2010-03-11 14:56:13 UTC (rev 102290)
@@ -23,7 +23,6 @@
import java.util.Collection;
-import org.jboss.profileservice.spi.MutableProfile;
import org.jboss.profileservice.spi.ProfileKey;
/**
@@ -62,7 +61,7 @@
* @param profile the mutable profile
* @return the Scanner created
*/
- Scanner registerScanner(MutableProfile profile, ScannerConfiguration configuration);
+ Scanner registerScanner(ProfileKey key, ScannerConfiguration configuration);
/**
* Activate a scanner.
Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/hotdeploy/HDScannerLifeCycleCallback.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/hotdeploy/HDScannerLifeCycleCallback.java 2010-03-11 13:47:33 UTC (rev 102289)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/hotdeploy/HDScannerLifeCycleCallback.java 2010-03-11 14:56:13 UTC (rev 102290)
@@ -68,8 +68,8 @@
{
if(profile.isMutable() && profile instanceof MutableProfile)
{
- MutableProfile mutable = MutableProfile.class.cast(profile);
- Scanner scanner = hdScannerFactory.registerScanner(mutable, configuration);
+ // TODO add the scanner to the managed profile
+ Scanner scanner = hdScannerFactory.registerScanner(profile.getKey(), configuration);
}
}
Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/AbstractActionController.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/AbstractActionController.java 2010-03-11 13:47:33 UTC (rev 102289)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/AbstractActionController.java 2010-03-11 14:56:13 UTC (rev 102290)
@@ -29,9 +29,11 @@
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.locks.ReentrantReadWriteLock;
+import org.jboss.managed.api.ManagedDeployment;
import org.jboss.profileservice.management.event.ProfileLifeCycleEvent;
import org.jboss.profileservice.management.event.ProfileLifeCycleEvent.LifeCycleState;
import org.jboss.profileservice.spi.Profile;
+import org.jboss.profileservice.spi.ProfileDeployment;
import org.jboss.profileservice.spi.ProfileKey;
import org.jboss.profileservice.spi.action.ProfileModificationAction;
import org.jboss.profileservice.spi.action.ProfileModificationActions;
@@ -40,6 +42,9 @@
import org.jboss.profileservice.spi.action.TwoPhaseCommitProfileAction;
import org.jboss.profileservice.spi.action.engine.ActionController;
import org.jboss.profileservice.spi.action.engine.ModificationStatus;
+import org.jboss.profileservice.spi.managed.ManagedProfile;
+import org.jboss.profileservice.spi.managed.ManagedProfileDeployer;
+import org.jboss.profileservice.spi.metadata.ProfileMetaData;
/**
* @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
@@ -53,15 +58,28 @@
private Map<ProfileKey, ProfileWrapper> profilesByName = new ConcurrentHashMap<ProfileKey, ProfileWrapper>();
/**
+ * {@inheritDoc}
+ */
+ public List<ProfileKey> getActiveProfiles()
+ {
+ return Collections.unmodifiableList(this.profiles);
+ }
+
+ public ManagedProfile getManagedProfile(ProfileKey key)
+ {
+ return this.profilesByName.get(key);
+ }
+
+ /**
* Register a profile.
*
* @param profile the profile to register
*/
- public void addProfile(Profile profile)
+ public void addProfile(ManagedProfile context)
{
- ProfileKey key = profile.getKey();
+ ProfileKey key = context.getProfileKey();
this.profiles.add(key);
- this.profilesByName.put(key, new ProfileWrapper(profile));
+ this.profilesByName.put(key, new ProfileWrapper(context));
fireModificationEvent(new ProfileLifeCycleEvent(key, LifeCycleState.INSTALLED));
}
@@ -70,9 +88,9 @@
*
* @param profile the profile to unregister
*/
- public void removeProfile(Profile profile)
+ public void removeProfile(ManagedProfile context)
{
- ProfileKey key = profile.getKey();
+ ProfileKey key = context.getProfileKey();
fireModificationEvent(new ProfileLifeCycleEvent(key, LifeCycleState.UNINSTALLED));
// Remove
this.profiles.remove(key);
@@ -94,14 +112,6 @@
/**
* {@inheritDoc}
*/
- public List<ProfileKey> getActiveProfiles()
- {
- return Collections.unmodifiableList(this.profiles);
- }
-
- /**
- * {@inheritDoc}
- */
public ModificationStatus perfom(ProfileKey key, ProfileModificationActions<ProfileModificationContext> actions)
{
if(key == null)
@@ -218,22 +228,42 @@
* The profile wrapper, used to lock the profile
* when actions are performed.
*/
- private static class ProfileWrapper
+ private static class ProfileWrapper implements ManagedProfile
{
- private final Profile profile;
+ private final ManagedProfile profile;
private final ReentrantReadWriteLock lock;
- ProfileWrapper(final Profile profile)
+ ProfileWrapper(final ManagedProfile profile)
{
this.profile = profile;
this.lock = new ReentrantReadWriteLock(true);
}
- Profile getProfile()
+ public ProfileKey getProfileKey()
{
- return profile;
+ return profile.getProfileKey();
}
+ public Profile getProfile()
+ {
+ return profile.getProfile();
+ }
+
+ public ProfileMetaData getProfileMetaData()
+ {
+ return profile.getProfileMetaData();
+ }
+
+ public ManagedProfileDeployer getManagedDeployer()
+ {
+ return profile.getManagedDeployer();
+ }
+
+ public ManagedDeployment getManagedDeployment(ProfileDeployment deployment) throws Exception
+ {
+ return profile.getManagedDeployment(deployment);
+ }
+
void lockRead()
{
lock.readLock().lock();
Added: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/actions/BasicModificationContext.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/actions/BasicModificationContext.java (rev 0)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/actions/BasicModificationContext.java 2010-03-11 14:56:13 UTC (rev 102290)
@@ -0,0 +1,49 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2010, Red Hat Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.profileservice.management.actions;
+
+import org.jboss.profileservice.spi.ProfileKey;
+import org.jboss.profileservice.spi.action.ProfileModificationContext;
+
+/**
+ *
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class BasicModificationContext implements ProfileModificationContext
+{
+
+ /** The profile key. */
+ private final ProfileKey key;
+
+ public BasicModificationContext(ProfileKey key)
+ {
+ this.key = key;
+ }
+
+ public ProfileKey getTargetProfile()
+ {
+ return this.key;
+ }
+
+}
+
Added: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/actions/BasicProfileModificationActions.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/actions/BasicProfileModificationActions.java (rev 0)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/actions/BasicProfileModificationActions.java 2010-03-11 14:56:13 UTC (rev 102290)
@@ -0,0 +1,63 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2010, Red Hat Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.profileservice.management.actions;
+
+import java.util.List;
+
+import org.jboss.profileservice.spi.action.ProfileModificationAction;
+import org.jboss.profileservice.spi.action.ProfileModificationActions;
+import org.jboss.profileservice.spi.action.ProfileModificationContext;
+import org.jboss.profileservice.spi.action.ProfileModificationType;
+
+/**
+ * The basic modification actions.
+ *
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class BasicProfileModificationActions<T extends ProfileModificationContext> implements ProfileModificationActions<T>
+{
+
+ /** The modification type. */
+ private ProfileModificationType type;
+
+ /** The modification actions. */
+ private List<ProfileModificationAction<T>> actions;
+
+ public BasicProfileModificationActions(ProfileModificationType type, List<ProfileModificationAction<T>> actions)
+ {
+ this.type = type;
+ this.actions = actions;
+ }
+
+ public List<ProfileModificationAction<T>> getActions()
+ {
+ return this.actions;
+ }
+
+ public ProfileModificationType getType()
+ {
+ return this.type;
+ }
+
+}
+
Modified: projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/deployment/test/HDScannerUnitTestCase.java
===================================================================
--- projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/deployment/test/HDScannerUnitTestCase.java 2010-03-11 13:47:33 UTC (rev 102289)
+++ projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/deployment/test/HDScannerUnitTestCase.java 2010-03-11 14:56:13 UTC (rev 102290)
@@ -26,6 +26,7 @@
import java.util.Set;
import java.util.concurrent.TimeUnit;
+import org.jboss.managed.api.ManagedDeployment;
import org.jboss.profileservice.deployment.hotdeploy.DefaultHDScannerFactory;
import org.jboss.profileservice.deployment.hotdeploy.Scanner;
import org.jboss.profileservice.deployment.hotdeploy.ScannerConfiguration;
@@ -33,8 +34,12 @@
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;
+import org.jboss.profileservice.spi.managed.ManagedProfile;
+import org.jboss.profileservice.spi.managed.ManagedProfileDeployer;
+import org.jboss.profileservice.spi.metadata.ProfileMetaData;
import org.jboss.test.BaseTestCase;
/**
@@ -48,6 +53,7 @@
public class HDScannerUnitTestCase extends BaseTestCase
{
+ private AbstractActionController actionController;
private DefaultHDScannerFactory scannerFactory;
public HDScannerUnitTestCase(String name)
@@ -59,7 +65,8 @@
protected void setUp() throws Exception
{
super.setUp();
- this.scannerFactory = new DefaultHDScannerFactory(new AbstractActionController());
+ this.actionController = new AbstractActionController();
+ this.scannerFactory = new DefaultHDScannerFactory(this.actionController);
this.scannerFactory.start();
}
@@ -75,8 +82,8 @@
enableTrace("org.jboss.profileservice.hotdeploy");
scannerFactory.enableScanning();
- Scanner scanner1 = scannerFactory.registerScanner(new TestProfile(new ProfileKey("test1")), new TestConfiguration());
- Scanner scanner2 = scannerFactory.registerScanner(new TestProfile(new ProfileKey("test2")), new TestConfiguration());
+ Scanner scanner1 = registerScanner(new ProfileKey("test1"), new TestConfiguration());
+ Scanner scanner2 = registerScanner(new ProfileKey("test2"), new TestConfiguration());
assertNotNull(scanner1);
assertNotNull(scanner2);
@@ -117,8 +124,8 @@
{
enableTrace("org.jboss.profileservice.hotdeploy");
- Scanner scanner1 = scannerFactory.registerScanner(new TestProfile(new ProfileKey("test1")), new TestConfiguration(true));
- Scanner scanner2 = scannerFactory.registerScanner(new TestProfile(new ProfileKey("test2")), new TestConfiguration());
+ Scanner scanner1 = registerScanner(new ProfileKey("test1"), new TestConfiguration(true));
+ Scanner scanner2 = registerScanner(new ProfileKey("test2"), new TestConfiguration());
assertNotNull(scanner1);
assertNotNull(scanner2);
@@ -152,7 +159,14 @@
}
+ Scanner registerScanner(ProfileKey key, ScannerConfiguration configuration)
+ {
+ TestProfile profile = new TestProfile(key);
+ actionController.addProfile(profile);
+ return scannerFactory.registerScanner(key, configuration);
+ }
+
static class TestConfiguration implements ScannerConfiguration
{
boolean start = false;
@@ -184,13 +198,31 @@
}
}
- static class TestProfile implements MutableProfile
+ static class TestProfile implements MutableProfile, ManagedProfile
{
private final ProfileKey key;
public TestProfile(ProfileKey key)
{
this.key = key;
}
+
+ public ProfileKey getKey()
+ {
+ return key;
+ }
+ public ProfileKey getProfileKey()
+ {
+ return key;
+ }
+ public Profile getProfile()
+ {
+ return this;
+ }
+ public Collection<ModificationInfo> getModifiedDeployments() throws Exception
+ {
+ return Collections.emptySet();
+ }
+
@Override
public void addDeployment(ProfileDeployment deployment) throws Exception
{
@@ -200,11 +232,6 @@
{
}
@Override
- public Collection<ModificationInfo> getModifiedDeployments() throws Exception
- {
- return Collections.emptySet();
- }
- @Override
public ProfileDeployment removeDeployment(String name) throws NoSuchDeploymentException, Exception
{
return null;
@@ -224,12 +251,6 @@
{
return null;
}
- @Override
- public ProfileKey getKey()
- {
- return key;
- }
- @Override
public long getLastModified()
{
return 0;
@@ -244,6 +265,18 @@
{
return true;
}
+ public ManagedDeployment getManagedDeployment(ProfileDeployment deployment) throws Exception
+ {
+ return null;
+ }
+ public ManagedProfileDeployer getManagedDeployer()
+ {
+ return null;
+ }
+ public ProfileMetaData getProfileMetaData()
+ {
+ return null;
+ }
}
}
Modified: projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/AggregatingLocalManagementView.java
===================================================================
--- projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/AggregatingLocalManagementView.java 2010-03-11 13:47:33 UTC (rev 102289)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/AggregatingLocalManagementView.java 2010-03-11 14:56:13 UTC (rev 102290)
@@ -235,8 +235,7 @@
{
throw new IllegalArgumentException("Null template info.");
}
-
-
+
final DeploymentTemplate template = templates.get(info.getName());
if( template == null )
{
Modified: projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/ManagementViewWrapper.java
===================================================================
--- projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/ManagementViewWrapper.java 2010-03-11 13:47:33 UTC (rev 102289)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/ManagementViewWrapper.java 2010-03-11 14:56:13 UTC (rev 102290)
@@ -147,7 +147,6 @@
}
@SuppressWarnings("deprecation")
- @Override
public void reload()
{
getDelegateView().reload();
Modified: projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/RegisteredProfileViewsWrapper.java
===================================================================
--- projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/RegisteredProfileViewsWrapper.java 2010-03-11 13:47:33 UTC (rev 102289)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/RegisteredProfileViewsWrapper.java 2010-03-11 14:56:13 UTC (rev 102290)
@@ -23,6 +23,7 @@
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
@@ -34,6 +35,7 @@
import org.jboss.managed.api.ComponentType;
import org.jboss.managed.api.ManagedComponent;
import org.jboss.managed.api.ManagedDeployment;
+import org.jboss.profileservice.management.actions.BasicProfileModificationActions;
import org.jboss.profileservice.plugins.management.actions.ProfileViewUpdateAction;
import org.jboss.profileservice.plugins.management.util.ManagedDeploymentProcessorHelper;
import org.jboss.profileservice.plugins.management.view.RegisteredProfileView;
@@ -42,9 +44,11 @@
import org.jboss.profileservice.spi.ProfileKey;
import org.jboss.profileservice.spi.action.ProfileModificationAction;
import org.jboss.profileservice.spi.action.ProfileModificationContext;
+import org.jboss.profileservice.spi.action.ProfileModificationType;
import org.jboss.profileservice.spi.action.engine.ActionController;
import org.jboss.profileservice.spi.action.engine.EventBus;
import org.jboss.profileservice.spi.action.engine.ModificationEvent;
+import org.jboss.profileservice.spi.managed.ManagedProfile;
/**
@@ -58,7 +62,7 @@
/** The profiles. */
private List<ProfileKey> registeredKeys = new ArrayList<ProfileKey>();
- private Map<ProfileKey, RegisteredProfileView> viewsByName = new ConcurrentHashMap<ProfileKey, RegisteredProfileView>();
+ private Map<ProfileKey, RegisteredProfileView> viewsByName = new ConcurrentHashMap<ProfileKey, RegisteredProfileView>();
/** The helper. */
private ManagedDeploymentProcessorHelper helper;
@@ -102,12 +106,16 @@
changed = true;
}
// Load and process
- for(ProfileView view : viewsByName.values())
+ for(RegisteredProfileView view : viewsByName.values())
{
if(view.load())
{
- ProfileModificationAction<ProfileModificationContext> action = new ProfileViewUpdateAction();
- // big TODO use the controller to dispatch the updateAction
+ ProfileKey key = view.getKey();
+ ManagedProfile managedProfile = controller.getManagedProfile(key);
+ ProfileModificationAction<ProfileModificationContext> action = new ProfileViewUpdateAction(managedProfile, view, helper);
+
+ controller.perfom(key, new BasicProfileModificationActions<ProfileModificationContext>(ProfileModificationType.GET, Collections.singletonList(action)));
+
changed = true;
}
}
Modified: projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/actions/ProfileViewUpdateAction.java
===================================================================
--- projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/actions/ProfileViewUpdateAction.java 2010-03-11 13:47:33 UTC (rev 102289)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/actions/ProfileViewUpdateAction.java 2010-03-11 14:56:13 UTC (rev 102290)
@@ -29,14 +29,13 @@
import org.jboss.managed.api.DeploymentState;
import org.jboss.managed.api.ManagedDeployment;
import org.jboss.managed.plugins.ManagedDeploymentImpl;
-import org.jboss.profileservice.deployment.ProfileDeployerPlugin;
import org.jboss.profileservice.plugins.management.util.ManagedDeploymentProcessorHelper;
import org.jboss.profileservice.plugins.spi.ProfileViewProcessingContext;
import org.jboss.profileservice.spi.Profile;
import org.jboss.profileservice.spi.ProfileDeployment;
import org.jboss.profileservice.spi.action.ProfileModificationAction;
import org.jboss.profileservice.spi.action.ProfileModificationContext;
-import org.jboss.profileservice.spi.metadata.ProfileMetaData;
+import org.jboss.profileservice.spi.managed.ManagedProfile;
/**
* The <code>ProfileView</code> update action.
@@ -56,14 +55,22 @@
/** is complete. */
private boolean complete = false;
- // ----- TODO
+ /** The managed profile. */
+ private final ManagedProfile managedProfile;
+
+ /** The helper. */
+ private final ManagedDeploymentProcessorHelper helper;
- Profile profile; // has to come from the ActionController
- ProfileMetaData metaData; // has to come from the ActionController
- ProfileDeployerPlugin deployer; // has to come from the ActionController
+ /** The context. */
+ private final ProfileViewProcessingContext context;
- ManagedDeploymentProcessorHelper helper; // modification context ?
- ProfileViewProcessingContext context;
+ public ProfileViewUpdateAction(ManagedProfile managedProfile, ProfileViewProcessingContext context,
+ ManagedDeploymentProcessorHelper helper)
+ {
+ this.managedProfile = managedProfile;
+ this.context = context;
+ this.helper = helper;
+ }
// -----
@@ -75,6 +82,7 @@
public void complete()
{
+ Profile profile = managedProfile.getProfile();
for(ProfileDeployment deployment : profile.getDeployments())
{
try
@@ -82,7 +90,7 @@
if(deployment.getDeploymentInfo().isDeployed())
{
// Deployed
- ManagedDeployment md = deployer.getManagedDeployment(deployment);
+ ManagedDeployment md = managedProfile.getManagedDeployment(deployment);
helper.processRootManagedDeployment(md, context);
if(md.getTypes() != null && md.getTypes().isEmpty() == false)
{
Modified: projects/profileservice/trunk/spi/pom.xml
===================================================================
--- projects/profileservice/trunk/spi/pom.xml 2010-03-11 13:47:33 UTC (rev 102289)
+++ projects/profileservice/trunk/spi/pom.xml 2010-03-11 14:56:13 UTC (rev 102290)
@@ -30,9 +30,9 @@
<doctitle><![CDATA[ProfileService SPI ]]>${version}</doctitle>
<header><![CDATA[ProfileService SPI ]]>${version}</header>
<footer><![CDATA[ProfileService SPI ]]>${version}</footer>
- <bottom><![CDATA[<i>Copyright © 2009 JBoss, a division of Red Hat, Inc.</i>]]></bottom>
+ <bottom><![CDATA[<i>Copyright © 2010 JBoss, by Red Hat</i>]]></bottom>
<links>
- <link>http://java.sun.com/j2se/1.5.0/docs/api/</link>
+ <link>http://java.sun.com/javase/6/docs/api/</link>
</links>
</configuration>
</plugin>
Modified: projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/engine/ActionController.java
===================================================================
--- projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/engine/ActionController.java 2010-03-11 13:47:33 UTC (rev 102289)
+++ projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/engine/ActionController.java 2010-03-11 14:56:13 UTC (rev 102290)
@@ -26,6 +26,7 @@
import org.jboss.profileservice.spi.ProfileKey;
import org.jboss.profileservice.spi.action.ProfileModificationActions;
import org.jboss.profileservice.spi.action.ProfileModificationContext;
+import org.jboss.profileservice.spi.managed.ManagedProfile;
/**
* @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
@@ -42,6 +43,14 @@
public List<ProfileKey> getActiveProfiles();
/**
+ * Get a managed profile.
+ *
+ * @param key the profile key
+ * @return the managed profile
+ */
+ public ManagedProfile getManagedProfile(ProfileKey key);
+
+ /**
* Perform a set of modification actions.
*
* @param key the target profile key
Added: projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/managed/ManagedProfile.java
===================================================================
--- projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/managed/ManagedProfile.java (rev 0)
+++ projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/managed/ManagedProfile.java 2010-03-11 14:56:13 UTC (rev 102290)
@@ -0,0 +1,75 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2010, Red Hat Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.profileservice.spi.managed;
+
+import org.jboss.managed.api.ManagedDeployment;
+import org.jboss.profileservice.spi.Profile;
+import org.jboss.profileservice.spi.ProfileDeployment;
+import org.jboss.profileservice.spi.ProfileKey;
+import org.jboss.profileservice.spi.metadata.ProfileMetaData;
+
+/**
+ * The managed profile. A wrapper around a installed profile, exposing additional
+ * information and operations which can be performed against a profile. A managed profile
+ * is exposed through the {@code ActionController}, where actual operation have to be
+ * performed inside a {@code ProfileModificationAction} to ensure consistent modifications.
+ *
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public interface ManagedProfile
+{
+
+ /**
+ * Get the profile key.
+ *
+ * @return the profile key
+ */
+ ProfileKey getProfileKey();
+
+ /**
+ * Get the profile.
+ *
+ * @return the profile
+ */
+ Profile getProfile();
+
+ /**
+ * Get the profile meta data.
+ *
+ * @return the profile meta data
+ */
+ ProfileMetaData getProfileMetaData();
+
+ ManagedProfileDeployer getManagedDeployer();
+
+ /**
+ * Get a managed deployment.
+ *
+ * @param deployment the profile deployment
+ * @return the managed deployment
+ * @throws Exception
+ */
+ ManagedDeployment getManagedDeployment(ProfileDeployment deployment) throws Exception;
+
+}
+
Added: projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/managed/ManagedProfileDeployer.java
===================================================================
--- projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/managed/ManagedProfileDeployer.java (rev 0)
+++ projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/managed/ManagedProfileDeployer.java 2010-03-11 14:56:13 UTC (rev 102290)
@@ -0,0 +1,63 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2010, Red Hat Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.profileservice.spi.managed;
+
+import org.jboss.profileservice.spi.ProfileDeployment;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public interface ManagedProfileDeployer
+{
+
+ /**
+ * Add a deployment.
+ *
+ * @param deployment the profile deployment.
+ * @throws Exception
+ */
+ void addDeployment(ProfileDeployment deployment) throws Exception;
+
+ /**
+ * Remove a deployment.
+ *
+ * @param deployment the profile deployment
+ * @throws Exception
+ */
+ void removeDeployment(ProfileDeployment deployment) throws Exception;
+
+ /**
+ * Process ...
+ */
+ void process();
+
+ /**
+ * Check complete.
+ *
+ * @param names the deployment names
+ * @throws Excetion
+ */
+ void checkComplete(String... names) throws Exception;
+
+}
+
More information about the jboss-cvs-commits
mailing list