[jboss-cvs] JBossAS SVN: r103976 - in projects/profileservice/trunk: core/src/test/java/org/jboss/test/profileservice/test and 15 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Apr 14 10:53:01 EDT 2010
Author: emuckenhuber
Date: 2010-04-14 10:52:51 -0400 (Wed, 14 Apr 2010)
New Revision: 103976
Added:
projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/repository/
projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/repository/PersistenceRepository.java
projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/repository/metadata/
projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/repository/metadata/AttachmentMetaData.java
projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/repository/metadata/DeploymentClassPathMetaData.java
projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/repository/metadata/DeploymentMetaDataEntryMetaData.java
projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/repository/metadata/DeploymentStructureMetaData.java
projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/repository/metadata/RepositoryAttachmentMetaData.java
projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/repository/metadata/package-info.java
projects/profileservice/trunk/persistence/src/main/java/org/jboss/system/
projects/profileservice/trunk/persistence/src/main/java/org/jboss/system/server/
projects/profileservice/trunk/persistence/src/main/java/org/jboss/system/server/profileservice/
projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/AbstractTemplateCreator.java
projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/RemovedPropertyMap.java
projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/util/AbstractManagedComponentRuntimeDispatcher.java
projects/profileservice/trunk/plugins/src/test/java/org/jboss/test/profileservice/plugins/mgt/support/PersistenceRepositorySupport.java
projects/profileservice/trunk/spi/src/main/java/org/jboss/deployers/spi/management/ManagedComponentRuntimeDispatcher.java
Removed:
projects/profileservice/trunk/spi/src/main/java/org/jboss/deployers/spi/management/RuntimeComponentDispatcher.java
Modified:
projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/bootstrap/AbstractProfileServiceBootstrap.java
projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/test/BasicProfileServiceUnitTestCase.java
projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/AbstractDomainMetaData.java
projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/spi/DomainMetaData.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/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/AbstractManagementProxyFactory.java
projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/util/ManagedObjectRuntimeProcessor.java
projects/profileservice/trunk/plugins/src/test/java/org/jboss/test/profileservice/plugins/deploy/test/AbstractDeployTest.java
projects/profileservice/trunk/plugins/src/test/java/org/jboss/test/profileservice/plugins/mgt/support/NoopManagementProxyFactory.java
projects/profileservice/trunk/plugins/src/test/java/org/jboss/test/profileservice/plugins/mgt/test/RegisteredProfileUnitTestCase.java
Log:
replace RuntimeComponentDispatcher, move persistence metadata classes from trunk
Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/bootstrap/AbstractProfileServiceBootstrap.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/bootstrap/AbstractProfileServiceBootstrap.java 2010-04-14 14:16:01 UTC (rev 103975)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/bootstrap/AbstractProfileServiceBootstrap.java 2010-04-14 14:52:51 UTC (rev 103976)
@@ -85,10 +85,10 @@
{
ProfileRequirementResolver resolver = createRequirementResolver(domainMetaData);
BasicDomainMetaDataVisitor visitor = new BasicDomainMetaDataVisitor(resolver, getMetaDataRegistry());
- Collection<DomainMetaDataFragment> features = domainMetaData.getFeatures();
+ Collection<DomainMetaDataFragment> features = domainMetaData.getFragments();
if(features != null && features.isEmpty() == false)
{
- for(DomainMetaDataFragment node : domainMetaData.getFeatures())
+ for(DomainMetaDataFragment node : domainMetaData.getFragments())
{
visitor.visit(node);
}
Modified: projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/test/BasicProfileServiceUnitTestCase.java
===================================================================
--- projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/test/BasicProfileServiceUnitTestCase.java 2010-04-14 14:16:01 UTC (rev 103975)
+++ projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/test/BasicProfileServiceUnitTestCase.java 2010-04-14 14:52:51 UTC (rev 103976)
@@ -81,7 +81,7 @@
domain.registerProfileMetaData(md);
}
AbstractDomainMetaDataVisitor visitor = new AbstractDomainMetaDataVisitor(domain);
- for(DomainMetaDataFragment node : metaData.getFeatures())
+ for(DomainMetaDataFragment node : metaData.getFragments())
{
visitor.visit(node);
}
Modified: projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/AbstractDomainMetaData.java
===================================================================
--- projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/AbstractDomainMetaData.java 2010-04-14 14:16:01 UTC (rev 103975)
+++ projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/AbstractDomainMetaData.java 2010-04-14 14:52:51 UTC (rev 103976)
@@ -58,7 +58,7 @@
@XmlNs(namespaceURI=DomainMetaData.JMS_RESOURCES_NAMESPACE, prefix="jms"),
@XmlNs(namespaceURI=DomainMetaData.THREADS_NAMESPACE, prefix="tp")})
@XmlRootElement(name = "domain")
- at XmlType(name = "domainType", propOrder = {"server", "jdbcResources", "jmsResources", "threads", "features"})
+ at XmlType(name = "domainType", propOrder = {"server", "jdbcResources", "jmsResources", "threads", "fragments"})
public class AbstractDomainMetaData implements DomainMetaData
{
@@ -74,7 +74,7 @@
private List<JmsResource> jmsResources;
/** The elements of the domain. */
- private List<DomainMetaDataFragment> features;
+ private List<DomainMetaDataFragment> fragments;
/**
* Get the management domain information.
@@ -152,14 +152,14 @@
* @return the elements
*/
@XmlAnyElement
- public List<DomainMetaDataFragment> getFeatures()
+ public List<DomainMetaDataFragment> getFragments()
{
- return features;
+ return fragments;
}
-
- public void setFeatures(List<DomainMetaDataFragment> elements)
+
+ public void setFragments(List<DomainMetaDataFragment> elements)
{
- this.features = elements;
+ this.fragments = elements;
}
}
Modified: projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/spi/DomainMetaData.java
===================================================================
--- projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/spi/DomainMetaData.java 2010-04-14 14:16:01 UTC (rev 103975)
+++ projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/spi/DomainMetaData.java 2010-04-14 14:52:51 UTC (rev 103976)
@@ -48,7 +48,7 @@
*
* @return the features.
*/
- List<DomainMetaDataFragment> getFeatures();
+ List<DomainMetaDataFragment> getFragments();
}
Added: projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/repository/PersistenceRepository.java
===================================================================
--- projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/repository/PersistenceRepository.java (rev 0)
+++ projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/repository/PersistenceRepository.java 2010-04-14 14:52:51 UTC (rev 103976)
@@ -0,0 +1,93 @@
+/*
+* 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.persistence.repository;
+
+import org.jboss.managed.api.ManagedComponent;
+import org.jboss.profileservice.persistence.PersistenceFactory;
+import org.jboss.profileservice.persistence.repository.metadata.AttachmentMetaData;
+import org.jboss.profileservice.persistence.repository.metadata.RepositoryAttachmentMetaData;
+import org.jboss.profileservice.persistence.xml.PersistenceRoot;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public interface PersistenceRepository
+{
+
+ /**
+ * Get the persistence factory.
+ *
+ * @return the persistence factory
+ */
+ PersistenceFactory getPersistenceFactory();
+
+ /**
+ * Load the repository attachment meta data
+ *
+ * @param deploymentName the deployment name
+ * @param simpleName the simple name
+ * @return the persisted meta data or null if it does not exist
+ * @throws Exception
+ */
+ RepositoryAttachmentMetaData loadMetaData(String deploymentName, String simpleName) throws Exception;
+
+ /**
+ * Load a attachment.
+ *
+ * @param deploymentName
+ * @param simpleName
+ * @param attachment
+ * @return
+ * @throws Exception
+ */
+ PersistenceRoot loadAttachment(String deploymentName, String simpleName, AttachmentMetaData attachment) throws Exception;
+
+ /**
+ * Check whether persistence for a given {@code ManagedComponent}
+ * is supported.
+ *
+ * @param comp the managed component
+ * @return true if persistence is supported, false otherwise
+ */
+ boolean isSupportPersistence(ManagedComponent comp);
+
+ /**
+ * Persist the managed component.
+ *
+ * @param ctx the deployment context name
+ * @param comp the managed componenbt
+ * @throws Exception
+ */
+ void updateDeployment(String ctx, ManagedComponent comp) throws Exception;
+
+ /**
+ * Remove a component from the attachment.
+ *
+ * @param ctx the deployment context name
+ * @param comp the managed componenbt
+ * @throws Exception
+ */
+ void removeComponent(String ctx, ManagedComponent comp) throws Exception;
+
+}
+
Added: projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/repository/metadata/AttachmentMetaData.java
===================================================================
--- projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/repository/metadata/AttachmentMetaData.java (rev 0)
+++ projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/repository/metadata/AttachmentMetaData.java 2010-04-14 14:52:51 UTC (rev 103976)
@@ -0,0 +1,93 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.persistence.repository.metadata;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlTransient;
+
+/**
+ * The AttachmentMetaData, containing the information for storing and
+ * restoring the persisted Attachment.
+ *
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision: 89429 $
+ */
+public class AttachmentMetaData
+{
+
+ /** The attachment name */
+ private String name;
+
+ /** The attachment class name */
+ private String className;
+
+ /** The last modified. */
+ private long lastModified;
+
+ /** The attachment */
+ private transient Object attachment;
+
+ @XmlElement(name = "attachment-name")
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ @XmlElement(name = "attachment-class-name")
+ public String getClassName()
+ {
+ return className;
+ }
+
+ public void setClassName(String className)
+ {
+ this.className = className;
+ }
+
+ @XmlElement(name = "last-modified")
+ public long getLastModified()
+ {
+ return lastModified;
+ }
+
+ public void setLastModified(long lastModified)
+ {
+ this.lastModified = lastModified;
+ }
+
+ @XmlTransient
+ public Object getAttachment()
+ {
+ return attachment;
+ }
+
+ public void setAttachment(Object attachment)
+ {
+ this.attachment = attachment;
+ }
+}
+
Added: projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/repository/metadata/DeploymentClassPathMetaData.java
===================================================================
--- projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/repository/metadata/DeploymentClassPathMetaData.java (rev 0)
+++ projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/repository/metadata/DeploymentClassPathMetaData.java 2010-04-14 14:52:51 UTC (rev 103976)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.persistence.repository.metadata;
+
+import javax.xml.bind.annotation.XmlElement;
+
+/**
+ * The DeploymentClassPathMetaData is the xml representation
+ * of the ClassPathEntry in ContextInfo.
+ *
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision: 82920 $
+ */
+public class DeploymentClassPathMetaData
+{
+
+ /** The path */
+ private String path;
+
+ /** The suffixes */
+ private String suffixes;
+
+ public DeploymentClassPathMetaData()
+ {
+ //
+ }
+
+ public DeploymentClassPathMetaData(String path, String suffixes)
+ {
+ this.path = path;
+ this.suffixes = suffixes;
+ }
+
+ @XmlElement(name = "path")
+ public String getPath()
+ {
+ return path;
+ }
+
+ public void setPath(String path)
+ {
+ this.path = path;
+ }
+
+ @XmlElement(name = "suffixes")
+ public String getSuffixes()
+ {
+ return suffixes;
+ }
+
+ public void setSuffixes(String suffixes)
+ {
+ this.suffixes = suffixes;
+ }
+
+}
Added: projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/repository/metadata/DeploymentMetaDataEntryMetaData.java
===================================================================
--- projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/repository/metadata/DeploymentMetaDataEntryMetaData.java (rev 0)
+++ projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/repository/metadata/DeploymentMetaDataEntryMetaData.java 2010-04-14 14:52:51 UTC (rev 103976)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.persistence.repository.metadata;
+
+import javax.xml.bind.annotation.XmlElement;
+
+/**
+ * The DeploymentMetaDataEntryMetaData is the xml representation
+ * of the MetaDataEntry in ContextInfo.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class DeploymentMetaDataEntryMetaData
+{
+ /** The path */
+ private String path;
+
+ /** The type */
+ private String type;
+
+ public DeploymentMetaDataEntryMetaData()
+ {
+ }
+
+ public DeploymentMetaDataEntryMetaData(String path, String type)
+ {
+ this.path = path;
+ this.type = type;
+ }
+
+ @XmlElement(name = "name")
+ public String getPath()
+ {
+ return path;
+ }
+
+ public void setPath(String path)
+ {
+ this.path = path;
+ }
+
+ @XmlElement(name = "type")
+ public String getType()
+ {
+ return type;
+ }
+
+ public void setType(String type)
+ {
+ this.type = type;
+ }
+}
\ No newline at end of file
Added: projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/repository/metadata/DeploymentStructureMetaData.java
===================================================================
--- projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/repository/metadata/DeploymentStructureMetaData.java (rev 0)
+++ projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/repository/metadata/DeploymentStructureMetaData.java 2010-04-14 14:52:51 UTC (rev 103976)
@@ -0,0 +1,106 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.persistence.repository.metadata;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlElement;
+
+/**
+ * Basic xml representation helper class of the StructureMetaData.
+ *
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision: 99302 $
+ */
+public class DeploymentStructureMetaData
+{
+ /** The meta data path */
+ private List<DeploymentMetaDataEntryMetaData> metaDataPaths;
+
+ /** The class paths */
+ private List<DeploymentClassPathMetaData> classPaths;
+
+ /** The comparator class name */
+ private String comparatorClass;
+
+ /** The modifcation type */
+ private String modificationType;
+
+ /** The relative order */
+ private int relatativeOrder;
+
+
+ @XmlElement(name = "meta-data-path")
+ public List<DeploymentMetaDataEntryMetaData> getMetaDataPaths()
+ {
+ return metaDataPaths;
+ }
+
+ public void setMetaDataPaths(List<DeploymentMetaDataEntryMetaData> metaDataPaths)
+ {
+ this.metaDataPaths = metaDataPaths;
+ }
+
+ @XmlElement(name = "class-path")
+ public List<DeploymentClassPathMetaData> getClassPaths()
+ {
+ return classPaths;
+ }
+
+ public void setClassPaths(List<DeploymentClassPathMetaData> classPaths)
+ {
+ this.classPaths = classPaths;
+ }
+
+ @XmlElement(name = "comparator-class")
+ public String getComparatorClass()
+ {
+ return comparatorClass;
+ }
+
+ public void setComparatorClass(String comparatorClass)
+ {
+ this.comparatorClass = comparatorClass;
+ }
+
+ @XmlElement(name = "relative-order")
+ public int getRelatativeOrder()
+ {
+ return relatativeOrder;
+ }
+
+ public void setRelatativeOrder(int relatativeOrder)
+ {
+ this.relatativeOrder = relatativeOrder;
+ }
+
+ @XmlElement(name = "modifcation-type")
+ public String getModificationType()
+ {
+ return modificationType;
+ }
+
+ public void setModificationType(String modificationType)
+ {
+ this.modificationType = modificationType;
+ }
+}
Added: projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/repository/metadata/RepositoryAttachmentMetaData.java
===================================================================
--- projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/repository/metadata/RepositoryAttachmentMetaData.java (rev 0)
+++ projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/repository/metadata/RepositoryAttachmentMetaData.java 2010-04-14 14:52:51 UTC (rev 103976)
@@ -0,0 +1,110 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.persistence.repository.metadata;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * Metadata describing the persisted deployment attachments.
+ *
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision: 89429 $
+ */
+ at XmlRootElement(name = "attachments-metadata")
+public class RepositoryAttachmentMetaData
+{
+
+ /** The deployment */
+ private String deploymentName;
+
+ /** The last update timestamp */
+ private long lastModified;
+
+ /** The children */
+ private List<RepositoryAttachmentMetaData> children;
+
+ /** The attachments */
+ private List<AttachmentMetaData> attachments;
+
+ /** The deployment structure */
+ private DeploymentStructureMetaData deploymentStructure;
+
+ @XmlElement(name = "deployment-name")
+ public String getDeploymentName()
+ {
+ return deploymentName;
+ }
+
+ public void setDeploymentName(String deploymentName)
+ {
+ this.deploymentName = deploymentName;
+ }
+
+ @XmlElement(name = "last-modified")
+ public long getLastModified()
+ {
+ return lastModified;
+ }
+
+ public void setLastModified(long lastModified)
+ {
+ this.lastModified = lastModified;
+ }
+
+ @XmlElement(name = "deployment-structure")
+ public DeploymentStructureMetaData getDeploymentStructure()
+ {
+ return deploymentStructure;
+ }
+
+ public void setDeploymentStructure(DeploymentStructureMetaData deploymentStructure)
+ {
+ this.deploymentStructure = deploymentStructure;
+ }
+
+ @XmlElement(name = "child")
+ public List<RepositoryAttachmentMetaData> getChildren()
+ {
+ return children;
+ }
+
+ public void setChildren(List<RepositoryAttachmentMetaData> children)
+ {
+ this.children = children;
+ }
+
+ @XmlElement(name = "attachment")
+ public List<AttachmentMetaData> getAttachments()
+ {
+ return attachments;
+ }
+
+ public void setAttachments(List<AttachmentMetaData> attachments)
+ {
+ this.attachments = attachments;
+ }
+
+}
+
Added: projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/repository/metadata/package-info.java
===================================================================
--- projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/repository/metadata/package-info.java (rev 0)
+++ projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/repository/metadata/package-info.java 2010-04-14 14:52:51 UTC (rev 103976)
@@ -0,0 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.
+ */
+ at XmlSchema(namespace = "urn:org:jboss:profileservice:attachments:1.0",
+ elementFormDefault = XmlNsForm.QUALIFIED,
+ xmlns = { @XmlNs(namespaceURI = "http://www.w3.org/2001/XMLSchema", prefix = "xs") }
+)
+package org.jboss.profileservice.persistence.repository.metadata;
+
+import javax.xml.bind.annotation.XmlNs;
+import javax.xml.bind.annotation.XmlNsForm;
+import javax.xml.bind.annotation.XmlSchema;
+
Added: projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/AbstractTemplateCreator.java
===================================================================
--- projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/AbstractTemplateCreator.java (rev 0)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/AbstractTemplateCreator.java 2010-04-14 14:52:51 UTC (rev 103976)
@@ -0,0 +1,258 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.plugins.management;
+
+import java.net.URL;
+import java.util.Map;
+
+import org.jboss.deployers.spi.management.DeploymentTemplate;
+import org.jboss.deployers.spi.management.deploy.DeploymentManager;
+import org.jboss.deployers.spi.management.deploy.DeploymentProgress;
+import org.jboss.managed.api.DeploymentTemplateInfo;
+import org.jboss.managed.api.ManagedProperty;
+import org.jboss.profileservice.spi.ProfileKey;
+import org.jboss.vfs.VirtualFile;
+
+/**
+ * A basic template creator, which applies and distributes the template.
+ *
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision: 101688 $
+ */
+public class AbstractTemplateCreator
+{
+
+ /** Some filtered characters. */
+ private static final char[] filtered = new char[] { '/', '\\', ':', '*', '?', '"', '<', '>', '|' };
+ private static final char replace = '_';
+
+ /** The deployment manager. */
+ private DeploymentManager deploymentMgr;
+
+ /** The default profile key. */
+ private ProfileKey defaultKey = new ProfileKey(ProfileKey.DEFAULT);
+
+ public DeploymentManager getDeploymentManager()
+ {
+ return deploymentMgr;
+ }
+
+ public void setDeploymentManager(DeploymentManager deploymentMgr)
+ {
+ this.deploymentMgr = deploymentMgr;
+ }
+
+ public ProfileKey getDefaulProfiletKey()
+ {
+ return defaultKey;
+ }
+
+ public void setDefaultProfileKey(ProfileKey defaultKey)
+ {
+ this.defaultKey = defaultKey;
+ }
+
+ public String applyTemplate(DeploymentTemplate template, String deploymentBaseName, DeploymentTemplateInfo info)
+ throws Exception
+ {
+ if(template == null)
+ throw new IllegalArgumentException("Null deployment template.");
+ if(deploymentBaseName == null)
+ throw new IllegalArgumentException("Null deployment name.");
+ deploymentBaseName = deploymentBaseName.trim();
+ if(deploymentBaseName.length() == 0)
+ throw new IllegalArgumentException("emtpy deployment base name");
+ if(info == null)
+ throw new IllegalArgumentException("Null deployment template info.");
+
+ // Load the deployment manager
+ this.deploymentMgr.loadProfile(defaultKey);
+ // The virtual file
+ VirtualFile base = null;
+ // Deploy the deployment
+ String[] repositoryNames = null;
+ try
+ {
+ // Apply the template
+ String deploymentName = template.getDeploymentName(fixDeploymentName(deploymentBaseName));
+ if(deploymentName == null)
+ throw new IllegalStateException("getDeploymentName returned a null value.");
+ // Wrap info to exclude all removed properties
+ FilteredDeploymentTemplateInfo filterInfo = new FilteredDeploymentTemplateInfo(info);
+ base = template.applyTemplate(filterInfo);
+ if(base == null)
+ throw new IllegalStateException("applyTemplate returned null virtual file.");
+
+ try
+ {
+ // Distribute
+ repositoryNames = distribute(deploymentName, base.toURL());
+ }
+ catch(Exception e)
+ {
+ try
+ {
+ // Try to remove
+ if(repositoryNames != null)
+ remove(repositoryNames);
+ }
+ catch(Exception ignore) { }
+ // Rethrow
+ throw e;
+ }
+
+ try
+ {
+ // Start the deployment
+ start(repositoryNames);
+ }
+ catch(Exception e)
+ {
+ try
+ {
+ // Try to stop
+ stop(repositoryNames);
+ }
+ catch(Exception ignore)
+ {
+ //
+ }
+ try
+ {
+ // Try to remove
+ remove(repositoryNames);
+ }
+ catch(Exception ignore)
+ {
+ //
+ }
+ // Rethrow
+ throw e;
+ }
+ }
+ finally
+ {
+ // Release the deployment manager
+ this.deploymentMgr.releaseProfile();
+
+ // Remove the temp file
+ if(base != null)
+ base.delete();
+ }
+ return repositoryNames[0];
+ }
+
+ protected String fixDeploymentName(String name)
+ {
+ String fixed = name;
+ for(char c : filtered)
+ fixed = fixed.replace(c, replace);
+ return fixed;
+ }
+
+ protected String[] distribute(String name, URL url) throws Exception
+ {
+ DeploymentProgress progress = this.deploymentMgr.distribute(name, url, true);
+ progress.run();
+
+ //
+ checkComplete(progress);
+
+ return progress.getDeploymentID().getRepositoryNames();
+ }
+
+ protected void start(String[] names) throws Exception
+ {
+ DeploymentProgress progress = this.deploymentMgr.start(names);
+ progress.run();
+
+ checkComplete(progress);
+ }
+
+ protected void stop(String[] names) throws Exception
+ {
+ DeploymentProgress progress = this.deploymentMgr.stop(names);
+ progress.run();
+
+ checkComplete(progress);
+ }
+
+ protected void remove(String[] names) throws Exception
+ {
+ DeploymentProgress progress = this.deploymentMgr.remove(names);
+ progress.run();
+
+ checkComplete(progress);
+ }
+
+ protected void checkComplete(DeploymentProgress progress) throws Exception
+ {
+ if(progress.getDeploymentStatus().isFailed())
+ {
+ throw new RuntimeException("Failed to process template.", progress.getDeploymentStatus().getFailure());
+ }
+ }
+
+ /**
+ * A DeploymentTemplateInfo that filters out any ManagedProperties that have
+ * been removed.
+ *
+ * @author Scott.Stark at jboss.org
+ */
+ public static class FilteredDeploymentTemplateInfo implements DeploymentTemplateInfo
+ {
+ private DeploymentTemplateInfo delegate;
+
+ public FilteredDeploymentTemplateInfo(DeploymentTemplateInfo delegate)
+ {
+ this.delegate = delegate;
+ }
+
+ public DeploymentTemplateInfo copy()
+ {
+ FilteredDeploymentTemplateInfo copy = new FilteredDeploymentTemplateInfo(delegate.copy());
+ return copy;
+ }
+
+ public String getDescription()
+ {
+ return delegate.getDescription();
+ }
+
+ public String getName()
+ {
+ return delegate.getName();
+ }
+
+ public Map<String, ManagedProperty> getProperties()
+ {
+ RemovedPropertyMap props = new RemovedPropertyMap(delegate.getProperties());
+ return props;
+ }
+
+ public String getRootManagedPropertyName()
+ {
+ return delegate.getRootManagedPropertyName();
+ }
+ }
+
+}
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-14 14:16:01 UTC (rev 103975)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/AggregatingLocalManagementView.java 2010-04-14 14:52:51 UTC (rev 103976)
@@ -54,7 +54,8 @@
* @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
* @version $Revision$
*/
-public class AggregatingLocalManagementView implements ManagementView
+public class AggregatingLocalManagementView extends AbstractTemplateCreator
+ implements ManagementView
{
/** The logger. */
@@ -231,7 +232,13 @@
throw new IllegalStateException(msg);
}
- // TODO use deploy actions to distribute the content.
+ // Create a deployment base from the template
+ if( log.isTraceEnabled() )
+ log.trace("applyTemplate, deploymentBaseName="+deploymentBaseName +", info="+info);
+
+ // Create, distribute and start a deployment template
+ super.applyTemplate(template, deploymentBaseName, info);
+ // TODO reload view
}
/**
@@ -256,7 +263,7 @@
if(component == null)
{
// TODO throw localized exception
- throw new IllegalStateException("failed to find component for name " + name);
+ // TODO throw new IllegalStateException("failed to find component for name " + name);
}
return component;
}
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-14 14:16:01 UTC (rev 103975)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/RegisteredProfileViewsWrapper.java 2010-04-14 14:52:51 UTC (rev 103976)
@@ -37,7 +37,9 @@
import org.jboss.managed.api.ManagedDeployment;
import org.jboss.profileservice.management.event.ProfileLifeCycleEvent;
import org.jboss.profileservice.management.event.ProfileLifeCycleEvent.LifeCycleState;
+import org.jboss.profileservice.persistence.repository.PersistenceRepository;
import org.jboss.profileservice.plugins.management.actions.ProfileViewUpdateAction;
+import org.jboss.profileservice.plugins.management.actions.RemoveComponentAction;
import org.jboss.profileservice.plugins.management.actions.UpdateComponentAction;
import org.jboss.profileservice.plugins.management.util.AbstractManagementProxyFactory;
import org.jboss.profileservice.plugins.management.view.RegisteredProfileView;
@@ -70,16 +72,24 @@
/** The managed proxy factory. */
private AbstractManagementProxyFactory proxyFactory;
+ /** The persistence repository. */
+ private PersistenceRepository persistenceRepository;
+
/** The action controller. */
private final ActionController controller;
- public RegisteredProfileViewsWrapper(ActionController controller)
+ public RegisteredProfileViewsWrapper(ActionController controller, PersistenceRepository persistenceRepository)
{
if(controller == null)
{
throw new IllegalArgumentException("null action controller");
}
+ if(persistenceRepository == null)
+ {
+ throw new IllegalArgumentException("null persistence repository");
+ }
this.controller = controller;
+ this.persistenceRepository = persistenceRepository;
}
public synchronized boolean load()
@@ -323,7 +333,14 @@
public void removeComponent(ManagedComponent update, ManagedComponent original) throws Exception
{
- // TODO
+ ManagedDeployment deployment = original.getDeployment();
+ ProfileKey key = resolveProfile(deployment.getName());
+
+ 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);
+
}
public void updateComponent(ManagedComponent update, ManagedComponent original) throws Exception
@@ -331,7 +348,7 @@
ManagedDeployment deployment = original.getDeployment();
ProfileKey key = resolveProfile(deployment.getName());
- ProfileModificationAction updateComponentAction = new UpdateComponentAction(update, original, proxyFactory, null);
+ 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);
Added: projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/RemovedPropertyMap.java
===================================================================
--- projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/RemovedPropertyMap.java (rev 0)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/RemovedPropertyMap.java 2010-04-14 14:52:51 UTC (rev 103976)
@@ -0,0 +1,142 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * 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.plugins.management;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.managed.api.ManagedProperty;
+
+/**
+ * Map<String, ManagedProperty> that filters out ManagedPropertys that have
+ * isRemoved == true.
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision: 86711 $
+ */
+public class RemovedPropertyMap
+ implements Map<String, ManagedProperty>
+{
+ private Map<String, ManagedProperty> delegate;
+ private Set<String> keySet;
+
+ public RemovedPropertyMap(Map<String, ManagedProperty> delegate)
+ {
+ this.delegate = delegate;
+ // Filter out the removed property keys
+ keySet = new HashSet<String>();
+ for(String key : delegate.keySet())
+ {
+ ManagedProperty mp = delegate.get(key);
+ if(mp != null && mp.isRemoved() == false)
+ keySet.add(key);
+ }
+ }
+
+ public void clear()
+ {
+ delegate.clear();
+ keySet.clear();
+ }
+
+ public boolean containsKey(Object key)
+ {
+ return keySet.contains(key);
+ }
+
+ public boolean containsValue(Object value)
+ {
+ ManagedProperty mp = (ManagedProperty) value;
+ return keySet.contains(mp.getName());
+ }
+
+ public Set<Entry<String, ManagedProperty>> entrySet()
+ {
+ return delegate.entrySet();
+ }
+
+ public boolean equals(Object o)
+ {
+ return delegate.equals(o);
+ }
+
+ public ManagedProperty get(Object key)
+ {
+ ManagedProperty mp = delegate.get(key);
+ if(mp != null && mp.isRemoved())
+ mp = null;
+ return mp;
+ }
+
+ public int hashCode()
+ {
+ return delegate.hashCode();
+ }
+
+ public boolean isEmpty()
+ {
+ return keySet.isEmpty();
+ }
+
+ public Set<String> keySet()
+ {
+ return keySet;
+ }
+
+ public ManagedProperty put(String key, ManagedProperty value)
+ {
+ if(value.isRemoved())
+ keySet.add(key);
+ return delegate.put(key, value);
+ }
+
+ public void putAll(Map<? extends String, ? extends ManagedProperty> t)
+ {
+ delegate.putAll(t);
+ }
+
+ public ManagedProperty remove(Object key)
+ {
+ if(keySet.contains(key))
+ keySet.remove(key);
+ return delegate.remove(key);
+ }
+
+ public int size()
+ {
+ return keySet.size();
+ }
+
+ public Collection<ManagedProperty> values()
+ {
+ ArrayList<ManagedProperty> values = new ArrayList<ManagedProperty>();
+ for(ManagedProperty mp : delegate.values())
+ {
+ if(mp.isRemoved() == false)
+ values.add(mp);
+ }
+ return values;
+ }
+}
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-14 14:16:01 UTC (rev 103975)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/actions/RemoveComponentAction.java 2010-04-14 14:52:51 UTC (rev 103976)
@@ -21,7 +21,10 @@
*/
package org.jboss.profileservice.plugins.management.actions;
+import org.jboss.managed.api.ManagedComponent;
+import org.jboss.managed.api.ManagedDeployment;
import org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction;
+import org.jboss.profileservice.persistence.repository.PersistenceRepository;
import org.jboss.profileservice.spi.action.management.ManagementAction;
import org.jboss.profileservice.spi.action.management.ManagementActionContext;
@@ -32,62 +35,71 @@
public class RemoveComponentAction extends AbstractTwoPhaseModificationAction<ManagementActionContext> implements ManagementAction<ManagementActionContext>
{
- public RemoveComponentAction(ManagementActionContext modificationContext)
+ /** The component. */
+ private ManagedComponent component;
+
+ /** The persistence repository. */
+ private PersistenceRepository persistenceRepository;
+
+ public RemoveComponentAction(ManagedComponent component, PersistenceRepository persistenceRepository,
+ ManagementActionContext modificationContext)
{
super(modificationContext);
+ this.component = component;
+ this.persistenceRepository = persistenceRepository;
}
protected void doCancel()
{
- // FIXME doCancel
}
protected void doCommit()
{
- // FIXME doCommit
}
protected void doComplete() throws Exception
{
- // FIXME doComplete
}
protected boolean doPrepare()
{
- // FIXME doPrepare
- return false;
+ try
+ {
+ ManagedDeployment deployment = component.getDeployment();
+ persistenceRepository.removeComponent(deployment.getName(), component);
+ }
+ catch(Exception e)
+ {
+ return false;
+ }
+ return true;
}
protected void doRollbackFromActive()
{
- // FIXME doRollbackFromActive
}
protected void doRollbackFromCancelled()
{
- // FIXME doRollbackFromCancelled
-
+
}
protected void doRollbackFromComplete()
{
- // FIXME doRollbackFromComplete
}
protected void doRollbackFromPrepared()
{
- // FIXME doRollbackFromPrepared
-
+
}
protected void doRollbackFromRollbackOnly()
{
- // FIXME doRollbackFromRollbackOnly
}
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-14 14:16:01 UTC (rev 103975)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/actions/UpdateComponentAction.java 2010-04-14 14:52:51 UTC (rev 103976)
@@ -24,12 +24,14 @@
import org.jboss.logging.Logger;
import org.jboss.managed.api.Fields;
import org.jboss.managed.api.ManagedComponent;
+import org.jboss.managed.api.ManagedDeployment;
import org.jboss.managed.api.ManagedObject;
import org.jboss.managed.api.ManagedProperty;
import org.jboss.managed.api.annotation.ActivationPolicy;
import org.jboss.managed.api.annotation.ViewUse;
import org.jboss.metatype.api.values.MetaValue;
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.management.ManagementAction;
import org.jboss.profileservice.spi.action.management.ManagementActionContext;
@@ -46,14 +48,17 @@
private ManagedComponent updatedComponent;
private ManagedComponent serverComponent;
private AbstractManagementProxyFactory proxyFactory;
+ private PersistenceRepository persistenceRepository;
public UpdateComponentAction(ManagedComponent updatedComponent, ManagedComponent serverComponent,
AbstractManagementProxyFactory proxyFactory,
+ PersistenceRepository persistenceRepository,
ManagementActionContext modificationContext)
{
super(modificationContext);
this.updatedComponent = updatedComponent;
this.serverComponent = serverComponent;
+ this.persistenceRepository = persistenceRepository;
this.proxyFactory = proxyFactory;
}
@@ -122,9 +127,12 @@
if (componentName != null && policy.equals(ActivationPolicy.IMMEDIATE))
{
- getProxyFactory().getDispatcher().set(componentName, ctxProp.getName(), metaValue);
+ getProxyFactory().getDispatcher().set(componentName, ctxProp, metaValue);
}
- }
+ }
+ // Persistence
+ ManagedDeployment deployment = serverComponent.getDeployment();
+ persistenceRepository.updateDeployment(deployment.getName(), serverComponent);
}
catch(Throwable t)
{
Added: 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 (rev 0)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/util/AbstractManagedComponentRuntimeDispatcher.java 2010-04-14 14:52:51 UTC (rev 103976)
@@ -0,0 +1,194 @@
+/*
+* 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.plugins.management.util;
+
+import java.lang.reflect.UndeclaredThrowableException;
+import java.util.Arrays;
+
+import org.jboss.deployers.spi.management.ManagedComponentRuntimeDispatcher;
+import org.jboss.managed.api.ManagedOperation;
+import org.jboss.managed.api.ManagedParameter;
+import org.jboss.managed.api.ManagedProperty;
+import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.metatype.api.values.MetaValueFactory;
+import org.jboss.metatype.plugins.values.MetaValueFactoryBuilder;
+import org.jboss.metatype.spi.values.MetaMapper;
+
+/**
+ * The abstract managed component runtime dispatcher.
+ *
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public abstract class AbstractManagedComponentRuntimeDispatcher implements ManagedComponentRuntimeDispatcher
+{
+
+ /** The meta value factory. */
+ private static final MetaValueFactory valueFactory = MetaValueFactoryBuilder.create();
+
+ /**
+ * Getter property / attribute
+ *
+ * @param name entry name
+ * @param getter property / attribute name
+ * @return target's property / attribute instance
+ * @throws Throwable for any error
+ */
+ protected abstract Object get(Object name, String getter) throws Throwable;
+
+ /**
+ * Setter property / attribute
+ *
+ * @param name entry name
+ * @param setter property / attribute name
+ * @param value set target's property / attribute instance
+ * @throws Throwable for any error
+ */
+ protected abstract void set(Object name, String setter, Object value) throws Throwable;
+
+ /**
+ * Invoke method / operation
+ *
+ * @param name entry name
+ * @param methodName method name
+ * @param parameters parameter values
+ * @param signature method's parameter types / signatures
+ * @return inovocation's return object
+ * @throws Throwable for any error
+ */
+ protected abstract Object invoke(Object name, String methodName, Object[] parameters, String[] signature) throws Throwable;
+
+ /**
+ * {@inheritDoc}
+ */
+ public MetaValue get(Object componentName, ManagedProperty property)
+ {
+ Object value = null;
+ MetaMapper mapper = property.getTransientAttachment(MetaMapper.class);
+ try
+ {
+ value = get(componentName, property.getName());
+ }
+ catch(Throwable t)
+ {
+ throw new UndeclaredThrowableException(t, "Failed to get property '" + property.getName() + "' on component '" + componentName + "'.");
+ }
+ if(mapper != null)
+ {
+ return mapper.createMetaValue(property.getMetaType(), value);
+ }
+ else
+ {
+ return create(value);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void set(Object componentName, ManagedProperty property, MetaValue metaValue)
+ {
+ Object value = null;
+ MetaMapper mapper = property.getTransientAttachment(MetaMapper.class);
+ if(mapper != null)
+ {
+ value = mapper.unwrapMetaValue(metaValue);
+ }
+ else
+ {
+ value = unwrap(metaValue);
+ }
+ try
+ {
+ set(componentName, property.getName(), value);
+ }
+ catch(Throwable t)
+ {
+ throw new UndeclaredThrowableException(t, "Failed to set property '" + property.getName() + "' on component '" + componentName + "' to value [" + value + "].");
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public MetaValue invoke(Object componentName, ManagedOperation operation, MetaValue... param)
+ {
+ String[] sig = new String[param.length];
+ Object[] args = new Object[param.length];
+ ManagedParameter[] params = operation.getParameters();
+ for(int i=0; i < param.length; i++)
+ {
+ ManagedParameter mp = params[i];
+ MetaMapper<?> mapper = mp.getTransientAttachment(MetaMapper.class);
+ if(mapper != null)
+ args[i] = mapper.unwrapMetaValue(param[i]);
+ else
+ args[i] = unwrap(param[i]);
+ //
+ sig[i] = mp.getMetaType().getTypeName();
+ }
+ try
+ {
+ // Invoke
+ Object value = invoke(componentName, operation.getName(), args, sig);
+ MetaValue mvalue = null;
+ if (value != null)
+ {
+ // Look for a return type MetaMapper
+ MetaMapper returnTypeMapper = operation.getTransientAttachment(MetaMapper.class);
+ if (returnTypeMapper != null)
+ mvalue = returnTypeMapper.createMetaValue(operation.getReturnType(), value);
+ else
+ mvalue = create(value);
+ }
+ return mvalue;
+ }
+ catch(Throwable t)
+ {
+ throw new UndeclaredThrowableException(t, "Failed to invoke method '" + operation.getName() + "' on component '" + componentName + "' with parameters " + Arrays.asList(param) + ".");
+ }
+ }
+
+ /**
+ * Create meta value.
+ *
+ * @param value the value
+ * @return meta value instance
+ */
+ protected MetaValue create(Object value)
+ {
+ return valueFactory.create(value);
+ }
+
+ /**
+ * Unwrap meta value.
+ *
+ * @param metaValue the meta value
+ * @return unwrapped value
+ */
+ protected Object unwrap(MetaValue metaValue)
+ {
+ return valueFactory.unwrap(metaValue);
+ }
+
+}
+
Modified: projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/util/AbstractManagementProxyFactory.java
===================================================================
--- projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/util/AbstractManagementProxyFactory.java 2010-04-14 14:16:01 UTC (rev 103975)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/util/AbstractManagementProxyFactory.java 2010-04-14 14:52:51 UTC (rev 103976)
@@ -21,7 +21,7 @@
*/
package org.jboss.profileservice.plugins.management.util;
-import org.jboss.deployers.spi.management.RuntimeComponentDispatcher;
+import org.jboss.deployers.spi.management.ManagedComponentRuntimeDispatcher;
import org.jboss.managed.api.ManagedComponent;
import org.jboss.managed.api.ManagedOperation;
import org.jboss.managed.api.ManagedProperty;
@@ -42,7 +42,7 @@
*
* @return the runtime component dispatcher
*/
- public abstract RuntimeComponentDispatcher getDispatcher();
+ public abstract ManagedComponentRuntimeDispatcher getDispatcher();
/**
* Create a proxy component.
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-14 14:16:01 UTC (rev 103975)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/util/ManagedObjectRuntimeProcessor.java 2010-04-14 14:52:51 UTC (rev 103976)
@@ -27,7 +27,7 @@
import java.util.Set;
import org.jboss.deployers.spi.management.ContextStateMapper;
-import org.jboss.deployers.spi.management.RuntimeComponentDispatcher;
+import org.jboss.deployers.spi.management.ManagedComponentRuntimeDispatcher;
import org.jboss.logging.Logger;
import org.jboss.managed.api.ManagedComponent;
import org.jboss.managed.api.ManagedDeployment;
@@ -62,7 +62,7 @@
private static final ContextStateMapper<RunState> runStateMapper;
/** The runtime component dispatcher. */
- private final RuntimeComponentDispatcher dispatcher;
+ private final ManagedComponentRuntimeDispatcher dispatcher;
/** The proxy factory. */
private final AbstractManagementProxyFactory proxyFactory;
@@ -237,7 +237,7 @@
try
{
// RuntimeComponentDispatcher.setActiveProperty(prop);
- MetaValue propValue = dispatcher.get(componentName, propName);
+ MetaValue propValue = dispatcher.get(componentName, prop);
if (propValue != null)
prop.setValue(propValue);
}
Modified: projects/profileservice/trunk/plugins/src/test/java/org/jboss/test/profileservice/plugins/deploy/test/AbstractDeployTest.java
===================================================================
--- projects/profileservice/trunk/plugins/src/test/java/org/jboss/test/profileservice/plugins/deploy/test/AbstractDeployTest.java 2010-04-14 14:16:01 UTC (rev 103975)
+++ projects/profileservice/trunk/plugins/src/test/java/org/jboss/test/profileservice/plugins/deploy/test/AbstractDeployTest.java 2010-04-14 14:52:51 UTC (rev 103976)
@@ -29,6 +29,7 @@
import org.jboss.test.profileservice.plugins.deploy.support.DeployHandlerSupport;
import org.jboss.test.profileservice.plugins.deploy.support.ProfileDeployerSupport;
import org.jboss.test.profileservice.plugins.mgt.support.NoopManagementProxyFactory;
+import org.jboss.test.profileservice.plugins.mgt.support.PersistenceRepositorySupport;
/**
* @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
@@ -59,7 +60,7 @@
this.deployHandler = new DeployHandlerSupport();
this.deployHandler.setActionController(actionController);
- this.view = new RegisteredProfileViewsWrapper(actionController);
+ this.view = new RegisteredProfileViewsWrapper(actionController, PersistenceRepositorySupport.INSTANCE);
this.view.setManagementProxyFactory(proxyFactory);
}
Modified: projects/profileservice/trunk/plugins/src/test/java/org/jboss/test/profileservice/plugins/mgt/support/NoopManagementProxyFactory.java
===================================================================
--- projects/profileservice/trunk/plugins/src/test/java/org/jboss/test/profileservice/plugins/mgt/support/NoopManagementProxyFactory.java 2010-04-14 14:16:01 UTC (rev 103975)
+++ projects/profileservice/trunk/plugins/src/test/java/org/jboss/test/profileservice/plugins/mgt/support/NoopManagementProxyFactory.java 2010-04-14 14:52:51 UTC (rev 103976)
@@ -22,7 +22,7 @@
package org.jboss.test.profileservice.plugins.mgt.support;
import org.jboss.deployers.spi.management.ContextStateMapper;
-import org.jboss.deployers.spi.management.RuntimeComponentDispatcher;
+import org.jboss.deployers.spi.management.ManagedComponentRuntimeDispatcher;
import org.jboss.managed.api.ManagedComponent;
import org.jboss.managed.api.ManagedOperation;
import org.jboss.managed.api.ManagedProperty;
@@ -37,7 +37,7 @@
{
/** The noop component dispatcher. */
- private static final RuntimeComponentDispatcher dispatcher = new NoopRuntimeComponentDispatcher();
+ private static final ManagedComponentRuntimeDispatcher dispatcher = new NoopRuntimeComponentDispatcher();
@Override
protected ManagedComponent createComponentProxy(ManagedComponent delegate, Object componentName)
@@ -58,39 +58,38 @@
}
@Override
- public RuntimeComponentDispatcher getDispatcher()
+ public ManagedComponentRuntimeDispatcher getDispatcher()
{
return dispatcher;
}
- static class NoopRuntimeComponentDispatcher implements RuntimeComponentDispatcher
+ static class NoopRuntimeComponentDispatcher implements ManagedComponentRuntimeDispatcher
{
- @Override
- public MetaValue get(Object componentName, String propertyName)
+ public MetaValue get(Object componentName, ManagedProperty property)
{
// FIXME get
return null;
}
- @Override
- public Object invoke(Object componentName, String methodName, MetaValue... param)
+ public MetaValue invoke(Object componentName, ManagedOperation operation, MetaValue... param)
{
+ // FIXME invoke
return null;
}
- @Override
public <T extends Enum<?>> T mapControllerState(Object name, ContextStateMapper<T> mapper)
{
- return mapper.getErrorState();
+ // FIXME mapControllerState
+ return null;
}
- @Override
- public void set(Object componentName, String propertyName, MetaValue value)
+ public void set(Object componentName, ManagedProperty property, MetaValue value)
{
// FIXME set
}
+
}
Added: projects/profileservice/trunk/plugins/src/test/java/org/jboss/test/profileservice/plugins/mgt/support/PersistenceRepositorySupport.java
===================================================================
--- projects/profileservice/trunk/plugins/src/test/java/org/jboss/test/profileservice/plugins/mgt/support/PersistenceRepositorySupport.java (rev 0)
+++ projects/profileservice/trunk/plugins/src/test/java/org/jboss/test/profileservice/plugins/mgt/support/PersistenceRepositorySupport.java 2010-04-14 14:52:51 UTC (rev 103976)
@@ -0,0 +1,78 @@
+/*
+* 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.test.profileservice.plugins.mgt.support;
+
+import org.jboss.managed.api.ManagedComponent;
+import org.jboss.profileservice.persistence.PersistenceFactory;
+import org.jboss.profileservice.persistence.repository.PersistenceRepository;
+import org.jboss.profileservice.persistence.repository.metadata.AttachmentMetaData;
+import org.jboss.profileservice.persistence.repository.metadata.RepositoryAttachmentMetaData;
+import org.jboss.profileservice.persistence.xml.PersistenceRoot;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class PersistenceRepositorySupport implements PersistenceRepository
+{
+
+ public static final PersistenceRepository INSTANCE = new PersistenceRepositorySupport();
+
+ public PersistenceFactory getPersistenceFactory()
+ {
+ // FIXME getPersistenceFactory
+ return null;
+ }
+
+ public boolean isSupportPersistence(ManagedComponent comp)
+ {
+ // FIXME isSupportPersistence
+ return false;
+ }
+
+ public PersistenceRoot loadAttachment(String deploymentName, String simpleName, AttachmentMetaData attachment)
+ throws Exception
+ {
+ // FIXME loadAttachment
+ return null;
+ }
+
+ public RepositoryAttachmentMetaData loadMetaData(String deploymentName, String simpleName) throws Exception
+ {
+ // FIXME loadMetaData
+ return null;
+ }
+
+ public void removeComponent(String ctx, ManagedComponent comp) throws Exception
+ {
+ // FIXME removeComponent
+
+ }
+
+ public void updateDeployment(String ctx, ManagedComponent comp) throws Exception
+ {
+ // FIXME updateDeployment
+
+ }
+
+}
+
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-14 14:16:01 UTC (rev 103975)
+++ projects/profileservice/trunk/plugins/src/test/java/org/jboss/test/profileservice/plugins/mgt/test/RegisteredProfileUnitTestCase.java 2010-04-14 14:52:51 UTC (rev 103976)
@@ -30,6 +30,7 @@
import org.jboss.test.profileservice.plugins.deploy.support.ManagedProfileSupport;
import org.jboss.test.profileservice.plugins.deploy.support.ProfileDeployerSupport;
import org.jboss.test.profileservice.plugins.mgt.support.NoopManagementProxyFactory;
+import org.jboss.test.profileservice.plugins.mgt.support.PersistenceRepositorySupport;
import org.jboss.test.profileservice.plugins.mgt.support.RegisteredProfileSupport;
/**
@@ -52,7 +53,7 @@
{
super.setUp();
this.actionController = new AbstractActionController();
- this.views = new RegisteredProfileViewsWrapper(actionController);
+ this.views = new RegisteredProfileViewsWrapper(actionController, PersistenceRepositorySupport.INSTANCE);
this.deployer = new ProfileDeployerSupport();
this.views.setManagementProxyFactory(new NoopManagementProxyFactory());
}
Added: projects/profileservice/trunk/spi/src/main/java/org/jboss/deployers/spi/management/ManagedComponentRuntimeDispatcher.java
===================================================================
--- projects/profileservice/trunk/spi/src/main/java/org/jboss/deployers/spi/management/ManagedComponentRuntimeDispatcher.java (rev 0)
+++ projects/profileservice/trunk/spi/src/main/java/org/jboss/deployers/spi/management/ManagedComponentRuntimeDispatcher.java 2010-04-14 14:52:51 UTC (rev 103976)
@@ -0,0 +1,78 @@
+/*
+* 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.deployers.spi.management;
+
+import org.jboss.managed.api.ManagedOperation;
+import org.jboss.managed.api.ManagedProperty;
+import org.jboss.metatype.api.values.MetaValue;
+
+/**
+ * {@code ManagedComponent} runtime dispatcher, dispatching runtime invocations
+ * to runtime components.
+ *
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+// TODO change componentName to ManagedComponent/Object ?
+public interface ManagedComponentRuntimeDispatcher
+{
+
+ /**
+ * Get a runtime value.
+ *
+ * @param componentName the runtime component name
+ * @param property the managed property
+ * @return the meta value
+ */
+ MetaValue get(Object componentName, ManagedProperty property);
+
+ /**
+ * Set a runtime value.
+ *
+ * @param componentName the runtime component name
+ * @param property the managed property
+ * @param value the meta value
+ */
+ void set(Object componentName, ManagedProperty property, MetaValue value);
+
+ /**
+ * Invoke a managed operation on a runtime {@code ManagedObject}.
+ *
+ * @param componentName the runtime component name
+ * @param operation the managed operation
+ * @param param the operation parameters
+ * @return the invocation's mapped return value
+ */
+ MetaValue invoke(Object componentName, ManagedOperation operation, MetaValue... param);
+
+ /**
+ * Map the state of the component.
+ *
+ * @param <T> the state enum
+ * @param name the component name
+ * @param mapper the state mapper
+ * @return the mapped state
+ */
+ <T extends Enum<?>> T mapControllerState(Object name, ContextStateMapper<T> mapper);
+
+}
+
Deleted: projects/profileservice/trunk/spi/src/main/java/org/jboss/deployers/spi/management/RuntimeComponentDispatcher.java
===================================================================
--- projects/profileservice/trunk/spi/src/main/java/org/jboss/deployers/spi/management/RuntimeComponentDispatcher.java 2010-04-14 14:16:01 UTC (rev 103975)
+++ projects/profileservice/trunk/spi/src/main/java/org/jboss/deployers/spi/management/RuntimeComponentDispatcher.java 2010-04-14 14:52:51 UTC (rev 103976)
@@ -1,74 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.deployers.spi.management;
-
-import org.jboss.metatype.api.values.MetaValue;
-
-/**
- * Dispatches ManagedOperation invocation to runtime component
- * associated with attachment.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- * @version $Revision$
- */
-public interface RuntimeComponentDispatcher
-{
- /**
- * Get value.
- *
- * @param componentName the runtime component name
- * @param propertyName the property name
- * @return the return meta value
- */
- MetaValue get(Object componentName, String propertyName);
-
- /**
- * Set the value.
- *
- * @param componentName the runtime component name
- * @param propertyName the property name
- * @param value the meta value
- */
- void set(Object componentName, String propertyName, MetaValue value);
-
- /**
- * Dispatch ManagedOperation invocation
- * with param parameters to coresponding attachment.
- *
- * @param componentName the runtime component name
- * @param methodName the methodName
- * @param param the parameters
- * @return runtime component's return value
- */
- Object invoke(Object componentName, String methodName, MetaValue... param);
-
- /**
- * Map the state of the component.
- *
- * @param <T> the state enum
- * @param name the component name
- * @param mapper the state mapper
- * @return the mapped state
- */
- <T extends Enum<?>> T mapControllerState(Object name, ContextStateMapper<T> mapper);
-
-}
More information about the jboss-cvs-commits
mailing list