[jboss-cvs] JBossAS SVN: r104043 - in projects/profileservice/trunk: core/src/main/java/org/jboss/profileservice/management and 11 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Apr 16 05:27:25 EDT 2010
Author: emuckenhuber
Date: 2010-04-16 05:27:22 -0400 (Fri, 16 Apr 2010)
New Revision: 104043
Added:
projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/ModificationSession.java
projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ActionController.java
projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/EventBus.java
projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ModificationEvent.java
projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ModificationListener.java
projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ModificationStatus.java
projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ProfileModificationAction.java
projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ProfileModificationResponse.java
Removed:
projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/engine/
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/DefaultHDScannerFactory.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/management/AbstractActionController.java
projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/AbstractEventBus.java
projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/BasicModificationStatus.java
projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/TwoPCActionWrapper.java
projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/actions/AbstractTwoPhaseModificationAction.java
projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/actions/BasicProfileModificationRequest.java
projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/event/ProfileLifeCycleEvent.java
projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/event/ProfileModificationEvent.java
projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/AbstractDeployHandler.java
projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/actions/AbstractDeploymentAddAction.java
projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/actions/DeploymentAddAction.java
projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/actions/DeploymentDistributeAction.java
projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/actions/DeploymentRemoveAction.java
projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/actions/DeploymentStartAction.java
projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/actions/DeploymentStopAction.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/RegisteredProfileViewsWrapper.java
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/RemoveComponentAction.java
projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/actions/UpdateComponentAction.java
projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/util/AbstractManagedComponentRuntimeDispatcher.java
projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/util/ManagedObjectProcessor.java
projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/util/ManagedObjectRuntimeProcessor.java
projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/view/AbstractProfileView.java
projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/view/AbstractProfileViewWrapper.java
projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/view/RegisteredProfileView.java
projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/spi/ProfileView.java
projects/profileservice/trunk/plugins/src/test/java/org/jboss/test/profileservice/plugins/mgt/test/RegisteredProfileUnitTestCase.java
projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ProfileModificationRequest.java
projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/TwoPhaseCommitProfileAction.java
Log:
move reload notifications for managementView into the actions.
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-04-16 09:26:30 UTC (rev 104042)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/hotdeploy/AbstractHDScannerFactory.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -31,7 +31,7 @@
import org.jboss.logging.Logger;
import org.jboss.profileservice.spi.ProfileKey;
-import org.jboss.profileservice.spi.action.engine.ActionController;
+import org.jboss.profileservice.spi.action.ActionController;
/**
* The HDScannerFactory represents a HDScanner registry for profiles, having
Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/hotdeploy/DefaultHDScannerFactory.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/hotdeploy/DefaultHDScannerFactory.java 2010-04-16 09:26:30 UTC (rev 104042)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/hotdeploy/DefaultHDScannerFactory.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -27,7 +27,7 @@
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
-import org.jboss.profileservice.spi.action.engine.ActionController;
+import org.jboss.profileservice.spi.action.ActionController;
/**
* The default HDScanner factory.
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-04-16 09:26:30 UTC (rev 104042)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/deployment/hotdeploy/HDScanner.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -26,15 +26,17 @@
import java.util.Collections;
import org.jboss.logging.Logger;
+import org.jboss.profileservice.management.event.ProfileModificationEvent;
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.ActionController;
+import org.jboss.profileservice.spi.action.ModificationStatus;
+import org.jboss.profileservice.spi.action.ProfileModificationAction;
import org.jboss.profileservice.spi.action.ProfileModificationContext;
+import org.jboss.profileservice.spi.action.ProfileModificationResponse;
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.action.engine.ProfileModificationAction;
import org.jboss.profileservice.spi.deployment.ProfileDeploymentFlag;
import org.jboss.profileservice.spi.deployment.ProfileDeploymentInfo;
import org.jboss.profileservice.spi.managed.ManagedProfile;
@@ -149,7 +151,7 @@
if(modificationStatus.isFailed())
{
- // TODO error reporting should be done here
+ log.warn("Scan failed", modificationStatus.getFailure());
}
if(defunct)
{
@@ -187,20 +189,20 @@
//
}
- public void complete()
+ public void complete(ProfileModificationResponse response)
{
try
{
- deploy();
+ deploy(response);
complete = true;
}
catch(Throwable t)
{
- log.warn("Scan failed", t);
+ response.setFailure(t);
}
}
- public void deploy() throws Exception
+ public void deploy(ProfileModificationResponse response) throws Exception
{
boolean trace = log.isTraceEnabled();
if(trace)
@@ -237,6 +239,8 @@
if (modifiedDeployments.isEmpty() == false)
{
deployer.process();
+ // Notify
+ response.fireModificationEvent(ProfileModificationEvent.create(ProfileModificationType.UPDATE, key));
// Only check the modified deployments to avoid duplicate errors
if(checkCompleteNames.isEmpty() == false)
{
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-04-16 09:26:30 UTC (rev 104042)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/AbstractActionController.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -22,26 +22,26 @@
package org.jboss.profileservice.management;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import org.jboss.managed.api.ManagedDeployment;
import org.jboss.profileservice.management.actions.BasicProfileModificationRequest;
import org.jboss.profileservice.management.event.ProfileLifeCycleEvent;
-import org.jboss.profileservice.management.event.ProfileModificationEvent;
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.ProfileModificationRequest;
+import org.jboss.profileservice.spi.action.ActionController;
+import org.jboss.profileservice.spi.action.ModificationStatus;
+import org.jboss.profileservice.spi.action.ProfileModificationAction;
import org.jboss.profileservice.spi.action.ProfileModificationContext;
+import org.jboss.profileservice.spi.action.ProfileModificationRequest;
import org.jboss.profileservice.spi.action.ProfileModificationType;
-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.action.engine.ProfileModificationAction;
import org.jboss.profileservice.spi.managed.ManagedProfile;
import org.jboss.profileservice.spi.managed.ManagedProfileConfiguration;
import org.jboss.profileservice.spi.managed.ManagedProfileDeployer;
@@ -55,15 +55,16 @@
{
/** The profiles. */
- private Map<String, ProfileKey> profiles = new ConcurrentHashMap<String, ProfileKey>();
- private Map<ProfileKey, ProfileWrapper> profilesByName = new ConcurrentHashMap<ProfileKey, ProfileWrapper>();
+ private List<ProfileKey> profiles = new CopyOnWriteArrayList<ProfileKey>();
+ private Map<String, ProfileKey> profilesByName = new ConcurrentHashMap<String, ProfileKey>();
+ private Map<ProfileKey, ProfileWrapper> profilesByKey = new ConcurrentHashMap<ProfileKey, ProfileWrapper>();
/**
* {@inheritDoc}
*/
public List<ProfileKey> getActiveProfiles()
{
- return new ArrayList<ProfileKey>(this.profiles.values());
+ return Collections.unmodifiableList(profiles);
}
/**
@@ -71,8 +72,8 @@
*/
public ManagedProfile getManagedProfile(ProfileKey key)
{
- ProfileKey resolved = profiles.get(key.getName());
- return resolved != null ? this.profilesByName.get(resolved) : null;
+ ProfileKey resolved = profilesByName.get(key.getName());
+ return resolved != null ? this.profilesByKey.get(resolved) : null;
}
/**
@@ -84,12 +85,13 @@
{
ProfileKey key = context.getProfileKey();
String profileName = key.getName();
- if(profiles.containsKey(profileName))
+ if(profilesByName.containsKey(profileName))
{
throw new IllegalArgumentException("duplicate profile " + key);
}
- this.profiles.put(profileName, key);
- this.profilesByName.put(key, new ProfileWrapper(context));
+ this.profiles.add(key);
+ this.profilesByName.put(profileName, key);
+ this.profilesByKey.put(key, new ProfileWrapper(context));
fireModificationEvent(new ProfileLifeCycleEvent(key, LifeCycleState.INSTALLED));
}
@@ -103,8 +105,9 @@
ProfileKey key = context.getProfileKey();
fireModificationEvent(new ProfileLifeCycleEvent(key, LifeCycleState.UNINSTALLED));
// Remove
- this.profiles.remove(key.getName());
- ProfileWrapper wrapper = this.profilesByName.remove(key);
+ this.profiles.remove(key);
+ this.profilesByName.remove(key.getName());
+ ProfileWrapper wrapper = this.profilesByKey.remove(key);
if(wrapper != null)
{
wrapper.lockWrite();
@@ -161,7 +164,7 @@
{
for(ProfileKey key : actions.getProfilesKeys())
{
- ProfileWrapper wrapper = this.profilesByName.get(key);
+ ProfileWrapper wrapper = this.profilesByKey.get(key);
if(wrapper == null)
{
throw new IllegalStateException("profile not registered" + key);
@@ -196,7 +199,7 @@
{
for(ProfileKey key : actions.getProfilesKeys())
{
- ProfileWrapper wrapper = this.profilesByName.get(key);
+ ProfileWrapper wrapper = this.profilesByKey.get(key);
if(wrapper == null)
{
throw new IllegalStateException("profile not registered" + key);
@@ -227,52 +230,16 @@
*/
ModificationStatus internalPerfom(ProfileModificationRequest actions)
{
- boolean success = true;
- final List<TwoPhaseCommitProfileAction<?>> prepared = new ArrayList<TwoPhaseCommitProfileAction<?>>();
- for(final ProfileKey key : actions.getProfilesKeys())
+ final ModificationSession session = new ModificationSession(actions, this);
+ if(session.prepare())
{
- for(final ProfileModificationAction<? extends ProfileModificationContext> action : actions.getActions(key))
- {
- // In case a previous action failed to prepare, cancel others
- if(success == false)
- {
- action.cancel();
- continue;
- }
- TwoPhaseCommitProfileAction<?> tpca = null;
- if(action instanceof TwoPhaseCommitProfileAction<?>)
- {
- tpca = TwoPhaseCommitProfileAction.class.cast(action);
- }
- else
- {
- // Wrap others
- tpca = new TwoPCActionWrapper(action);
- }
- // Prepare
- success &= tpca.prepare();
- prepared.add(tpca);
- }
- if(actions.getType() != ProfileModificationType.GET)
- {
- fireModificationEvent(new ProfileModificationEvent(actions.getType(), key));
- }
+ session.commit();
}
- if(success)
- {
- for(TwoPhaseCommitProfileAction<?> tpca : prepared)
- {
- tpca.commit();
- }
- }
else
{
- for(TwoPhaseCommitProfileAction<?> tpca : prepared)
- {
- tpca.rollback();
- }
+ session.rollback();
}
- return new BasicModificationStatus(success);
+ return session.getResponse();
}
/**
Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/AbstractEventBus.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/AbstractEventBus.java 2010-04-16 09:26:30 UTC (rev 104042)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/AbstractEventBus.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -21,13 +21,13 @@
*/
package org.jboss.profileservice.management;
-import java.util.List;
-import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.Set;
import org.jboss.logging.Logger;
-import org.jboss.profileservice.spi.action.engine.EventBus;
-import org.jboss.profileservice.spi.action.engine.ModificationEvent;
-import org.jboss.profileservice.spi.action.engine.ModificationListener;
+import org.jboss.profileservice.spi.action.EventBus;
+import org.jboss.profileservice.spi.action.ModificationEvent;
+import org.jboss.profileservice.spi.action.ModificationListener;
+import org.jboss.util.collection.ConcurrentSet;
/**
* The abstract event bus.
@@ -43,7 +43,7 @@
private static final Logger log = Logger.getLogger(EventBus.class);
/** The modification listeners. */
- private List<ModificationListener> listeners = new CopyOnWriteArrayList<ModificationListener>();
+ private Set<ModificationListener> listeners = new ConcurrentSet<ModificationListener>();
@Override
public void fireModificationEvent(ModificationEvent event)
Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/BasicModificationStatus.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/BasicModificationStatus.java 2010-04-16 09:26:30 UTC (rev 104042)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/BasicModificationStatus.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -21,7 +21,7 @@
*/
package org.jboss.profileservice.management;
-import org.jboss.profileservice.spi.action.engine.ModificationStatus;
+import org.jboss.profileservice.spi.action.ModificationStatus;
/**
* @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
Added: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/ModificationSession.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/ModificationSession.java (rev 0)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/ModificationSession.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -0,0 +1,174 @@
+/*
+* 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;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.profileservice.spi.ProfileKey;
+import org.jboss.profileservice.spi.action.EventBus;
+import org.jboss.profileservice.spi.action.ModificationEvent;
+import org.jboss.profileservice.spi.action.ModificationStatus;
+import org.jboss.profileservice.spi.action.ProfileModificationAction;
+import org.jboss.profileservice.spi.action.ProfileModificationContext;
+import org.jboss.profileservice.spi.action.ProfileModificationRequest;
+import org.jboss.profileservice.spi.action.ProfileModificationResponse;
+import org.jboss.profileservice.spi.action.TwoPhaseCommitProfileAction;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+class ModificationSession
+{
+
+ /** The event bus. */
+ private EventBus eventBus;
+
+ private ProfileModificationRequest request;
+ private AbstractModificationResponse response = new AbstractModificationResponse();
+
+ private List<TwoPhaseCommitProfileAction<?>> prepared = new ArrayList<TwoPhaseCommitProfileAction<?>>();
+
+ ModificationSession(ProfileModificationRequest request, EventBus eventBus)
+ {
+ this.request = request;
+ this.eventBus = eventBus;
+ }
+
+ public AbstractModificationResponse getResponse()
+ {
+ return response;
+ }
+
+ boolean prepare()
+ {
+ boolean success = true;
+ for(final ProfileKey key : request.getProfilesKeys())
+ {
+ for(final ProfileModificationAction<? extends ProfileModificationContext> action : request.getActions(key))
+ {
+ // In case a previous action failed to prepare, cancel others
+ if(success == false)
+ {
+ action.cancel();
+ continue;
+ }
+ TwoPhaseCommitProfileAction<?> tpca = null;
+ if(action instanceof TwoPhaseCommitProfileAction<?>)
+ {
+ tpca = TwoPhaseCommitProfileAction.class.cast(action);
+ }
+ else
+ {
+ // Wrap others
+ tpca = new TwoPCActionWrapper(action);
+ }
+ // Prepare
+ success &= tpca.prepare(response);
+ prepared.add(tpca);
+ }
+ }
+ return success;
+ }
+
+ public void commit()
+ {
+ for(final TwoPhaseCommitProfileAction<?> tpca : prepared)
+ {
+ tpca.commit(response);
+ }
+ response.markAsCompleted();
+ }
+
+ public void rollback()
+ {
+ for(final TwoPhaseCommitProfileAction<?> tpca : prepared)
+ {
+ tpca.rollback(response);
+ }
+ response.markAsFailed();
+ response.markAsCompleted();
+ }
+
+ public class AbstractModificationResponse implements ProfileModificationResponse, ModificationStatus
+ {
+ private Object response;
+ private Throwable failure;
+
+ private boolean failed;
+ private boolean completed;
+
+ public void setFailure(Throwable t)
+ {
+ this.failure = t;
+ }
+
+ public void fireModificationEvent(ModificationEvent event)
+ {
+ eventBus.fireModificationEvent(event);
+ }
+
+ public Object getResponse()
+ {
+ return response;
+ }
+
+ public ModificationStatus getStatus()
+ {
+ return this;
+ }
+
+ public void setResponse(Object response)
+ {
+ this.response = response;
+ }
+
+ public Throwable getFailure()
+ {
+ return failure;
+ }
+
+ public boolean isFailed()
+ {
+ return failed;
+ }
+
+ public boolean isCompleted()
+ {
+ return completed;
+ }
+
+ void markAsCompleted()
+ {
+ this.completed = true;
+ }
+
+ void markAsFailed()
+ {
+ this.failed = true;
+ }
+
+ }
+
+}
+
Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/TwoPCActionWrapper.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/TwoPCActionWrapper.java 2010-04-16 09:26:30 UTC (rev 104042)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/TwoPCActionWrapper.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -22,8 +22,11 @@
package org.jboss.profileservice.management;
import org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction;
+import org.jboss.profileservice.management.event.ProfileModificationEvent;
+import org.jboss.profileservice.spi.action.ProfileModificationAction;
import org.jboss.profileservice.spi.action.ProfileModificationContext;
-import org.jboss.profileservice.spi.action.engine.ProfileModificationAction;
+import org.jboss.profileservice.spi.action.ProfileModificationResponse;
+import org.jboss.profileservice.spi.action.ProfileModificationType;
/**
* @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
@@ -46,17 +49,17 @@
delegate.cancel();
}
- protected void doCommit()
+ protected void doCommit(ProfileModificationResponse response)
{
//
}
- protected void doComplete() throws Exception
+ protected void doComplete(ProfileModificationResponse response) throws Exception
{
- delegate.complete();
+ delegate.complete(response);
}
- protected boolean doPrepare()
+ protected boolean doPrepare(ProfileModificationResponse response)
{
return true;
}
Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/actions/AbstractTwoPhaseModificationAction.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/actions/AbstractTwoPhaseModificationAction.java 2010-04-16 09:26:30 UTC (rev 104042)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/actions/AbstractTwoPhaseModificationAction.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -23,6 +23,7 @@
import org.jboss.profileservice.spi.action.ActionState;
import org.jboss.profileservice.spi.action.ProfileModificationContext;
+import org.jboss.profileservice.spi.action.ProfileModificationResponse;
import org.jboss.profileservice.spi.action.TwoPhaseCommitProfileAction;
/**
@@ -64,13 +65,13 @@
}
}
- public void complete()
+ public void complete(ProfileModificationResponse response)
{
if(state == ActionState.ACTIVE)
{
try
{
- doComplete();
+ doComplete(response);
this.state = ActionState.COMPLETED;
}
catch(Exception e)
@@ -84,19 +85,19 @@
}
}
- public boolean prepare()
+ public boolean prepare(ProfileModificationResponse response)
{
boolean result = false;
switch (state)
{
case ACTIVE:
- complete();
+ complete(response);
if (state != ActionState.COMPLETED)
{
break;
}
case COMPLETED:
- result = doPrepare();
+ result = doPrepare(response);
if (result)
{
state = ActionState.PREPARED;
@@ -117,12 +118,12 @@
return result;
}
- public void commit()
+ public void commit(ProfileModificationResponse response)
{
switch(state)
{
case PREPARED:
- doCommit();
+ doCommit(response);
state = ActionState.COMMITTED;
break;
case ACTIVE:
@@ -136,7 +137,7 @@
}
}
- public void rollback()
+ public void rollback(ProfileModificationResponse response)
{
switch (state)
{
@@ -174,10 +175,10 @@
}
protected abstract void doCancel();
- protected abstract void doComplete() throws Exception;
- protected abstract boolean doPrepare();
- protected abstract void doCommit();
- protected abstract void doRollbackFromActive();
+ protected abstract void doComplete(ProfileModificationResponse response) throws Exception;
+ protected abstract boolean doPrepare(ProfileModificationResponse response);
+ protected abstract void doCommit(ProfileModificationResponse response);
+ protected abstract void doRollbackFromActive();
protected abstract void doRollbackFromCancelled();
protected abstract void doRollbackFromRollbackOnly();
protected abstract void doRollbackFromComplete();
Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/actions/BasicProfileModificationRequest.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/actions/BasicProfileModificationRequest.java 2010-04-16 09:26:30 UTC (rev 104042)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/actions/BasicProfileModificationRequest.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -27,10 +27,10 @@
import java.util.Map;
import org.jboss.profileservice.spi.ProfileKey;
+import org.jboss.profileservice.spi.action.ProfileModificationAction;
import org.jboss.profileservice.spi.action.ProfileModificationRequest;
import org.jboss.profileservice.spi.action.ProfileModificationContext;
import org.jboss.profileservice.spi.action.ProfileModificationType;
-import org.jboss.profileservice.spi.action.engine.ProfileModificationAction;
/**
* The basic modification request.
Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/event/ProfileLifeCycleEvent.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/event/ProfileLifeCycleEvent.java 2010-04-16 09:26:30 UTC (rev 104042)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/event/ProfileLifeCycleEvent.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -22,8 +22,8 @@
package org.jboss.profileservice.management.event;
import org.jboss.profileservice.spi.ProfileKey;
+import org.jboss.profileservice.spi.action.ModificationEvent;
import org.jboss.profileservice.spi.action.ProfileModificationType;
-import org.jboss.profileservice.spi.action.engine.ModificationEvent;
/**
* The profile lifecycle event.
Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/event/ProfileModificationEvent.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/event/ProfileModificationEvent.java 2010-04-16 09:26:30 UTC (rev 104042)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/management/event/ProfileModificationEvent.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -22,8 +22,8 @@
package org.jboss.profileservice.management.event;
import org.jboss.profileservice.spi.ProfileKey;
+import org.jboss.profileservice.spi.action.ModificationEvent;
import org.jboss.profileservice.spi.action.ProfileModificationType;
-import org.jboss.profileservice.spi.action.engine.ModificationEvent;
/**
* @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
@@ -54,5 +54,10 @@
return key;
}
+ public static ModificationEvent create(ProfileModificationType type, ProfileKey key)
+ {
+ return new ProfileModificationEvent(type, key);
+ }
+
}
Modified: projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/AbstractDeployHandler.java
===================================================================
--- projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/AbstractDeployHandler.java 2010-04-16 09:26:30 UTC (rev 104042)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/AbstractDeployHandler.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -42,9 +42,9 @@
import org.jboss.profileservice.spi.Profile;
import org.jboss.profileservice.spi.ProfileDeployment;
import org.jboss.profileservice.spi.ProfileKey;
+import org.jboss.profileservice.spi.action.ActionController;
+import org.jboss.profileservice.spi.action.ModificationStatus;
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;
/**
@@ -125,7 +125,7 @@
ModificationStatus status = actionController.perform(actions);
if(status.isFailed())
{
- throw new IllegalStateException("failed to add deployment " + dtID);
+ throw new IllegalStateException("failed to add deployment " + dtID, status.getFailure());
}
}
@@ -151,7 +151,7 @@
ModificationStatus status = actionController.perform(actions);
if(status.isFailed())
{
- throw new IllegalStateException("failed to start deployments " + Arrays.asList(deploymentNames));
+ throw new IllegalStateException("failed to start deployments " + Arrays.asList(deploymentNames), status.getFailure());
}
}
@@ -177,7 +177,7 @@
ModificationStatus status = actionController.perform(actions);
if(status.isFailed())
{
- throw new IllegalStateException("failed to stop deployments " + Arrays.asList(deploymentNames));
+ throw new IllegalStateException("failed to stop deployments " + Arrays.asList(deploymentNames), status.getFailure());
}
}
@@ -207,7 +207,7 @@
ModificationStatus status = actionController.perform(actions);
if(status.isFailed())
{
- throw new IllegalStateException("failed to remove deployments " + Arrays.asList(deploymentNames));
+ throw new IllegalStateException("failed to remove deployments " + Arrays.asList(deploymentNames), status.getFailure());
}
}
Modified: projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/actions/AbstractDeploymentAddAction.java
===================================================================
--- projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/actions/AbstractDeploymentAddAction.java 2010-04-16 09:26:30 UTC (rev 104042)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/actions/AbstractDeploymentAddAction.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -25,8 +25,8 @@
import org.jboss.logging.Logger;
import org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction;
import org.jboss.profileservice.spi.MutableProfile;
+import org.jboss.profileservice.spi.action.ProfileModificationAction;
import org.jboss.profileservice.spi.action.deployment.DeploymentActionContext;
-import org.jboss.profileservice.spi.action.engine.ProfileModificationAction;
/**
* @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
Modified: projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/actions/DeploymentAddAction.java
===================================================================
--- projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/actions/DeploymentAddAction.java 2010-04-16 09:26:30 UTC (rev 104042)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/actions/DeploymentAddAction.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -24,11 +24,14 @@
import java.net.URL;
import org.jboss.deployers.spi.management.deploy.DeploymentID;
+import org.jboss.profileservice.management.event.ProfileModificationEvent;
import org.jboss.profileservice.plugins.deploy.TransientDeploymentMetaData;
import org.jboss.profileservice.plugins.deploy.TransientProfileActivator;
import org.jboss.profileservice.repository.ProfileDeploymentFactory;
import org.jboss.profileservice.spi.MutableProfile;
import org.jboss.profileservice.spi.ProfileDeployment;
+import org.jboss.profileservice.spi.action.ProfileModificationResponse;
+import org.jboss.profileservice.spi.action.ProfileModificationType;
import org.jboss.profileservice.spi.action.deployment.DeploymentAction;
import org.jboss.profileservice.spi.action.deployment.DeploymentActionContext;
import org.jboss.profileservice.spi.deployment.ProfileDeploymentFlag;
@@ -59,17 +62,17 @@
//
}
- protected void doCommit()
+ protected void doCommit(ProfileModificationResponse response)
{
//
}
- protected void doComplete() throws Exception
+ protected void doComplete(ProfileModificationResponse response) throws Exception
{
//
}
- protected boolean doPrepare()
+ protected boolean doPrepare(ProfileModificationResponse response)
{
try
{
@@ -87,9 +90,13 @@
// Attach original deployment url for resolving deployment names
deployment.getTransientAttachments().putAttachment(TransientProfileActivator.TRANSIENT_DEPLOYMENT_URL_KEY, url.toExternalForm());
getProfile().addDeployment(deployment);
+
+ // Notify
+ response.fireModificationEvent(ProfileModificationEvent.create(ProfileModificationType.ADD, getProfile().getKey()));
}
catch(Exception e)
{
+ response.setFailure(e);
return false;
}
return true;
Modified: projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/actions/DeploymentDistributeAction.java
===================================================================
--- projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/actions/DeploymentDistributeAction.java 2010-04-16 09:26:30 UTC (rev 104042)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/actions/DeploymentDistributeAction.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -26,6 +26,7 @@
import java.util.Arrays;
import org.jboss.deployers.spi.management.deploy.DeploymentID;
+import org.jboss.profileservice.management.event.ProfileModificationEvent;
import org.jboss.profileservice.profile.metadata.BasicProfileDeploymentMetaData;
import org.jboss.profileservice.repository.artifact.CopyStreamArtifactTransformer;
import org.jboss.profileservice.repository.artifact.ExplodedArtifactTransformer;
@@ -35,6 +36,8 @@
import org.jboss.profileservice.spi.ProfileDeployment;
import org.jboss.profileservice.spi.VirtualDeploymentRepository;
import org.jboss.profileservice.spi.VirtualDeploymentRepositoryExt;
+import org.jboss.profileservice.spi.action.ProfileModificationResponse;
+import org.jboss.profileservice.spi.action.ProfileModificationType;
import org.jboss.profileservice.spi.action.deployment.DeploymentAction;
import org.jboss.profileservice.spi.action.deployment.DeploymentActionContext;
import org.jboss.profileservice.spi.deployment.ProfileDeploymentFlag;
@@ -60,7 +63,7 @@
this.contentIS = is;
}
- protected boolean doPrepare()
+ protected boolean doPrepare(ProfileModificationResponse response)
{
try
{
@@ -108,11 +111,13 @@
// Add the content
artifactRepository.addArtifact(artifactId, contentIS, transformer);
+ // Notify
+ response.fireModificationEvent(ProfileModificationEvent.create(ProfileModificationType.ADD, getProfile().getKey()));
+
}
catch(Exception e)
{
- // TODO Error reporting
- log.error("failed to distribute deployment content", e);
+ response.setFailure(e);
return false;
}
return true;
@@ -135,12 +140,12 @@
// FIXME doCancel
}
- protected void doCommit()
+ protected void doCommit(ProfileModificationResponse response)
{
// FIXME doCommit
}
- protected void doComplete() throws Exception
+ protected void doComplete(ProfileModificationResponse response) throws Exception
{
// FIXME doComplete
Modified: projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/actions/DeploymentRemoveAction.java
===================================================================
--- projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/actions/DeploymentRemoveAction.java 2010-04-16 09:26:30 UTC (rev 104042)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/actions/DeploymentRemoveAction.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -22,10 +22,13 @@
package org.jboss.profileservice.plugins.deploy.actions;
import org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction;
+import org.jboss.profileservice.management.event.ProfileModificationEvent;
import org.jboss.profileservice.spi.MutableProfile;
import org.jboss.profileservice.spi.ProfileDeployment;
import org.jboss.profileservice.spi.VirtualDeploymentRepository;
import org.jboss.profileservice.spi.VirtualDeploymentRepositoryExt;
+import org.jboss.profileservice.spi.action.ProfileModificationResponse;
+import org.jboss.profileservice.spi.action.ProfileModificationType;
import org.jboss.profileservice.spi.action.deployment.DeploymentAction;
import org.jboss.profileservice.spi.action.deployment.DeploymentActionContext;
import org.jboss.profileservice.spi.managed.ManagedProfile;
@@ -57,17 +60,17 @@
// FIXME doCancel
}
- protected void doCommit()
+ protected void doCommit(ProfileModificationResponse response)
{
// FIXME doCommit
}
- protected void doComplete() throws Exception
+ protected void doComplete(ProfileModificationResponse response) throws Exception
{
// FIXME doComplete
}
- protected boolean doPrepare()
+ protected boolean doPrepare(ProfileModificationResponse response)
{
try
{
@@ -90,9 +93,13 @@
}
// Remove the deployment from the profile
profile.removeDeployment(deployment.getName());
+
+ // Notify
+ response.fireModificationEvent(ProfileModificationEvent.create(ProfileModificationType.DELETE, managed.getProfileKey()));
}
catch(Exception e)
{
+ response.setFailure(e);
return false;
}
return true;
Modified: projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/actions/DeploymentStartAction.java
===================================================================
--- projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/actions/DeploymentStartAction.java 2010-04-16 09:26:30 UTC (rev 104042)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/actions/DeploymentStartAction.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -24,8 +24,11 @@
import java.util.Collection;
+import org.jboss.profileservice.management.event.ProfileModificationEvent;
import org.jboss.profileservice.spi.Profile;
import org.jboss.profileservice.spi.ProfileDeployment;
+import org.jboss.profileservice.spi.action.ProfileModificationResponse;
+import org.jboss.profileservice.spi.action.ProfileModificationType;
import org.jboss.profileservice.spi.action.deployment.DeploymentAction;
import org.jboss.profileservice.spi.action.deployment.DeploymentActionContext;
import org.jboss.profileservice.spi.deployment.ProfileDeploymentFlag;
@@ -50,7 +53,7 @@
//
}
- protected void doCommit()
+ protected void doCommit(ProfileModificationResponse response)
{
for(DeploymentState state : getDeployments())
{
@@ -62,12 +65,12 @@
}
}
- protected void doComplete() throws Exception
+ protected void doComplete(ProfileModificationResponse response) throws Exception
{
//
}
- protected boolean doPrepare()
+ protected boolean doPrepare(ProfileModificationResponse response)
{
try
{
@@ -94,15 +97,16 @@
// Process
deployer.process();
+ // Notify
+ response.fireModificationEvent(ProfileModificationEvent.create(ProfileModificationType.UPDATE, getManagedProfile().getProfileKey()));
+
// Check complete
deployer.checkComplete(resolvedNames());
-
-
+
}
catch(Exception e)
{
- // ERROR reporting
- log.error("failed to start deployments: " + getDeploymentNames(), e);
+ response.setFailure(e);
return false;
}
return true;
Modified: projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/actions/DeploymentStopAction.java
===================================================================
--- projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/actions/DeploymentStopAction.java 2010-04-16 09:26:30 UTC (rev 104042)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/deploy/actions/DeploymentStopAction.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -23,8 +23,11 @@
import java.util.Collection;
+import org.jboss.profileservice.management.event.ProfileModificationEvent;
import org.jboss.profileservice.spi.Profile;
import org.jboss.profileservice.spi.ProfileDeployment;
+import org.jboss.profileservice.spi.action.ProfileModificationResponse;
+import org.jboss.profileservice.spi.action.ProfileModificationType;
import org.jboss.profileservice.spi.action.deployment.DeploymentAction;
import org.jboss.profileservice.spi.action.deployment.DeploymentActionContext;
import org.jboss.profileservice.spi.deployment.ProfileDeploymentFlag;
@@ -50,7 +53,7 @@
//
}
- protected void doCommit()
+ protected void doCommit(ProfileModificationResponse response)
{
for(DeploymentState state : getDeployments())
{
@@ -60,12 +63,12 @@
}
}
- protected void doComplete() throws Exception
+ protected void doComplete(ProfileModificationResponse response) throws Exception
{
//
}
- protected boolean doPrepare()
+ protected boolean doPrepare(ProfileModificationResponse response)
{
try
{
@@ -89,11 +92,13 @@
// Process
deployer.process();
+
+ // Notify
+ response.fireModificationEvent(ProfileModificationEvent.create(ProfileModificationType.DELETE, getManagedProfile().getProfileKey()));
}
catch(Exception e)
{
- // ERROR reporting
- log.error("failed to start deployments: " + getDeploymentNames(), e);
+ response.setFailure(e);
return false;
}
return true;
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-04-16 09:26:30 UTC (rev 104042)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/AggregatingLocalManagementView.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -31,6 +31,7 @@
import java.util.Set;
import java.util.TreeSet;
import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
import org.jboss.deployers.spi.management.DeploymentTemplate;
import org.jboss.deployers.spi.management.ManagementView;
@@ -80,6 +81,8 @@
/** The proxy factory. */
private AbstractManagementProxyFactory proxyFactory;
+ private final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
+
public AggregatingLocalManagementView()
{
currentLocale = Locale.getDefault();
@@ -112,27 +115,35 @@
/**
* {@inheritDoc}
*/
- public synchronized boolean load()
+ public boolean load()
{
- // Clear any thread interrupt
- boolean wasInterrupted = Thread.interrupted();
- if(wasInterrupted)
+ lockWrite();
+ try
{
- log.debug("Cleared interrupted state of calling thread");
+ // Clear any thread interrupt
+ boolean wasInterrupted = Thread.interrupted();
+ if(wasInterrupted)
+ {
+ log.debug("Cleared interrupted state of calling thread");
+ }
+ boolean changed = false;
+ for(final ProfileView view : views)
+ {
+ if(view.load())
+ changed = true;
+ }
+ //
+ if(wasInterrupted)
+ {
+ Thread.currentThread().interrupt();
+ log.debug("Restored interrupted state of calling thread");
+ }
+ return changed;
}
- boolean changed = false;
- for(final ProfileView view : views)
+ finally
{
- if(view.load())
- changed = true;
+ unlockWrite();
}
- //
- if(wasInterrupted)
- {
- Thread.currentThread().interrupt();
- log.debug("Restored interrupted state of calling thread");
- }
- return changed;
}
/**
@@ -250,22 +261,30 @@
{
throw new IllegalArgumentException("null component name");
}
- ManagedComponent component = null;
- for(final ProfileView view : views)
+ lockRead();
+ try
{
- ManagedComponent resolved = view.getComponent(name, type);
- if(resolved != null)
+ ManagedComponent component = null;
+ for(final ProfileView view : views)
{
- component = resolved;
+ ManagedComponent resolved = view.getComponent(name, type);
+ if(resolved != null)
+ {
+ component = resolved;
+ }
+ // TODO fail on multiple results
}
- // TODO fail on multiple results
+ if(component == null)
+ {
+ // TODO throw localized exception
+ // TODO throw new IllegalStateException("failed to find component for name " + name);
+ }
+ return component;
}
- if(component == null)
+ finally
{
- // TODO throw localized exception
- // TODO throw new IllegalStateException("failed to find component for name " + name);
+ unlockRead();
}
- return component;
}
/**
@@ -273,12 +292,20 @@
*/
public Set<ComponentType> getComponentTypes()
{
- Set<ComponentType> types = new HashSet<ComponentType>();
- for(final ProfileView view : views)
+ lockRead();
+ try
{
- types.addAll(view.getComponentTypes());
+ Set<ComponentType> types = new HashSet<ComponentType>();
+ for(final ProfileView view : views)
+ {
+ types.addAll(view.getComponentTypes());
+ }
+ return types;
}
- return types;
+ finally
+ {
+ unlockRead();
+ }
}
/**
@@ -290,12 +317,20 @@
{
throw new IllegalArgumentException("null component type");
}
- Set<ManagedComponent> components = new HashSet<ManagedComponent>();
- for(final ProfileView view : views)
+ lockRead();
+ try
{
- components.addAll(view.getComponentsForType(type));
+ Set<ManagedComponent> components = new HashSet<ManagedComponent>();
+ for(final ProfileView view : views)
+ {
+ components.addAll(view.getComponentsForType(type));
+ }
+ return components;
}
- return components;
+ finally
+ {
+ unlockRead();
+ }
}
/**
@@ -308,21 +343,29 @@
throw new IllegalArgumentException("null deployment name");
}
ManagedDeployment deployment = null;
- for(final ProfileView view : views)
+ lockRead();
+ try
{
- ManagedDeployment resolved = view.getManagedDeployment(name);
- if(resolved != null)
+ for(final ProfileView view : views)
{
- deployment = resolved;
+ ManagedDeployment resolved = view.getManagedDeployment(name);
+ if(resolved != null)
+ {
+ deployment = resolved;
+ }
+ // TODO fail on multiple results
}
- // TODO fail on multiple results
+ if(deployment == null)
+ {
+ // TODO localized message
+ throw new NoSuchDeploymentException("Managed deployment: " + name + " not found.");
+ }
+ return deployment;
}
- if(deployment == null)
+ finally
{
- // TODO localized message
- throw new NoSuchDeploymentException("Managed deployment: " + name + " not found.");
+ unlockRead();
}
- return deployment;
}
/**
@@ -330,12 +373,20 @@
*/
public Set<String> getDeploymentNames()
{
- final Set<String> deploymentNames = new TreeSet<String>();
- for(final ProfileView view : views)
+ lockRead();
+ try
{
- deploymentNames.addAll(view.getDeploymentNames());
+ final Set<String> deploymentNames = new TreeSet<String>();
+ for(final ProfileView view : views)
+ {
+ deploymentNames.addAll(view.getDeploymentNames());
+ }
+ return deploymentNames;
}
- return deploymentNames;
+ finally
+ {
+ unlockRead();
+ }
}
/**
@@ -347,12 +398,20 @@
{
throw new IllegalArgumentException("null deployment type");
}
- Set<String> deployments = new TreeSet<String>();
- for(final ProfileView view: views)
+ lockRead();
+ try
{
- deployments.addAll(view.getDeploymentNamesForType(type));
+ Set<String> deployments = new TreeSet<String>();
+ for(final ProfileView view: views)
+ {
+ deployments.addAll(view.getDeploymentNamesForType(type));
+ }
+ return deployments;
}
- return deployments;
+ finally
+ {
+ unlockRead();
+ }
}
/**
@@ -364,12 +423,20 @@
{
throw new IllegalArgumentException("null deployment type");
}
- Set<ManagedDeployment> deployments = new HashSet<ManagedDeployment>();
- for(final ProfileView view : views)
+ lockRead();
+ try
{
- deployments.addAll(view.getDeploymentsForType(type));
+ Set<ManagedDeployment> deployments = new HashSet<ManagedDeployment>();
+ for(final ProfileView view : views)
+ {
+ deployments.addAll(view.getDeploymentsForType(type));
+ }
+ return deployments;
}
- return deployments;
+ finally
+ {
+ unlockRead();
+ }
}
/**
@@ -390,12 +457,20 @@
{
throw new IllegalArgumentException("null component name matcher");
}
- Set<ManagedComponent> components = new HashSet<ManagedComponent>();
- for(final ProfileView view : views)
+ lockRead();
+ try
{
- components.addAll(view.getMatchingComponents(name, type, matcher));
+ Set<ManagedComponent> components = new HashSet<ManagedComponent>();
+ for(final ProfileView view : views)
+ {
+ components.addAll(view.getMatchingComponents(name, type, matcher));
+ }
+ return components;
}
- return components;
+ finally
+ {
+ unlockRead();
+ }
}
/**
@@ -407,12 +482,20 @@
{
throw new IllegalArgumentException("null regex");
}
- Set<String> deployments = new TreeSet<String>();
- for(final ProfileView view : views)
+ lockRead();
+ try
{
- deployments.addAll(view.getMatchingDeploymentName(regex));
+ Set<String> deployments = new TreeSet<String>();
+ for(final ProfileView view : views)
+ {
+ deployments.addAll(view.getMatchingDeploymentName(regex));
+ }
+ return deployments;
}
- return deployments;
+ finally
+ {
+ unlockRead();
+ }
}
/**
@@ -428,12 +511,20 @@
{
throw new IllegalArgumentException("null deployment matcher");
}
- Set<ManagedDeployment> deployments = new HashSet<ManagedDeployment>();
- for(final ProfileView view : views)
+ lockRead();
+ try
{
- deployments.addAll(view.getMatchingDeployments(name, matcher));
+ Set<ManagedDeployment> deployments = new HashSet<ManagedDeployment>();
+ for(final ProfileView view : views)
+ {
+ deployments.addAll(view.getMatchingDeployments(name, matcher));
+ }
+ return deployments;
}
- return deployments;
+ finally
+ {
+ unlockRead();
+ }
}
/**
@@ -499,13 +590,21 @@
String msg = formatter.format(args);
throw new IllegalArgumentException(msg);
}
- ProfileViewWrapper target = resolveWrapper(serverComponent.getDeployment().getName());
- if(target == null)
+ lockWrite();
+ try
{
- throw new IllegalStateException("failed to resolve target profile for component " + serverComponent);
+ ProfileViewWrapper target = resolveWrapper(serverComponent.getDeployment().getName());
+ if(target == null)
+ {
+ throw new IllegalStateException("failed to resolve target profile for component " + serverComponent);
+ }
+ // Delegate request to handling wrapper.
+ target.removeComponent(comp, serverComponent);
}
- // Delegate request to handling wrapper.
- target.removeComponent(comp, serverComponent);
+ finally
+ {
+ unlockWrite();
+ }
}
/**
@@ -525,13 +624,21 @@
String msg = formatter.format(args);
throw new IllegalArgumentException(msg);
}
- ProfileViewWrapper target = resolveWrapper(serverComponent.getDeployment().getName());
- if(target == null)
+ lockWrite();
+ try
{
- throw new IllegalStateException("failed to resolve target profile for component " + serverComponent);
+ ProfileViewWrapper target = resolveWrapper(serverComponent.getDeployment().getName());
+ if(target == null)
+ {
+ throw new IllegalStateException("failed to resolve target profile for component " + serverComponent);
+ }
+ // Delegate request to handling wrapper.
+ target.updateComponent(comp, serverComponent);
}
- // Delegate request to handling wrapper.
- target.updateComponent(comp, serverComponent);
+ finally
+ {
+ unlockWrite();
+ }
}
/**
@@ -551,6 +658,24 @@
}
return null;
}
+
+ void lockRead()
+ {
+ lock.readLock().lock();
+ }
+ void unlockRead()
+ {
+ lock.readLock().unlock();
+ }
+ void lockWrite()
+ {
+ lock.writeLock().lock();
+ }
+ void unlockWrite()
+ {
+ lock.writeLock().unlock();
+ }
+
}
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-04-16 09:26:30 UTC (rev 104042)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/RegisteredProfileViewsWrapper.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -21,6 +21,7 @@
*/
package org.jboss.profileservice.plugins.management;
+import java.lang.reflect.UndeclaredThrowableException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -36,6 +37,7 @@
import org.jboss.managed.api.ManagedComponent;
import org.jboss.managed.api.ManagedDeployment;
import org.jboss.profileservice.management.event.ProfileLifeCycleEvent;
+import org.jboss.profileservice.management.event.ProfileModificationEvent;
import org.jboss.profileservice.management.event.ProfileLifeCycleEvent.LifeCycleState;
import org.jboss.profileservice.persistence.repository.PersistenceRepository;
import org.jboss.profileservice.plugins.management.actions.ProfileViewUpdateAction;
@@ -46,12 +48,13 @@
import org.jboss.profileservice.plugins.spi.ProfileView;
import org.jboss.profileservice.plugins.spi.ProfileViewWrapper;
import org.jboss.profileservice.spi.ProfileKey;
+import org.jboss.profileservice.spi.action.ActionController;
+import org.jboss.profileservice.spi.action.EventBus;
+import org.jboss.profileservice.spi.action.ModificationEvent;
+import org.jboss.profileservice.spi.action.ModificationStatus;
+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.action.engine.ProfileModificationAction;
import org.jboss.profileservice.spi.managed.ManagedProfile;
import org.jboss.util.collection.ConcurrentSet;
@@ -64,7 +67,7 @@
*/
public class RegisteredProfileViewsWrapper implements ProfileViewWrapper
{
-
+
/** The profiles. */
private Set<ProfileKey> registeredKeys = new ConcurrentSet<ProfileKey>();
private Map<ProfileKey, RegisteredProfileView> viewsByName = new ConcurrentHashMap<ProfileKey, RegisteredProfileView>();
@@ -98,8 +101,9 @@
Set<ProfileKey> have = registeredKeys;
this.registeredKeys = new ConcurrentSet<ProfileKey>();
+ List<ProfileKey> keys = controller.getActiveProfiles();
// Additions
- for(ProfileKey key : controller.getActiveProfiles())
+ for(ProfileKey key : keys)
{
boolean exists = have.remove(key);
registeredKeys.add(key);
@@ -122,16 +126,16 @@
}
}
// Load and process
- for(RegisteredProfileView view : viewsByName.values())
+ for(ProfileKey key : keys)
{
+ RegisteredProfileView view = viewsByName.get(key);
if(view.load())
{
- ProfileKey key = view.getKey();
ManagedProfile managedProfile = controller.getManagedProfile(key);
ProfileModificationAction<ProfileModificationContext> action = new ProfileViewUpdateAction(managedProfile, view, proxyFactory);
controller.perform(key, ProfileModificationType.GET, Collections.singletonList(action));
-
+
changed = true;
}
}
@@ -339,8 +343,14 @@
ProfileModificationAction updateComponentAction = new RemoveComponentAction(original, persistenceRepository, null);
List<ProfileModificationAction<ProfileModificationContext>> actions = new ArrayList<ProfileModificationAction<ProfileModificationContext>>();
actions.add(updateComponentAction);
- this.controller.perform(key, ProfileModificationType.UPDATE, actions);
+ ModificationStatus status = this.controller.perform(key, ProfileModificationType.UPDATE, actions);
+ getEventBus().fireModificationEvent(new ProfileModificationEvent(ProfileModificationType.DELETE, key));
+
+ if(status.isFailed())
+ {
+ rethrowAsException(status.getFailure());
+ }
}
public void updateComponent(ManagedComponent update, ManagedComponent original) throws Exception
@@ -351,9 +361,27 @@
ProfileModificationAction updateComponentAction = new UpdateComponentAction(update, original, proxyFactory, persistenceRepository, null);
List<ProfileModificationAction<ProfileModificationContext>> actions = new ArrayList<ProfileModificationAction<ProfileModificationContext>>();
actions.add(updateComponentAction);
- this.controller.perform(key, ProfileModificationType.UPDATE, actions);
+ ModificationStatus status = this.controller.perform(key, ProfileModificationType.UPDATE, actions);
+ getEventBus().fireModificationEvent(new ProfileModificationEvent(ProfileModificationType.UPDATE, key));
+
+ if(status.isFailed())
+ {
+ rethrowAsException(status.getFailure());
+ }
}
+
+ static void rethrowAsException(Throwable t) throws Exception
+ {
+ if(t instanceof Exception)
+ {
+ throw Exception.class.cast(t);
+ }
+ else
+ {
+ throw new UndeclaredThrowableException(t);
+ }
+ }
}
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-04-16 09:26:30 UTC (rev 104042)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/actions/ProfileViewUpdateAction.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -25,7 +25,6 @@
import java.util.HashSet;
import org.jboss.deployers.spi.management.KnownDeploymentTypes;
-import org.jboss.logging.Logger;
import org.jboss.managed.api.DeploymentState;
import org.jboss.managed.api.ManagedDeployment;
import org.jboss.managed.plugins.ManagedDeploymentImpl;
@@ -34,8 +33,9 @@
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.action.engine.ProfileModificationAction;
+import org.jboss.profileservice.spi.action.ProfileModificationResponse;
import org.jboss.profileservice.spi.managed.ManagedProfile;
/**
@@ -46,9 +46,6 @@
*/
public class ProfileViewUpdateAction implements ProfileModificationAction<ProfileModificationContext>
{
-
- /** The logger. */
- private static final Logger log = Logger.getLogger(ProfileViewUpdateAction.class);
/** The deployment types. */
static final String DEPLOYMENT_TYPES = KnownDeploymentTypes.class.getName();
@@ -81,7 +78,7 @@
return null;
}
- public void complete()
+ public void complete(ProfileModificationResponse response)
{
ManagedDeploymentProcessor processor = new ManagedDeploymentProcessor(proxyFactory);
Profile profile = managedProfile.getProfile();
@@ -112,7 +109,7 @@
}
catch(Exception e)
{
- log.debug("failed to process managed deployment " + deployment.getName(), e);
+ response.setFailure(e);
}
}
this.complete = true;
Modified: projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/actions/RemoveComponentAction.java
===================================================================
--- projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/actions/RemoveComponentAction.java 2010-04-16 09:26:30 UTC (rev 104042)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/actions/RemoveComponentAction.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -24,7 +24,10 @@
import org.jboss.managed.api.ManagedComponent;
import org.jboss.managed.api.ManagedDeployment;
import org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction;
+import org.jboss.profileservice.management.event.ProfileModificationEvent;
import org.jboss.profileservice.persistence.repository.PersistenceRepository;
+import org.jboss.profileservice.spi.action.ProfileModificationResponse;
+import org.jboss.profileservice.spi.action.ProfileModificationType;
import org.jboss.profileservice.spi.action.management.ManagementAction;
import org.jboss.profileservice.spi.action.management.ManagementActionContext;
@@ -34,7 +37,7 @@
*/
public class RemoveComponentAction extends AbstractTwoPhaseModificationAction<ManagementActionContext> implements ManagementAction<ManagementActionContext>
{
-
+
/** The component. */
private ManagedComponent component;
@@ -54,25 +57,26 @@
}
- protected void doCommit()
+ protected void doCommit(ProfileModificationResponse response)
{
}
- protected void doComplete() throws Exception
+ protected void doComplete(ProfileModificationResponse response) throws Exception
{
}
- protected boolean doPrepare()
+ protected boolean doPrepare(ProfileModificationResponse response)
{
try
{
ManagedDeployment deployment = component.getDeployment();
- persistenceRepository.removeComponent(deployment.getName(), component);
+ persistenceRepository.removeComponent(deployment.getName(), component);
}
catch(Exception e)
{
+ response.setFailure(e);
return false;
}
return true;
Modified: projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/actions/UpdateComponentAction.java
===================================================================
--- projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/actions/UpdateComponentAction.java 2010-04-16 09:26:30 UTC (rev 104042)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/actions/UpdateComponentAction.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -21,7 +21,6 @@
*/
package org.jboss.profileservice.plugins.management.actions;
-import org.jboss.logging.Logger;
import org.jboss.managed.api.Fields;
import org.jboss.managed.api.ManagedComponent;
import org.jboss.managed.api.ManagedDeployment;
@@ -33,6 +32,7 @@
import org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction;
import org.jboss.profileservice.persistence.repository.PersistenceRepository;
import org.jboss.profileservice.plugins.management.util.AbstractManagementProxyFactory;
+import org.jboss.profileservice.spi.action.ProfileModificationResponse;
import org.jboss.profileservice.spi.action.management.ManagementAction;
import org.jboss.profileservice.spi.action.management.ManagementActionContext;
@@ -43,8 +43,6 @@
public class UpdateComponentAction extends AbstractTwoPhaseModificationAction<ManagementActionContext> implements ManagementAction<ManagementActionContext>
{
- private static final Logger log = Logger.getLogger(UpdateComponentAction.class);
-
private ManagedComponent updatedComponent;
private ManagedComponent serverComponent;
private AbstractManagementProxyFactory proxyFactory;
@@ -68,19 +66,19 @@
}
- protected void doCommit()
+ protected void doCommit(ProfileModificationResponse response)
{
// FIXME doCommit
}
- protected void doComplete() throws Exception
+ protected void doComplete(ProfileModificationResponse response) throws Exception
{
// FIXME doComplete
}
- protected boolean doPrepare()
+ protected boolean doPrepare(ProfileModificationResponse response)
{
try
{
@@ -136,7 +134,7 @@
}
catch(Throwable t)
{
- log.error("failed to update managed component", t);
+ response.setFailure(t);
return false;
}
return true;
Modified: projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/util/AbstractManagedComponentRuntimeDispatcher.java
===================================================================
--- projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/util/AbstractManagedComponentRuntimeDispatcher.java 2010-04-16 09:26:30 UTC (rev 104042)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/util/AbstractManagedComponentRuntimeDispatcher.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -83,7 +83,6 @@
public MetaValue get(Object componentName, ManagedProperty property)
{
Object value = null;
- MetaMapper mapper = property.getTransientAttachment(MetaMapper.class);
try
{
value = get(componentName, property.getName());
@@ -92,6 +91,7 @@
{
throw new UndeclaredThrowableException(t, "Failed to get property '" + property.getName() + "' on component '" + componentName + "'.");
}
+ MetaMapper mapper = property.getTransientAttachment(MetaMapper.class);
if(mapper != null)
{
return mapper.createMetaValue(property.getMetaType(), value);
Modified: projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/util/ManagedObjectProcessor.java
===================================================================
--- projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/util/ManagedObjectProcessor.java 2010-04-16 09:26:30 UTC (rev 104042)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/util/ManagedObjectProcessor.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -33,6 +33,7 @@
import org.jboss.managed.api.ManagedDeployment;
import org.jboss.managed.api.ManagedObject;
import org.jboss.managed.api.ManagedProperty;
+import org.jboss.managed.api.MutableManagedComponent;
import org.jboss.managed.api.RunState;
import org.jboss.managed.api.annotation.ManagementComponent;
import org.jboss.managed.api.annotation.ManagementObjectID;
@@ -84,6 +85,15 @@
protected abstract RunState updateRunState(ManagedObject runtimeMO, ManagedComponent comp);
/**
+ * Create a managed component proxy.
+ *
+ * @param componentName the component name
+ * @param component the component
+ * @return the component proxy
+ */
+ protected abstract MutableManagedComponent createManagedComponentProxy(Object componentName, MutableManagedComponent component);
+
+ /**
* Process a managed object
*
* @param mo the managed object
@@ -146,7 +156,12 @@
if (mc != null)
{
ComponentType type = new ComponentType(mc.type(), mc.subtype());
- ManagedComponentImpl comp = new ManagedComponentImpl(type, md, mo);
+ MutableManagedComponent comp = new ManagedComponentImpl(type, md, mo);
+ if(comp.getComponentName() != null)
+ {
+ // create proxy
+ comp = createManagedComponentProxy(comp.getComponentName(), comp);
+ }
if(trace)
{
log.trace("Processing ManagementComponent("+mo.getName()+"): "+comp);
Modified: projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/util/ManagedObjectRuntimeProcessor.java
===================================================================
--- projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/util/ManagedObjectRuntimeProcessor.java 2010-04-16 09:26:30 UTC (rev 104042)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/util/ManagedObjectRuntimeProcessor.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -279,6 +279,11 @@
moi.setOperations(ops);
}
+ protected MutableManagedComponent createManagedComponentProxy(Object componentName, MutableManagedComponent component)
+ {
+ return MutableManagedComponent.class.cast(proxyFactory.createComponentProxy(component, componentName));
+ }
+
/**
* Create a proxy for managed operations.
*
@@ -348,6 +353,9 @@
if (name != null)
{
state = getMappedState(name, runStateMapper);
+
+ log.info("state for " + name + " is " + state);
+
if (comp instanceof MutableManagedComponent)
{
MutableManagedComponent mcomp = MutableManagedComponent.class.cast(comp);
Modified: projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/view/AbstractProfileView.java
===================================================================
--- projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/view/AbstractProfileView.java 2010-04-16 09:26:30 UTC (rev 104042)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/view/AbstractProfileView.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -40,8 +40,8 @@
import org.jboss.managed.api.ManagedObject;
import org.jboss.profileservice.plugins.spi.ProfileView;
import org.jboss.profileservice.plugins.spi.ProfileViewProcessingContext;
-import org.jboss.profileservice.spi.action.engine.ModificationEvent;
-import org.jboss.profileservice.spi.action.engine.ModificationListener;
+import org.jboss.profileservice.spi.action.ModificationEvent;
+import org.jboss.profileservice.spi.action.ModificationListener;
/**
* The abstract profile view.
Modified: projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/view/AbstractProfileViewWrapper.java
===================================================================
--- projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/view/AbstractProfileViewWrapper.java 2010-04-16 09:26:30 UTC (rev 104042)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/view/AbstractProfileViewWrapper.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -31,7 +31,7 @@
import org.jboss.profileservice.plugins.management.util.AbstractManagementProxyFactory;
import org.jboss.profileservice.plugins.spi.ProfileView;
import org.jboss.profileservice.plugins.spi.ProfileViewWrapper;
-import org.jboss.profileservice.spi.action.engine.ModificationEvent;
+import org.jboss.profileservice.spi.action.ModificationEvent;
/**
* @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
Modified: projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/view/RegisteredProfileView.java
===================================================================
--- projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/view/RegisteredProfileView.java 2010-04-16 09:26:30 UTC (rev 104042)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/view/RegisteredProfileView.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -22,8 +22,8 @@
package org.jboss.profileservice.plugins.management.view;
import org.jboss.profileservice.spi.ProfileKey;
+import org.jboss.profileservice.spi.action.ModificationEvent;
import org.jboss.profileservice.spi.action.ProfileModificationType;
-import org.jboss.profileservice.spi.action.engine.ModificationEvent;
/**
* A view of an active <code>Profile</code> using <code>ProfileService</code>.
Modified: projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/spi/ProfileView.java
===================================================================
--- projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/spi/ProfileView.java 2010-04-16 09:26:30 UTC (rev 104042)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/spi/ProfileView.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -28,7 +28,7 @@
import org.jboss.managed.api.ComponentType;
import org.jboss.managed.api.ManagedComponent;
import org.jboss.managed.api.ManagedDeployment;
-import org.jboss.profileservice.spi.action.engine.ModificationListener;
+import org.jboss.profileservice.spi.action.ModificationListener;
/**
* A management view of a single profile and extension point for integrating
Modified: projects/profileservice/trunk/plugins/src/test/java/org/jboss/test/profileservice/plugins/mgt/test/RegisteredProfileUnitTestCase.java
===================================================================
--- projects/profileservice/trunk/plugins/src/test/java/org/jboss/test/profileservice/plugins/mgt/test/RegisteredProfileUnitTestCase.java 2010-04-16 09:26:30 UTC (rev 104042)
+++ projects/profileservice/trunk/plugins/src/test/java/org/jboss/test/profileservice/plugins/mgt/test/RegisteredProfileUnitTestCase.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -22,9 +22,12 @@
package org.jboss.test.profileservice.plugins.mgt.test;
import org.jboss.profileservice.management.AbstractActionController;
+import org.jboss.profileservice.management.event.ProfileModificationEvent;
import org.jboss.profileservice.plugins.management.RegisteredProfileViewsWrapper;
+import org.jboss.profileservice.plugins.management.view.RegisteredProfileView;
import org.jboss.profileservice.spi.Profile;
import org.jboss.profileservice.spi.ProfileKey;
+import org.jboss.profileservice.spi.action.ProfileModificationType;
import org.jboss.profileservice.spi.managed.ManagedProfile;
import org.jboss.test.BaseTestCase;
import org.jboss.test.profileservice.plugins.deploy.support.ManagedProfileSupport;
@@ -62,18 +65,34 @@
{
addProfile(new RegisteredProfileSupport(new ProfileKey("test"), "test"));
addProfile(new RegisteredProfileSupport(new ProfileKey("test1"), "test123"));
- views.load();
+ assertTrue(views.load());
assertNotNull(views.getManagedDeployment("test"));
assertNotNull(views.getManagedDeployment("test123"));
+ assertFalse(views.load());
+
removeProfile(new ProfileKey("test"));
- views.load();
+ assertTrue(views.load());
assertNull(views.getManagedDeployment("test"));
assertNotNull(views.getManagedDeployment("test123"));
-
}
+
+ public void testReload()
+ {
+ final ProfileKey key = new ProfileKey("reload");
+ //
+ RegisteredProfileView view = new RegisteredProfileView(key);
+ actionController.addListener(view);
+ assertTrue(view.load());
+ assertFalse(view.load());
+ actionController.fireModificationEvent(new ProfileModificationEvent(ProfileModificationType.GET, key));
+ assertFalse(view.load());
+ actionController.fireModificationEvent(new ProfileModificationEvent(ProfileModificationType.UPDATE, key));
+ assertTrue(view.load());
+ actionController.fireModificationEvent(new ProfileModificationEvent(ProfileModificationType.UPDATE, new ProfileKey("other")));
+ assertFalse(view.load());
+ }
-
protected void addProfile(Profile profile)
{
actionController.addProfile(new ManagedProfileSupport(profile, deployer));
Copied: projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ActionController.java (from rev 104041, 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/ActionController.java (rev 0)
+++ projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ActionController.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -0,0 +1,69 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, JBoss 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.action;
+
+import java.util.List;
+
+import org.jboss.profileservice.spi.ProfileKey;
+import org.jboss.profileservice.spi.managed.ManagedProfile;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public interface ActionController
+{
+
+ /**
+ * Get a list of active profiles.
+ *
+ * @return the active profiles
+ */
+ public List<ProfileKey> getActiveProfiles();
+
+ /**
+ * Get a managed profile.
+ *
+ * @param key the profile key
+ * @return the managed profile
+ */
+ public ManagedProfile getManagedProfile(ProfileKey key);
+
+ /**
+ * Perform a list of modification actions on a single profile.
+ *
+ * @param key the target profile key
+ * @param actions the modification actions
+ * @return the modification status
+ */
+ ModificationStatus perform(ProfileKey key, ProfileModificationType type, List<ProfileModificationAction<ProfileModificationContext>> actions);
+
+ /**
+ * Perform modification actions affecting multiple profiles.
+ *
+ * @param actions the modification actions
+ * @return the modification status
+ */
+ ModificationStatus perform(ProfileModificationRequest actions);
+
+}
+
Copied: projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/EventBus.java (from rev 104041, projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/engine/EventBus.java)
===================================================================
--- projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/EventBus.java (rev 0)
+++ projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/EventBus.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -0,0 +1,53 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, JBoss 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.action;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public interface EventBus
+{
+
+ /**
+ * Add a listener.
+ *
+ * @param listener the listener
+ */
+ void addListener(ModificationListener listener);
+
+ /**
+ * Remove a listener
+ *
+ * @param listener the listener
+ */
+ void removeListener(ModificationListener listener);
+
+ /**
+ * Fire a modification event.
+ *
+ * @param event the modification event
+ */
+ void fireModificationEvent(ModificationEvent event);
+
+}
+
Copied: projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ModificationEvent.java (from rev 104041, projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/engine/ModificationEvent.java)
===================================================================
--- projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ModificationEvent.java (rev 0)
+++ projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ModificationEvent.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -0,0 +1,48 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, JBoss 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.action;
+
+import org.jboss.profileservice.spi.ProfileKey;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public interface ModificationEvent
+{
+
+ /**
+ * Get the affected profile.
+ *
+ * @return the profile key
+ */
+ ProfileKey getKey();
+
+ /**
+ * Get the modification type.
+ *
+ * @return the modification type
+ */
+ ProfileModificationType getModificationType();
+
+}
+
Copied: projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ModificationListener.java (from rev 104041, projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/engine/ModificationListener.java)
===================================================================
--- projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ModificationListener.java (rev 0)
+++ projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ModificationListener.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -0,0 +1,40 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, JBoss 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.action;
+
+/**
+ * The modification listener.
+ *
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public interface ModificationListener
+{
+
+ /**
+ * Notify.
+ *
+ * @param event the modification event
+ */
+ void notify(ModificationEvent event);
+}
+
Copied: projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ModificationStatus.java (from rev 104041, projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/engine/ModificationStatus.java)
===================================================================
--- projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ModificationStatus.java (rev 0)
+++ projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ModificationStatus.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -0,0 +1,54 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, JBoss 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.action;
+
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public interface ModificationStatus
+{
+
+ /**
+ * Get the failure exception.
+ *
+ * @return any failure exception associated with reaching the FAILED state.
+ */
+ Throwable getFailure();
+
+ /**
+ * Is the deployment complete
+ *
+ * @return true when complete, false otherwise
+ */
+ boolean isCompleted();
+
+ /**
+ * Has the deployment failed
+ *
+ * @return true when failed, false otherwise
+ */
+ boolean isFailed();
+
+}
+
Copied: projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ProfileModificationAction.java (from rev 103986, projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/engine/ProfileModificationAction.java)
===================================================================
--- projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ProfileModificationAction.java (rev 0)
+++ projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ProfileModificationAction.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -0,0 +1,67 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, JBoss 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.action;
+
+
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public interface ProfileModificationAction<T extends ProfileModificationContext>
+{
+
+ /**
+ * Get the modification context.
+ *
+ * @return the context.
+ */
+ T getContext();
+
+ /**
+ * Cancel the action.
+ */
+ void cancel();
+
+ /**
+ * Execute the action and if successful mark it as complete.
+ *
+ * @param the modification response
+ */
+ void complete(ProfileModificationResponse response);
+
+ /**
+ * Gets whether {@link #complete()} has been invoked.
+ *
+ * @return <code>true</code> if {@link #complete()} has been invoked
+ */
+ boolean isComplete();
+
+ /**
+ * Gets whether {@link #complete()} has been invoked.
+ *
+ * @return <code>true</code> if {@link #complete()} has been invoked
+ */
+ boolean isCancelled();
+
+}
+
Modified: projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ProfileModificationRequest.java
===================================================================
--- projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ProfileModificationRequest.java 2010-04-16 09:26:30 UTC (rev 104042)
+++ projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ProfileModificationRequest.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -24,7 +24,6 @@
import java.util.List;
import org.jboss.profileservice.spi.ProfileKey;
-import org.jboss.profileservice.spi.action.engine.ProfileModificationAction;
/**
* @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
Added: projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ProfileModificationResponse.java
===================================================================
--- projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ProfileModificationResponse.java (rev 0)
+++ projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ProfileModificationResponse.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -0,0 +1,71 @@
+/*
+* 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.action;
+
+
+/**
+ * Response of a {@code ModificationRequest}.
+ *
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public interface ProfileModificationResponse
+{
+
+ /**
+ * Get the modification status.
+ *
+ * @return the modification status.
+ */
+ ModificationStatus getStatus();
+
+ /**
+ * Optional response object.
+ *
+ * @return the response
+ */
+ Object getResponse();
+
+ /**
+ * Set optional response object
+ *
+ * @param response the response
+ */
+ void setResponse(Object response);
+
+ /**
+ * Set a failure.
+ *
+ * @param action the failed action
+ * @param t the failure
+ */
+ void setFailure(Throwable t);
+
+ /**
+ * Fire modification event.
+ *
+ * @param event the modification event
+ */
+ void fireModificationEvent(ModificationEvent event);
+
+}
+
Modified: projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/TwoPhaseCommitProfileAction.java
===================================================================
--- projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/TwoPhaseCommitProfileAction.java 2010-04-16 09:26:30 UTC (rev 104042)
+++ projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/TwoPhaseCommitProfileAction.java 2010-04-16 09:27:22 UTC (rev 104043)
@@ -21,8 +21,8 @@
*/
package org.jboss.profileservice.spi.action;
-import org.jboss.profileservice.spi.action.engine.ProfileModificationAction;
+
/**
* @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
* @version $Revision$
@@ -40,17 +40,17 @@
/**
* Prepare this action.
*/
- boolean prepare();
+ boolean prepare(ProfileModificationResponse response);
/**
* Attempt to commit this action.
*/
- void commit();
+ void commit(ProfileModificationResponse response);
/**
* Rolls back this action.
*/
- void rollback();
+ void rollback(ProfileModificationResponse response);
}
More information about the jboss-cvs-commits
mailing list