[jboss-cvs] JBossAS SVN: r96958 - in projects/profileservice/trunk: core and 28 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Nov 25 10:16:32 EST 2009
Author: emuckenhuber
Date: 2009-11-25 10:16:31 -0500 (Wed, 25 Nov 2009)
New Revision: 96958
Added:
projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/package-info.java
projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/spi/
projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/spi/DomainMetaDataRepository.java
projects/profileservice/trunk/domain/src/test/java/org/
projects/profileservice/trunk/domain/src/test/java/org/jboss/
projects/profileservice/trunk/domain/src/test/java/org/jboss/test/
projects/profileservice/trunk/domain/src/test/java/org/jboss/test/profileservice/
projects/profileservice/trunk/domain/src/test/java/org/jboss/test/profileservice/domain/
projects/profileservice/trunk/domain/src/test/java/org/jboss/test/profileservice/domain/parsing/
projects/profileservice/trunk/domain/src/test/java/org/jboss/test/profileservice/domain/parsing/test/
projects/profileservice/trunk/domain/src/test/resources/parsing/
projects/profileservice/trunk/domain/src/test/resources/parsing/domain.xml
projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/ManagementViewWrapper.java
projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/PlatformMBeanView.java
projects/profileservice/trunk/sandbox/src/main/java/org/jboss/profileservice/
projects/profileservice/trunk/sandbox/src/main/java/org/jboss/profileservice/sandbox/
projects/profileservice/trunk/sandbox/src/test/java/org/
projects/profileservice/trunk/sandbox/src/test/java/org/jboss/
projects/profileservice/trunk/sandbox/src/test/java/org/jboss/sandbox/
projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ProfileModificationType.java
Removed:
projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/DelegatingArtifactRepository.java
Modified:
projects/profileservice/trunk/core/pom.xml
projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/virtual/VirtualDeploymentRepository.java
projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/virtual/assembly/AbstractVirtualDeploymentAssembly.java
projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/repository/test/ArtifactRepositoryUnitTestCase.java
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/virtual/test/AbstractVirtualAssemblyTestCase.java
projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/virtual/test/StructureMetaDataUnitTestCase.java
projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/virtual/test/VirtualDeploymentAssemblyUnitTestCase.java
projects/profileservice/trunk/domain/pom.xml
projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/ManagedObjectRecreationHelper.java
projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/AggregatingLocalManagementView.java
projects/profileservice/trunk/pom.xml
projects/profileservice/trunk/sandbox/pom.xml
projects/profileservice/trunk/spi/pom.xml
projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ProfileModificationContext.java
Log:
remove the delegating repository configuration.
Modified: projects/profileservice/trunk/core/pom.xml
===================================================================
--- projects/profileservice/trunk/core/pom.xml 2009-11-25 15:16:26 UTC (rev 96957)
+++ projects/profileservice/trunk/core/pom.xml 2009-11-25 15:16:31 UTC (rev 96958)
@@ -23,13 +23,13 @@
</dependency>
<dependency>
- <groupId>org.jboss.microcontainer</groupId>
+ <groupId>org.jboss.kernel</groupId>
<artifactId>jboss-dependency</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.jboss.microcontainer</groupId>
+ <groupId>org.jboss.kernel</groupId>
<artifactId>jboss-kernel</artifactId>
<scope>provided</scope>
</dependency>
Deleted: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/DelegatingArtifactRepository.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/DelegatingArtifactRepository.java 2009-11-25 15:16:26 UTC (rev 96957)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/artifact/DelegatingArtifactRepository.java 2009-11-25 15:16:31 UTC (rev 96958)
@@ -1,149 +0,0 @@
-/*
-* 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.repository.artifact;
-
-import java.io.IOException;
-import java.net.URI;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.jboss.profileservice.spi.repository.Artifact;
-import org.jboss.profileservice.spi.repository.ArtifactId;
-import org.jboss.profileservice.spi.repository.ArtifactRepository;
-import org.jboss.profileservice.spi.repository.ArtifactRepositoryConfiguration;
-import org.jboss.virtual.VirtualFile;
-
-/**
- * Delegating artifact repository
- *
- * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-public class DelegatingArtifactRepository implements ArtifactRepository<ArtifactId>
-{
-
- /** The instance. */
- private static final DelegatingArtifactRepository instance = new DelegatingArtifactRepository();
-
- /** The configuration. */
- private final ArtifactRepositoryConfiguration configuration;
-
- /** The repositories. */
- private Map<String, ArtifactRepository<ArtifactId>> repositories = new ConcurrentHashMap<String, ArtifactRepository<ArtifactId>>();
-
- public static DelegatingArtifactRepository getInstance()
- {
- return instance;
- }
-
- private DelegatingArtifactRepository()
- {
- this.configuration = new DelegatingRepositoryConfiguraiton();
- }
-
- public ArtifactRepositoryConfiguration getConfiguration()
- {
- return this.configuration;
- }
-
- @Override
- public Collection<Artifact<ArtifactId>> getArtifacts()
- {
- // FIXME getArtifacts
- return Collections.emptySet();
- }
-
- @Override
- public boolean isMutable()
- {
- return false;
- }
-
- @Override
- public boolean containsArtifact(ArtifactId artifact)
- {
- return getRepository(artifact).containsArtifact(artifact);
- }
-
- public Artifact<ArtifactId> getArtifact(ArtifactId artifactId)
- {
- return getRepository(artifactId).getArtifact(artifactId);
- }
-
- @Override
- public VirtualFile getArtifactFile(ArtifactId artifact) throws IOException
- {
- return getRepository(artifact).getArtifactFile(artifact);
- }
-
- public ArtifactRepository<ArtifactId> getRepository(ArtifactId artifact)
- {
- ArtifactRepository<ArtifactId> repository = this.repositories.get(artifact.getType());
- if(repository == null)
- {
- throw new IllegalStateException("failed to find repository for artifact " + artifact);
- }
- return repository;
- }
-
- public void addRepository( ArtifactRepository<ArtifactId> repository)
- {
- if(repository == null)
- throw new IllegalArgumentException("null repository");
- if(repository.getConfiguration() == null)
- throw new IllegalArgumentException("null repository configuration");
- if(repository.getConfiguration().getType() == null)
- throw new IllegalArgumentException("null repository configuration type");
- this.repositories.put(repository.getConfiguration().getType(), repository);
- }
-
- public void addRepository(String type, ArtifactRepository<ArtifactId> repository)
- {
- this.repositories.put(type, repository);
- }
-
- static class DelegatingRepositoryConfiguraiton implements ArtifactRepositoryConfiguration
- {
- @Override
- public URI getLocation()
- {
- // FIXME
- return null;
- }
-
- @Override
- public String getType()
- {
- return DelegatingArtifactRepository.class.getName();
- }
-
- @Override
- public boolean isMutable()
- {
- return false;
- }
- }
-
-}
-
Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/virtual/VirtualDeploymentRepository.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/virtual/VirtualDeploymentRepository.java 2009-11-25 15:16:26 UTC (rev 96957)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/repository/virtual/VirtualDeploymentRepository.java 2009-11-25 15:16:31 UTC (rev 96958)
@@ -21,8 +21,11 @@
*/
package org.jboss.profileservice.repository.virtual;
+import java.io.IOException;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
import org.jboss.profileservice.repository.BasicProfileDeployment;
-import org.jboss.profileservice.repository.artifact.DelegatingArtifactRepository;
import org.jboss.profileservice.spi.ProfileDeployment;
import org.jboss.profileservice.spi.repository.ArtifactId;
import org.jboss.profileservice.spi.repository.ArtifactRepository;
@@ -39,21 +42,23 @@
public class VirtualDeploymentRepository extends AbstractVirtualDeploymentAssembly
{
- public VirtualDeploymentRepository()
- {
- super(DelegatingArtifactRepository.getInstance());
- }
+ /** The repositories. */
+ private Map<String, ArtifactRepository<ArtifactId>> repositories = new ConcurrentHashMap<String, ArtifactRepository<ArtifactId>>();
- public VirtualDeploymentRepository(ArtifactRepository<ArtifactId> artifactRepository)
- {
- super(artifactRepository);
- }
-
+ /**
+ * Create a ProfileDeployment.
+ * TODO - ProfileDeployment should maybe be a virtual deployment?
+ *
+ * @param deployment the virtual deployment descriptor
+ * @return the profile deployment
+ * @throws Exception for any error
+ */
public ProfileDeployment createDeployment(VirtualDeployment deployment) throws Exception
{
if(deployment == null)
+ {
throw new IllegalArgumentException("null virtual deployment");
-
+ }
// Assemble the virtual deployment
VirtualDeploymentAssemblyContext ctx = assemble(deployment);
VirtualFile vf = ctx.getRoot();
@@ -63,6 +68,61 @@
}
return new BasicProfileDeployment(vf, ctx);
}
+
+ @Override
+ public VirtualFile getVirtualFile(ArtifactId artifact) throws IOException
+ {
+ return getRepository(artifact).getArtifactFile(artifact);
+ }
+ /**
+ * Resolve the artifact repository
+ *
+ * @param artifact the artifact id
+ * @return the artifact repository
+ * @throws IllegalStateException if there is no associated artifact repository
+ */
+ public ArtifactRepository<ArtifactId> getRepository(ArtifactId artifact)
+ {
+ ArtifactRepository<ArtifactId> repository = this.repositories.get(artifact.getType());
+ if(repository == null)
+ {
+ throw new IllegalStateException("failed to find repository for artifact " + artifact);
+ }
+ return repository;
+ }
+
+ public void addRepository(ArtifactRepository<ArtifactId> repository)
+ {
+ if(repository == null)
+ throw new IllegalArgumentException("null repository");
+ if(repository.getConfiguration() == null)
+ throw new IllegalArgumentException("null repository configuration");
+ if(repository.getConfiguration().getType() == null)
+ throw new IllegalArgumentException("null repository configuration type");
+ addRepository(repository.getConfiguration().getType(), repository);
+ }
+
+ public void addRepository(String type, ArtifactRepository<ArtifactId> repository)
+ {
+ this.repositories.put(type, repository);
+ }
+
+ public void removeRepository(ArtifactRepository<ArtifactId> repository)
+ {
+ if(repository == null)
+ throw new IllegalArgumentException("null repository");
+ if(repository.getConfiguration() == null)
+ throw new IllegalArgumentException("null repository configuration");
+ if(repository.getConfiguration().getType() == null)
+ throw new IllegalArgumentException("null repository configuration type");
+ removeRepository(repository.getConfiguration().getType());
+ }
+
+ public void removeRepository(String type)
+ {
+ this.repositories.remove(type);
+ }
+
}
Modified: projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/virtual/assembly/AbstractVirtualDeploymentAssembly.java
===================================================================
--- projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/virtual/assembly/AbstractVirtualDeploymentAssembly.java 2009-11-25 15:16:26 UTC (rev 96957)
+++ projects/profileservice/trunk/core/src/main/java/org/jboss/profileservice/virtual/assembly/AbstractVirtualDeploymentAssembly.java 2009-11-25 15:16:31 UTC (rev 96958)
@@ -25,7 +25,6 @@
import java.net.URL;
import org.jboss.profileservice.spi.repository.ArtifactId;
-import org.jboss.profileservice.spi.repository.ArtifactRepository;
import org.jboss.profileservice.spi.virtual.VirtualArtifactMetaData;
import org.jboss.profileservice.spi.virtual.VirtualDeployment;
import org.jboss.profileservice.spi.virtual.assembly.VirtualDeploymentAssemblyContext;
@@ -42,24 +41,21 @@
* @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
* @version $Revision$
*/
-public class AbstractVirtualDeploymentAssembly
+public abstract class AbstractVirtualDeploymentAssembly
{
/** The assembled context factory. */
private final AssembledContextFactory assemblyFactory = AssembledContextFactory.getInstance();
- /** The artifact repository. */
- private final ArtifactRepository<ArtifactId> repository;
+ /**
+ * Get the virtual file for an artifact.
+ *
+ * @param artifact the artifact id
+ * @return the file
+ * @throws IOException
+ */
+ public abstract VirtualFile getVirtualFile(ArtifactId artifact) throws IOException;
- public AbstractVirtualDeploymentAssembly(ArtifactRepository<ArtifactId> repository)
- {
- if(repository == null)
- {
- throw new IllegalArgumentException("null artifact repository");
- }
- this.repository = repository;
- }
-
/**
* Assemble a virtual deployment.
*
@@ -198,12 +194,7 @@
}
return null;
}
-
- public VirtualFile getVirtualFile(ArtifactId artifact) throws IOException
- {
- return repository.getArtifactFile(artifact);
- }
-
+
/**
* Get a VirtualFile root.
*
Modified: projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/repository/test/ArtifactRepositoryUnitTestCase.java
===================================================================
--- projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/repository/test/ArtifactRepositoryUnitTestCase.java 2009-11-25 15:16:26 UTC (rev 96957)
+++ projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/repository/test/ArtifactRepositoryUnitTestCase.java 2009-11-25 15:16:31 UTC (rev 96958)
@@ -25,8 +25,6 @@
import java.io.InputStream;
import org.jboss.profileservice.profile.metadata.ProfilesMetaData;
-import org.jboss.profileservice.repository.ProfileDeploymentFactory;
-import org.jboss.profileservice.repository.artifact.DelegatingArtifactRepository;
import org.jboss.profileservice.repository.artifact.file.FileArtifactId;
import org.jboss.profileservice.repository.artifact.file.LocalFileArtifactRepository;
import org.jboss.profileservice.repository.artifact.maven.LocalMavenArtifactRepository;
@@ -58,10 +56,9 @@
//
MavenArtifactRepositoryMetaData metaData = unmarshal(getIS("repository/artifacts.xml"), MavenArtifactRepositoryMetaData.class);
ProfilesMetaData profiles = unmarshal(getIS("repository/profiles.xml"), ProfilesMetaData.class);
- createRepository(metaData);
//
- VirtualDeploymentRepository factory = new VirtualDeploymentRepository();
+ VirtualDeploymentRepository factory = createRepository(metaData);
for(ProfileMetaData md : profiles.getProfiles())
{
for(ProfileDeploymentMetaData deployment : md.getDeployments())
@@ -73,9 +70,9 @@
}
}
- protected DelegatingArtifactRepository createRepository(MavenArtifactRepositoryMetaData metaData) throws Exception
+ protected VirtualDeploymentRepository createRepository(MavenArtifactRepositoryMetaData metaData) throws Exception
{
- DelegatingArtifactRepository repository = DelegatingArtifactRepository.getInstance();
+ VirtualDeploymentRepository repository = new VirtualDeploymentRepository();
repository.addRepository(FileArtifactId.TYPE, (ArtifactRepository) new LocalFileArtifactRepository(getResource("repository/static").toURI()));
repository.addRepository(MavenArtifactId.TYPE, (ArtifactRepository) new LocalMavenArtifactRepository(metaData, getResource("repository").toURI()));
return repository;
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 2009-11-25 15:16:26 UTC (rev 96957)
+++ projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/test/BasicProfileServiceUnitTestCase.java 2009-11-25 15:16:31 UTC (rev 96958)
@@ -77,7 +77,7 @@
}
// Check the profile.xml
assertNotNull(getBean("Basic Profile Factory", BasicProfileFactory.class));
-
+
//
// for(ProfileKey key : ps.getActiveProfileKeys())
// {
Modified: projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/virtual/test/AbstractVirtualAssemblyTestCase.java
===================================================================
--- projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/virtual/test/AbstractVirtualAssemblyTestCase.java 2009-11-25 15:16:26 UTC (rev 96957)
+++ projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/virtual/test/AbstractVirtualAssemblyTestCase.java 2009-11-25 15:16:31 UTC (rev 96958)
@@ -26,6 +26,7 @@
import java.util.Map;
import org.jboss.profileservice.repository.artifact.file.LocalFileArtifactRepository;
+import org.jboss.profileservice.repository.virtual.VirtualDeploymentRepository;
import org.jboss.profileservice.spi.repository.ArtifactId;
import org.jboss.profileservice.spi.repository.ArtifactRepository;
import org.jboss.profileservice.spi.virtual.VirtualDeployment;
@@ -48,8 +49,15 @@
super(name);
}
- protected ArtifactRepository<ArtifactId> createArtifactRepository(String name) throws Exception
+ protected VirtualDeploymentRepository createRepository(String name) throws Exception
{
+ VirtualDeploymentRepository repository = new VirtualDeploymentRepository();
+ repository.addRepository(createLocalFileArtifactRepo(name));
+ return repository;
+ }
+
+ protected ArtifactRepository<ArtifactId> createLocalFileArtifactRepo(String name) throws Exception
+ {
URL rootURL = getResource(name);
return (ArtifactRepository) new LocalFileArtifactRepository(rootURL.toURI());
}
Modified: projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/virtual/test/StructureMetaDataUnitTestCase.java
===================================================================
--- projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/virtual/test/StructureMetaDataUnitTestCase.java 2009-11-25 15:16:26 UTC (rev 96957)
+++ projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/virtual/test/StructureMetaDataUnitTestCase.java 2009-11-25 15:16:31 UTC (rev 96958)
@@ -62,7 +62,7 @@
VirtualRepositoryMetaData repository = unmarshal("repository.xml", VirtualRepositoryMetaData.class);
Map<String, VirtualDeployment> deployments = mapDeployments(repository);
- this.profileDeploymentFactory = new VirtualDeploymentRepository(createArtifactRepository(REPOSITORY_LOCATION));
+ this.profileDeploymentFactory = createRepository(REPOSITORY_LOCATION);
for(VirtualDeployment d : repository.getDeployments())
{
ProfileDeployment pd = profileDeploymentFactory.createDeployment(d);
Modified: projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/virtual/test/VirtualDeploymentAssemblyUnitTestCase.java
===================================================================
--- projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/virtual/test/VirtualDeploymentAssemblyUnitTestCase.java 2009-11-25 15:16:26 UTC (rev 96957)
+++ projects/profileservice/trunk/core/src/test/java/org/jboss/test/profileservice/virtual/test/VirtualDeploymentAssemblyUnitTestCase.java 2009-11-25 15:16:31 UTC (rev 96958)
@@ -57,7 +57,7 @@
Map<String, VirtualDeployment> deployments = mapDeployments(repositoryMetaData);
// Get the VirtualDeploymentRepository
- VirtualDeploymentRepository factory = new VirtualDeploymentRepository(createArtifactRepository(REPOSITORY_LOCATION));
+ VirtualDeploymentRepository factory = createRepository(REPOSITORY_LOCATION);
// Test simple.deployer
AbstractVirtualDeployment simpleVD = (AbstractVirtualDeployment) deployments.get("simple.deployer");
Modified: projects/profileservice/trunk/domain/pom.xml
===================================================================
--- projects/profileservice/trunk/domain/pom.xml 2009-11-25 15:16:26 UTC (rev 96957)
+++ projects/profileservice/trunk/domain/pom.xml 2009-11-25 15:16:31 UTC (rev 96958)
@@ -16,9 +16,9 @@
<dependencies>
<dependency>
- <groupId>org.jboss.microcontainer</groupId>
+ <groupId>org.jboss.kernel</groupId>
<artifactId>jboss-kernel</artifactId>
- <version>${version.org.jboss.microcontainer}</version>
+ <version>${version.org.jboss.kernel}</version>
<scope>provided</scope>
</dependency>
Added: projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/package-info.java
===================================================================
--- projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/package-info.java (rev 0)
+++ projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/package-info.java 2009-11-25 15:16:31 UTC (rev 96958)
@@ -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:jboss:profileservice:domain:1.0",
+ elementFormDefault = XmlNsForm.QUALIFIED,
+ xmlns = { @XmlNs(namespaceURI = "http://www.w3.org/2001/XMLSchema", prefix = "xs") }
+)
+package org.jboss.profileservice.domain;
+
+import javax.xml.bind.annotation.XmlNs;
+import javax.xml.bind.annotation.XmlNsForm;
+import javax.xml.bind.annotation.XmlSchema;
+
Added: projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/spi/DomainMetaDataRepository.java
===================================================================
--- projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/spi/DomainMetaDataRepository.java (rev 0)
+++ projects/profileservice/trunk/domain/src/main/java/org/jboss/profileservice/domain/spi/DomainMetaDataRepository.java 2009-11-25 15:16:31 UTC (rev 96958)
@@ -0,0 +1,43 @@
+/*
+* 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.domain.spi;
+
+import org.jboss.profileservice.domain.DomainMetaData;
+
+/**
+ * The local domain meta data repository.
+ *
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public interface DomainMetaDataRepository
+{
+
+ /**
+ * Get the domain meta data.
+ *
+ * @return the domain meta data
+ */
+ DomainMetaData getDomainMetaData();
+
+}
+
Added: projects/profileservice/trunk/domain/src/test/resources/parsing/domain.xml
===================================================================
--- projects/profileservice/trunk/domain/src/test/resources/parsing/domain.xml (rev 0)
+++ projects/profileservice/trunk/domain/src/test/resources/parsing/domain.xml 2009-11-25 15:16:31 UTC (rev 96958)
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ The JBoss ApplicationServer domain configuration file.
+ This configuration is shared across
+ -->
+<domain xmlns="urn:jboss:profileservice:domain:1.0"
+ xmlns:xi="http://www.w3.org/2001/XInclude">
+
+ <management-domain name="domain1" connect-to-domain="true" />
+ <jboss-server name="server1">
+ <system>
+ <properties>
+ <property />
+ <property />
+ </properties>
+ <!-- Enable EAR classloader isolation. -->
+ <ear-classloader-isolation>true</ear-classloader-isolation>
+ <!-- The graceful shutdown configuration -->
+ <shutdown>
+ <graceful-timeout>3600000</graceful-timeout>
+ </shutdown>
+ </system>
+ </jboss-server>
+
+ <thread-pools>
+ <thread-pool name="JBossDefaultThreadPool" />
+ </thread-pools>
+
+ <xi:include href="resources.xml"/>
+
+ <!-- The jboss.web server configuration -->
+ <web-server thread-pool="JBossDefaultThreadPool">
+ <!-- HTTP/1.1 connector -->
+ <connector protocol="HTTP/1.1" port="8080" address="${jboss.bind.address}"
+ connectionTimeout="20000" redirectPort="8443" />
+ <!-- HTTP/1.1 SSL connector -->
+ <connector protocol="HTTP/1.1" SSLEnabled="true"
+ port="8443" address="${jboss.bind.address}"
+ scheme="https" secure="true" clientAuth="false"
+ keystoreFile="${jboss.server.home.dir}/conf/chap8.keystore"
+ keystorePass="rmi+ssl" sslProtocol = "TLS" />
+ </web-server>
+
+</domain>
\ No newline at end of file
Modified: projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/ManagedObjectRecreationHelper.java
===================================================================
--- projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/ManagedObjectRecreationHelper.java 2009-11-25 15:16:26 UTC (rev 96957)
+++ projects/profileservice/trunk/persistence/src/main/java/org/jboss/profileservice/persistence/ManagedObjectRecreationHelper.java 2009-11-25 15:16:31 UTC (rev 96958)
@@ -111,7 +111,7 @@
{
private SecurityActions() {}
- public static ClassLoader getContextClassLoader()
+ static ClassLoader getContextClassLoader()
{
if (System.getSecurityManager() == null)
{
Modified: projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/AggregatingLocalManagementView.java
===================================================================
--- projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/AggregatingLocalManagementView.java 2009-11-25 15:16:26 UTC (rev 96957)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/AggregatingLocalManagementView.java 2009-11-25 15:16:31 UTC (rev 96958)
@@ -36,7 +36,7 @@
* @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
* @version $Revision$
*/
-public class AggregatingLocalManagementView
+class AggregatingLocalManagementView
{
/** The profile views. */
@@ -45,6 +45,11 @@
/** The views by key. */
private Map<ProfileKey, ProfileViewWrapper> viewsByKey = new ConcurrentHashMap<ProfileKey, ProfileViewWrapper>();
+ protected AggregatingLocalManagementView()
+ {
+ //
+ }
+
public void load()
{
for(ProfileViewWrapper view : views)
Added: projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/ManagementViewWrapper.java
===================================================================
--- projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/ManagementViewWrapper.java (rev 0)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/ManagementViewWrapper.java 2009-11-25 15:16:31 UTC (rev 96958)
@@ -0,0 +1,186 @@
+/*
+* 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.plugins.management;
+
+import java.util.Set;
+
+import org.jboss.deployers.spi.management.ManagementView;
+import org.jboss.deployers.spi.management.NameMatcher;
+import org.jboss.managed.api.ComponentType;
+import org.jboss.managed.api.DeploymentTemplateInfo;
+import org.jboss.managed.api.ManagedComponent;
+import org.jboss.managed.api.ManagedDeployment;
+import org.jboss.profileservice.spi.NoSuchDeploymentException;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class ManagementViewWrapper implements ManagementView
+{
+
+ /** The mgtView runtime permission. */
+ private static RuntimePermission MV_RUNTIME_PERMISSION = new RuntimePermission(ManagementView.class.getName());
+
+ /** The delegate. */
+ private final ManagementView delegate;
+
+ public ManagementViewWrapper(ManagementView view)
+ {
+ if(view == null)
+ {
+ throw new IllegalArgumentException("null delegate view");
+ }
+ this.delegate = view;
+ }
+
+ @Override
+ public void applyTemplate(String deploymentBaseName, DeploymentTemplateInfo info) throws Exception
+ {
+ getDelegateView().applyTemplate(deploymentBaseName, info);
+ }
+
+ @Override
+ public ManagedComponent getComponent(String name, ComponentType type) throws Exception
+ {
+ return getDelegateView().getComponent(name, type);
+ }
+
+ @Override
+ public Set<ComponentType> getComponentTypes()
+ {
+ return getDelegateView().getComponentTypes();
+ }
+
+ @Override
+ public Set<ManagedComponent> getComponentsForType(ComponentType type) throws Exception
+ {
+ return getDelegateView().getComponentsForType(type);
+ }
+
+ @Override
+ public ManagedDeployment getDeployment(String name) throws NoSuchDeploymentException
+ {
+ return getDelegateView().getDeployment(name);
+ }
+
+ @Override
+ public Set<String> getDeploymentNames()
+ {
+ return getDelegateView().getDeploymentNames();
+ }
+
+ @Override
+ public Set<String> getDeploymentNamesForType(String type)
+ {
+ return getDelegateView().getDeploymentNamesForType(type);
+ }
+
+ @Override
+ public Set<ManagedDeployment> getDeploymentsForType(String type) throws Exception
+ {
+ return getDelegateView().getDeploymentsForType(type);
+ }
+
+ @Override
+ public Set<ManagedComponent> getMatchingComponents(String name, ComponentType type,
+ NameMatcher<ManagedComponent> matcher) throws Exception
+ {
+ return getDelegateView().getMatchingComponents(name, type, matcher);
+ }
+
+ @Override
+ public Set<String> getMatchingDeploymentName(String regex) throws NoSuchDeploymentException
+ {
+ return getDelegateView().getMatchingDeploymentName(regex);
+ }
+
+ @Override
+ public Set<ManagedDeployment> getMatchingDeployments(String name, NameMatcher<ManagedDeployment> matcher)
+ throws NoSuchDeploymentException, Exception
+ {
+ return getDelegateView().getMatchingDeployments(name, matcher);
+ }
+
+ @Override
+ public DeploymentTemplateInfo getTemplate(String name) throws NoSuchDeploymentException
+ {
+ return getDelegateView().getTemplate(name);
+ }
+
+ @Override
+ public Set<String> getTemplateNames()
+ {
+ return getDelegateView().getTemplateNames();
+ }
+
+ @Override
+ public boolean load()
+ {
+ return getDelegateView().load();
+ }
+
+ @Override
+ public void process() throws Exception
+ {
+ getDelegateView().process();
+ }
+
+ @Override
+ public void reload()
+ {
+ getDelegateView().reload();
+ }
+
+ @Override
+ public void removeComponent(ManagedComponent comp) throws Exception
+ {
+ getDelegateView().removeComponent(comp);
+ }
+
+ @Override
+ public void updateComponent(ManagedComponent comp) throws Exception
+ {
+ getDelegateView().updateComponent(comp);
+ }
+
+ ManagementView getDelegateView()
+ {
+ checkPermission();
+ if(this.delegate == null)
+ {
+ throw new IllegalStateException("null delegate view");
+ }
+ return this.delegate;
+ }
+
+ void checkPermission()
+ {
+ SecurityManager sm = System.getSecurityManager();
+ if(sm != null)
+ {
+ sm.checkPermission(MV_RUNTIME_PERMISSION);
+ }
+ }
+
+}
+
Added: projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/PlatformMBeanView.java
===================================================================
--- projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/PlatformMBeanView.java (rev 0)
+++ projects/profileservice/trunk/plugins/src/main/java/org/jboss/profileservice/plugins/management/PlatformMBeanView.java 2009-11-25 15:16:31 UTC (rev 96958)
@@ -0,0 +1,39 @@
+/*
+* 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.plugins.management;
+
+/**
+ * A ProfileView exposing the Platform MBeans as ManagedComponents.
+ *
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class PlatformMBeanView
+{
+
+ public void start()
+ {
+ // ...
+ }
+
+}
+
Modified: projects/profileservice/trunk/pom.xml
===================================================================
--- projects/profileservice/trunk/pom.xml 2009-11-25 15:16:26 UTC (rev 96957)
+++ projects/profileservice/trunk/pom.xml 2009-11-25 15:16:31 UTC (rev 96958)
@@ -47,7 +47,7 @@
<version.org.jboss.jbossxb>2.0.1.GA</version.org.jboss.jbossxb>
<version.org.jboss.logging>2.2.0.CR1</version.org.jboss.logging>
<version.org.jboss.man>2.1.1.GA</version.org.jboss.man>
- <version.org.jboss.microcontainer>2.0.9.GA</version.org.jboss.microcontainer>
+ <version.org.jboss.kernel>2.2.0-SNAPSHOT</version.org.jboss.kernel>
<version.org.jboss.reflect>2.0.2.GA</version.org.jboss.reflect>
<version.jboss.test>1.1.0.GA</version.jboss.test>
<version.org.jboss.vfs>2.1.3.SP1</version.org.jboss.vfs>
@@ -207,15 +207,15 @@
</dependency>
<dependency>
- <groupId>org.jboss.microcontainer</groupId>
+ <groupId>org.jboss.kernel</groupId>
<artifactId>jboss-dependency</artifactId>
- <version>${version.org.jboss.microcontainer}</version>
+ <version>${version.org.jboss.kernel}</version>
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.jboss.microcontainer</groupId>
+ <groupId>org.jboss.kernel</groupId>
<artifactId>jboss-kernel</artifactId>
- <version>${version.org.jboss.microcontainer}</version>
+ <version>${version.org.jboss.kernel}</version>
<scope>provided</scope>
</dependency>
Modified: projects/profileservice/trunk/sandbox/pom.xml
===================================================================
--- projects/profileservice/trunk/sandbox/pom.xml 2009-11-25 15:16:26 UTC (rev 96957)
+++ projects/profileservice/trunk/sandbox/pom.xml 2009-11-25 15:16:31 UTC (rev 96958)
@@ -24,14 +24,19 @@
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-log4j</artifactId>
- <version>2.1.0.GA</version>
</dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-vfs</artifactId>
- <version>${version.org.jboss.deployers}</version>
- </dependency>
+ <dependency>
+ <groupId>org.jboss.kernel</groupId>
+ <artifactId>jboss-dependency</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.kernel</groupId>
+ <artifactId>jboss-kernel</artifactId>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>org.jboss.profileservice</groupId>
Modified: projects/profileservice/trunk/spi/pom.xml
===================================================================
--- projects/profileservice/trunk/spi/pom.xml 2009-11-25 15:16:26 UTC (rev 96957)
+++ projects/profileservice/trunk/spi/pom.xml 2009-11-25 15:16:31 UTC (rev 96958)
@@ -53,7 +53,7 @@
<artifactId>jboss-vfs</artifactId>
</dependency>
<dependency>
- <groupId>org.jboss.microcontainer</groupId>
+ <groupId>org.jboss.kernel</groupId>
<artifactId>jboss-dependency</artifactId>
</dependency>
</dependencies>
Modified: projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ProfileModificationContext.java
===================================================================
--- projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ProfileModificationContext.java 2009-11-25 15:16:26 UTC (rev 96957)
+++ projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ProfileModificationContext.java 2009-11-25 15:16:31 UTC (rev 96958)
@@ -37,5 +37,12 @@
*/
ProfileKey getTargetProfile();
+ /**
+ * Get the type of the action.
+ *
+ * @return the modification type
+ */
+ ProfileModificationType getTYpe();
+
}
Added: projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ProfileModificationType.java
===================================================================
--- projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ProfileModificationType.java (rev 0)
+++ projects/profileservice/trunk/spi/src/main/java/org/jboss/profileservice/spi/action/ProfileModificationType.java 2009-11-25 15:16:31 UTC (rev 96958)
@@ -0,0 +1,43 @@
+/*
+* 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 enum ProfileModificationType
+{
+
+ /** Add content to a profile. */
+ ADD,
+
+ /** Retrieve information from a profile. */
+ GET,
+
+ /** Update existing content in a profile. */
+ UPDATE,
+
+ /** Remove content in a profile. */
+ DELETE
+}
+
More information about the jboss-cvs-commits
mailing list