Author: mstruk
Date: 2012-02-27 06:46:34 -0500 (Mon, 27 Feb 2012)
New Revision: 8472
Added:
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/DeploymentArchiveAdd.java
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/DeploymentArchiveDefinition.java
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInPortalAdd.java
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInPortalDefinition.java
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDefinition.java
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/PortletWarDependancyAdd.java
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/PortletWarDependancyDefinition.java
portal/trunk/packaging/jboss-as7/extension/src/main/resources/schema/jboss-as-gatein-1.0.xsd
Removed:
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDescribe.java
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDescriptionProviders.java
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDescriptions.java
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/SetGateInArchivesHandler.java
portal/trunk/packaging/jboss-as7/extension/src/main/resources/schema/jboss-gatein.xsd
portal/trunk/packaging/jboss-as7/extension/src/test/java/org/gatein/integration/jboss/as7/support/
Modified:
portal/trunk/packaging/jboss-as7/README.txt
portal/trunk/packaging/jboss-as7/extension/pom.xml
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/Attribute.java
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/Constants.java
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInExtension.java
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInExtensionConfiguration.java
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemAdd.java
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemParser.java
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInDependenciesDeploymentProcessor.java
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInInitDeploymentProcessor.java
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInStarterDeploymentProcessor.java
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInStructureDeploymentProcessor.java
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/PortletWarClassloadingDependencyProcessor.java
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/PortletWarDeploymentInitializingProcessor.java
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/WarDependenciesDeploymentProcessor.java
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/web/InitService.java
portal/trunk/packaging/jboss-as7/extension/src/main/resources/org/gatein/integration/jboss/as7/LocalDescriptions.properties
portal/trunk/packaging/jboss-as7/extension/src/test/java/org/gatein/integration/jboss/as7/SubsystemParsingTestCase.java
portal/trunk/packaging/jboss-as7/modules/build.xml
portal/trunk/packaging/jboss-as7/modules/pom.xml
portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/modules/org/jboss/as/web/main/module.xml
portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/configuration/standalone.xml
portal/trunk/packaging/jboss-as7/pom.xml
portal/trunk/packaging/pom.xml
Log:
GTNPORTAL-2154 Support for JBoss AS7
- upgraded supported version to JBoss AS 7.1.0.Final
- some refactoring and dmr model change
Modified: portal/trunk/packaging/jboss-as7/README.txt
===================================================================
--- portal/trunk/packaging/jboss-as7/README.txt 2012-02-27 11:31:11 UTC (rev 8471)
+++ portal/trunk/packaging/jboss-as7/README.txt 2012-02-27 11:46:34 UTC (rev 8472)
@@ -30,15 +30,15 @@
Known Issues
============
-- Only one JBoss AS 7 version is supported at one time. At the moment it's JBoss AS
7.1.0.CR1b.
+- Only one JBoss AS 7 version is supported at one time. At the moment it's JBoss AS
7.1.0.Final.
- WSRP is not yet supported
- <distributable/> is not yet supported
- Sample ears have been repackaged as their current default packaging is not supported
- Exception occurs, and is ignored when logging out (EXOJCR-1619)
+- 'gatein' subsystem configuration in standalone.xml is ignored
-
Building
========
@@ -46,8 +46,8 @@
Checkout the dependencies sources from sandbox:
-svn co
http://anonsvn.jboss.org/repos/gatein/sandbox/as7_support/tags/AS7-Beta02
-cd AS7-Beta02
+svn co
http://anonsvn.jboss.org/repos/gatein/sandbox/as7_support/tags/AS7-Beta03
+cd AS7-Beta03
This will checkout specific versions of wci and exo.kernel.container, and a new
gatein-naming component.
@@ -74,7 +74,7 @@
mvn clean install
-Set CONTAINERS_DIR env variable to point to a directory containing your application
servers (i.e. export CONTAINERS_DIR=$HOME/devel/containers). If you already have
‘jboss-as-7.1.0.CR1b’ in your CONTAINERS_DIR, then remove ‘,download’ from the next
command:
+Set CONTAINERS_DIR env variable to point to a directory containing your application
servers (i.e. export CONTAINERS_DIR=$HOME/devel/containers). If you already have
‘jboss-as-7.1.0.Final’ in your CONTAINERS_DIR, then remove ‘,download’ from the next
command:
cd packaging/jboss-as7
mvn clean install -Ppkg-jbossas7,download
-Dexo.projects.directory.dependencies=$CONTAINERS_DIR
@@ -83,7 +83,7 @@
Now that we successfully built GateIn including JBoss AS7 support, let’s run it:
-cd pkg/target/jboss-as-7.1.0.CR1b/bin
+cd pkg/target/jboss-as-7.1.0.Final/bin
./standalone.sh
Modified: portal/trunk/packaging/jboss-as7/extension/pom.xml
===================================================================
--- portal/trunk/packaging/jboss-as7/extension/pom.xml 2012-02-27 11:31:11 UTC (rev 8471)
+++ portal/trunk/packaging/jboss-as7/extension/pom.xml 2012-02-27 11:46:34 UTC (rev 8472)
@@ -71,20 +71,25 @@
<scope>test</scope>
<version>${version.junit}</version>
</dependency>
+ <dependency>
+ <groupId>org.jboss.as</groupId>
+ <artifactId>jboss-as-subsystem-test</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
<plugins>
- <plugin>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
- <source>1.6</source>
- <target>1.6</target>
- <compilerArgument>-proc:none</compilerArgument>
+ <source>1.6</source>
+ <target>1.6</target>
+ <compilerArgument>-proc:none</compilerArgument>
</configuration>
- </plugin>
+ </plugin>
</plugins>
</build>
</project>
\ No newline at end of file
Modified:
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/Attribute.java
===================================================================
---
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/Attribute.java 2012-02-27
11:31:11 UTC (rev 8471)
+++
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/Attribute.java 2012-02-27
11:46:34 UTC (rev 8472)
@@ -32,7 +32,7 @@
UNKNOWN(null),
NAME("name"),
MAIN("main"),
- IMPORT_SERVICES("import-services");
+ IMPORT_SERVICES(Constants.IMPORT_SERVICES);
private final String name;
Modified:
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/Constants.java
===================================================================
---
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/Constants.java 2012-02-27
11:31:11 UTC (rev 8471)
+++
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/Constants.java 2012-02-27
11:46:34 UTC (rev 8472)
@@ -26,12 +26,17 @@
*/
interface Constants
{
-
+ // xml parser constants
String DEPLOYMENT_ARCHIVES = "deployment-archives";
String PORTLET_WAR_DEPENDENCIES = "portlet-war-dependencies";
String ARCHIVE = "archive";
String DEPENDENCY = "dependency";
String MAIN = "main";
String IMPORT_SERVICES = "import-services";
- String TRUE = "true";
+
+ String PORTAL = "portal";
+
+ // MDR operations constants
+ String DEPLOYMENT_ARCHIVE = "deployment-archive";
+ String PORTLET_WAR_DEPENDENCY = "portlet-war-dependency";
}
Added:
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/DeploymentArchiveAdd.java
===================================================================
---
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/DeploymentArchiveAdd.java
(rev 0)
+++
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/DeploymentArchiveAdd.java 2012-02-27
11:46:34 UTC (rev 8472)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., 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.gatein.integration.jboss.as7;
+
+import org.jboss.as.controller.AbstractAddStepHandler;
+import org.jboss.as.controller.OperationFailedException;
+import org.jboss.dmr.ModelNode;
+
+/**
+ * @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
+ */
+public class DeploymentArchiveAdd extends AbstractAddStepHandler
+{
+ public static final DeploymentArchiveAdd INSTANCE = new DeploymentArchiveAdd();
+
+ private DeploymentArchiveAdd()
+ {
+ }
+
+ @Override
+ protected void populateModel(ModelNode operation, ModelNode model) throws
OperationFailedException
+ {
+ DeploymentArchiveDefinition.MAIN.validateAndSet(operation,model);
+ }
+}
Property changes on:
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/DeploymentArchiveAdd.java
___________________________________________________________________
Added: svn:executable
+ *
Added:
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/DeploymentArchiveDefinition.java
===================================================================
---
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/DeploymentArchiveDefinition.java
(rev 0)
+++
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/DeploymentArchiveDefinition.java 2012-02-27
11:46:34 UTC (rev 8472)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., 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.gatein.integration.jboss.as7;
+
+import org.jboss.as.controller.PathElement;
+import org.jboss.as.controller.ReloadRequiredRemoveStepHandler;
+import org.jboss.as.controller.SimpleAttributeDefinition;
+import org.jboss.as.controller.SimpleAttributeDefinitionBuilder;
+import org.jboss.as.controller.SimpleResourceDefinition;
+import org.jboss.as.controller.registry.AttributeAccess;
+import org.jboss.as.controller.registry.ManagementResourceRegistration;
+import org.jboss.dmr.ModelNode;
+import org.jboss.dmr.ModelType;
+
+/**
+ * @author Tomaz Cerar
+ */
+public class DeploymentArchiveDefinition extends SimpleResourceDefinition
+{
+ protected static final DeploymentArchiveDefinition INSTANCE = new
DeploymentArchiveDefinition();
+
+ protected static final SimpleAttributeDefinition MAIN =
+ new SimpleAttributeDefinitionBuilder(Constants.MAIN, ModelType.BOOLEAN, true)
+ .setAllowExpression(false)
+ .setDefaultValue(new ModelNode(false))
+ .setXmlName(Constants.MAIN)
+ .setFlags(AttributeAccess.Flag.RESTART_ALL_SERVICES)
+ .build();
+
+ private DeploymentArchiveDefinition()
+ {
+ super(PathElement.pathElement(Constants.DEPLOYMENT_ARCHIVE),
+ GateInExtension.getResourceDescriptionResolver(Constants.DEPLOYMENT_ARCHIVE),
+ DeploymentArchiveAdd.INSTANCE, new ReloadRequiredRemoveStepHandler());
+ }
+
+ @Override
+ public void registerAttributes(ManagementResourceRegistration resourceRegistration)
+ {
+ resourceRegistration.registerReadOnlyAttribute(MAIN, null);
+ }
+}
Property changes on:
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/DeploymentArchiveDefinition.java
___________________________________________________________________
Added: svn:executable
+ *
Modified:
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInExtension.java
===================================================================
---
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInExtension.java 2012-02-27
11:31:11 UTC (rev 8471)
+++
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInExtension.java 2012-02-27
11:46:34 UTC (rev 8472)
@@ -24,6 +24,9 @@
import org.jboss.as.controller.Extension;
import org.jboss.as.controller.ExtensionContext;
import org.jboss.as.controller.SubsystemRegistration;
+import org.jboss.as.controller.descriptions.ResourceDescriptionResolver;
+import org.jboss.as.controller.descriptions.StandardResourceDescriptionResolver;
+import org.jboss.as.controller.operations.common.GenericSubsystemDescribeHandler;
import org.jboss.as.controller.parsing.ExtensionParsingContext;
import org.jboss.as.controller.registry.ManagementResourceRegistration;
import org.jboss.as.controller.registry.OperationEntry;
@@ -34,7 +37,6 @@
import org.jboss.modules.ModuleIdentifier;
import org.jboss.msc.service.ServiceName;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADD;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.DESCRIBE;
/**
@@ -51,11 +53,13 @@
public static final String SUBSYSTEM_NAME = "gatein";
- private GateInExtensionConfiguration config = new GateInExtensionConfiguration();
+ protected static final String DEFAULT_PORTAL_NAME = "default";
- public GateInExtensionConfiguration getConfiguration()
+ private static final String RESOURCE_NAME =
GateInExtension.class.getPackage().getName() + ".LocalDescriptions";
+
+ static ResourceDescriptionResolver getResourceDescriptionResolver(final String
keyPrefix)
{
- return config;
+ return new StandardResourceDescriptionResolver(keyPrefix, RESOURCE_NAME,
GateInExtension.class.getClassLoader(), true, false);
}
/**
@@ -66,9 +70,12 @@
{
log.debug("Activating GateIn Extension");
final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME);
- final ManagementResourceRegistration registration =
subsystem.registerSubsystemModel(GateInSubsystemDescriptionProviders.SUBSYSTEM);
- registration.registerOperationHandler(ADD, new GateInSubsystemAdd(this),
GateInSubsystemAdd.DESCRIPTION, false);
- registration.registerOperationHandler(DESCRIBE, GateInSubsystemDescribe.INSTANCE,
GateInSubsystemDescribe.INSTANCE, false, OperationEntry.EntryType.PRIVATE);
+ final ManagementResourceRegistration registration =
subsystem.registerSubsystemModel(GateInSubsystemDefinition.INSTANCE);
+ registration.registerOperationHandler(DESCRIBE,
GenericSubsystemDescribeHandler.INSTANCE, GenericSubsystemDescribeHandler.INSTANCE, false,
OperationEntry.EntryType.PRIVATE);
+ registration.registerSubModel(DeploymentArchiveDefinition.INSTANCE);
+ registration.registerSubModel(PortletWarDependancyDefinition.INSTANCE);
+ registration.registerSubModel(new GateInPortalDefinition(DEFAULT_PORTAL_NAME));
+
subsystem.registerXMLElementWriter(GateInSubsystemParser.getInstance());
}
@@ -94,12 +101,12 @@
public static ServiceName deploymentUnitName(ModuleIdentifier moduleId, Phase phase)
{
return ServiceName.of(Services.deploymentUnitName(
- GateInExtension.skipModuleLoaderPrefix(moduleId.getName())), phase.name());
+ GateInExtension.skipModuleLoaderPrefix(moduleId.getName())), phase.name());
}
public static ServiceName deploymentUnitName(ModuleIdentifier moduleId, String...
postfix)
{
return ServiceName.of(Services.deploymentUnitName(
- GateInExtension.skipModuleLoaderPrefix(moduleId.getName())), postfix);
+ GateInExtension.skipModuleLoaderPrefix(moduleId.getName())), postfix);
}
}
Modified:
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInExtensionConfiguration.java
===================================================================
---
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInExtensionConfiguration.java 2012-02-27
11:31:11 UTC (rev 8471)
+++
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInExtensionConfiguration.java 2012-02-27
11:46:34 UTC (rev 8472)
@@ -21,36 +21,53 @@
*/
package org.gatein.integration.jboss.as7;
+import org.gatein.integration.jboss.as7.deployment.GateInEarKey;
+import org.gatein.integration.jboss.as7.deployment.GateInExtKey;
+import org.gatein.integration.jboss.as7.deployment.PortletWarKey;
+import org.jboss.as.server.deployment.DeploymentUnit;
+import org.jboss.as.server.deployment.module.ModuleDependency;
+import org.jboss.dmr.ModelNode;
+import org.jboss.dmr.Property;
+import org.jboss.modules.Module;
import org.jboss.modules.ModuleIdentifier;
+import org.jboss.modules.ModuleLoader;
import org.jboss.msc.service.ServiceName;
-import java.util.Collections;
-import java.util.LinkedHashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
+import java.util.*;
/**
* @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
*/
public class GateInExtensionConfiguration
{
+ public static final GateInExtensionConfiguration INSTANCE = new
GateInExtensionConfiguration();
+
private Set<ModuleIdentifier> extModules;
+ private Set<ModuleDependency> portletWarDependencies;
+
private ModuleIdentifier earModule =
ModuleIdentifier.create("deployment.gatein.ear");
private final List<ServiceName> childWars = new
LinkedList<ServiceName>();
private final List<ServiceName> childSubUnits = new
LinkedList<ServiceName>();
- public GateInExtensionConfiguration()
+ final ModuleLoader moduleLoader = Module.getBootModuleLoader();
+
+ private GateInExtensionConfiguration()
{
Set<ModuleIdentifier> set = new LinkedHashSet<ModuleIdentifier>();
set.add(ModuleIdentifier.create("deployment.gatein-sample-extension.ear"));
set.add(ModuleIdentifier.create("deployment.gatein-sample-portal.ear"));
set.add(ModuleIdentifier.create("deployment.gatein-sample-skin.war"));
//set.add(ModuleIdentifier.create("deployment.gatein-wsrp-integration.ear"));
- setGateInExtModules(Collections.unmodifiableSet(set));
+ extModules = Collections.unmodifiableSet(set);
+
+ Set<ModuleDependency> dset = new LinkedHashSet<ModuleDependency>();
+ dset.add(new ModuleDependency(moduleLoader,
ModuleIdentifier.create("org.gatein.wci"), false, false, false, false));
+ dset.add(new ModuleDependency(moduleLoader,
ModuleIdentifier.create("org.gatein.pc"), false, false, false, false));
+ dset.add(new ModuleDependency(moduleLoader,
ModuleIdentifier.create("javax.portlet.api"), false, false, false, false));
+ portletWarDependencies = Collections.unmodifiableSet(dset);
}
public Set<ModuleIdentifier> getGateInExtModules()
@@ -58,9 +75,9 @@
return extModules;
}
- public void setGateInExtModules(Set<ModuleIdentifier> modules)
+ public Set<ModuleDependency> getPortletWarDependencies()
{
- this.extModules = modules;
+ return portletWarDependencies;
}
public ModuleIdentifier getGateInEarModule()
@@ -73,17 +90,21 @@
this.earModule = modules;
}
- public List<ServiceName> getChildWars()
+ public synchronized List<ServiceName> getChildWars()
{
- return childWars;
+ return Collections.unmodifiableList(childWars);
}
- public List<ServiceName> getChildSubUnits()
+ public synchronized void addChildWar(ServiceName deploymentServiceName) {
+ childWars.add(deploymentServiceName);
+ }
+
+ public synchronized List<ServiceName> getChildSubUnits()
{
- return childSubUnits;
+ return Collections.unmodifiableList(childSubUnits);
}
- public List<String> getChildSubUnitComponentPrefixes()
+ public synchronized List<String> getChildSubUnitComponentPrefixes()
{
LinkedList<String> ret = new LinkedList<String>();
for (ServiceName name : childSubUnits)
@@ -92,4 +113,87 @@
}
return ret;
}
+
+ public synchronized void addChildSubUnit(ServiceName serviceName) {
+ childSubUnits.add(serviceName);
+ }
+
+ public void setConfigurationFromModel(ModelNode model)
+ {
+ ModelNode archives = model.get(Constants.DEPLOYMENT_ARCHIVES);
+ if (archives.isDefined())
+ {
+ Set<ModuleIdentifier> set = new LinkedHashSet<ModuleIdentifier>();
+
+ for (Property p: archives.asPropertyList())
+ {
+ boolean isMain = false;
+ if (p.getValue().isDefined())
+ {
+ for (Property attr: p.getValue().asPropertyList())
+ {
+ if (Constants.MAIN.equals(attr.getName()))
+ isMain = true;
+ }
+ }
+ if (isMain)
+ earModule = ModuleIdentifier.create("deployment." +
p.getName());
+ else
+ set.add(ModuleIdentifier.create("deployment." + p.getName()));
+ }
+ extModules = Collections.unmodifiableSet(set);
+ }
+
+ ModelNode deps = model.get(Constants.PORTLET_WAR_DEPENDENCIES);
+ if (deps.isDefined())
+ {
+ Set<ModuleDependency> dset = new LinkedHashSet<ModuleDependency>();
+
+ for (Property p: deps.asPropertyList())
+ {
+ boolean importSvcs = false;
+ if (p.getValue().isDefined())
+ {
+ for (Property attr: p.getValue().asPropertyList())
+ {
+ if (Constants.IMPORT_SERVICES.equals(attr.getName()))
+ importSvcs = true;
+ }
+ }
+ String [] parts = parseNameSlotPair(p.getName());
+ dset.add(new ModuleDependency(moduleLoader, ModuleIdentifier.create(parts[0],
parts[1]), false, false, importSvcs, true));
+ // TODO: add optional, and exports
+ }
+ portletWarDependencies = Collections.unmodifiableSet(dset);
+ }
+ }
+
+ private String[] parseNameSlotPair(String name)
+ {
+ String [] parts = name.split(":");
+ if (parts.length == 2)
+ return parts;
+ return new String[] {parts[0], null};
+ }
+
+ public boolean isGateInArchive(DeploymentUnit du)
+ {
+ return du.getAttachment(GateInEarKey.KEY) != null
+ || du.getAttachment(GateInExtKey.KEY) != null;
+ }
+
+ public boolean isPortletArchive(DeploymentUnit du)
+ {
+ return du.getAttachment(PortletWarKey.INSTANCE) != null;
+ }
+
+ public boolean isNonGateInPortletArchive(DeploymentUnit du)
+ {
+ return !isGateInArchive(du) && isPortletArchive(du);
+ }
+
+ public boolean isGateInOrPortletArchive(DeploymentUnit du)
+ {
+ return isGateInArchive(du) || isPortletArchive(du);
+ }
}
Added:
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInPortalAdd.java
===================================================================
---
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInPortalAdd.java
(rev 0)
+++
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInPortalAdd.java 2012-02-27
11:46:34 UTC (rev 8472)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., 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.gatein.integration.jboss.as7;
+
+import org.jboss.as.controller.AbstractAddStepHandler;
+import org.jboss.as.controller.OperationContext;
+import org.jboss.as.controller.OperationFailedException;
+import org.jboss.as.controller.ServiceVerificationHandler;
+import org.jboss.dmr.ModelNode;
+import org.jboss.msc.service.ServiceController;
+
+import java.util.List;
+
+/**
+ * @author Tomaz Cerar
+ */
+public class GateInPortalAdd extends AbstractAddStepHandler
+{
+ protected static final GateInPortalAdd INSTANCE = new GateInPortalAdd();
+
+ private GateInPortalAdd()
+ {
+ }
+
+ @Override
+ protected void populateModel(ModelNode operation, ModelNode model) throws
OperationFailedException
+ {
+ /* noop */
+ }
+
+ @Override
+ protected void performRuntime(OperationContext context, ModelNode operation, ModelNode
model, ServiceVerificationHandler verificationHandler,
List<ServiceController<?>> newControllers) throws OperationFailedException
+ {
+ super.performRuntime(context, operation, model, verificationHandler,
newControllers);
+ }
+}
+
Property changes on:
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInPortalAdd.java
___________________________________________________________________
Added: svn:executable
+ *
Added:
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInPortalDefinition.java
===================================================================
---
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInPortalDefinition.java
(rev 0)
+++
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInPortalDefinition.java 2012-02-27
11:46:34 UTC (rev 8472)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., 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.gatein.integration.jboss.as7;
+
+import org.jboss.as.controller.PathElement;
+import org.jboss.as.controller.ReloadRequiredRemoveStepHandler;
+import org.jboss.as.controller.SimpleResourceDefinition;
+
+/**
+ * @author Tomaz Cerar
r
+ */
+public class GateInPortalDefinition extends SimpleResourceDefinition
+{
+
+ protected GateInPortalDefinition(String portalName)
+ {
+ super(PathElement.pathElement(Constants.PORTAL, portalName),
+ GateInExtension.getResourceDescriptionResolver(Constants.PORTAL),
+ GateInPortalAdd.INSTANCE, new ReloadRequiredRemoveStepHandler()
+ );
+ }
+}
Property changes on:
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInPortalDefinition.java
___________________________________________________________________
Added: svn:executable
+ *
Modified:
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemAdd.java
===================================================================
---
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemAdd.java 2012-02-27
11:31:11 UTC (rev 8471)
+++
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemAdd.java 2012-02-27
11:46:34 UTC (rev 8472)
@@ -25,13 +25,13 @@
import org.gatein.integration.jboss.as7.deployment.GateInInitDeploymentProcessor;
import org.gatein.integration.jboss.as7.deployment.GateInStarterDeploymentProcessor;
import org.gatein.integration.jboss.as7.deployment.GateInStructureDeploymentProcessor;
+import
org.gatein.integration.jboss.as7.deployment.PortletWarClassloadingDependencyProcessor;
import
org.gatein.integration.jboss.as7.deployment.PortletWarDeploymentInitializingProcessor;
import org.gatein.integration.jboss.as7.deployment.WarDependenciesDeploymentProcessor;
import org.jboss.as.controller.AbstractBoottimeAddStepHandler;
import org.jboss.as.controller.OperationContext;
import org.jboss.as.controller.OperationFailedException;
import org.jboss.as.controller.ServiceVerificationHandler;
-import org.jboss.as.controller.descriptions.DescriptionProvider;
import org.jboss.as.server.AbstractDeploymentChainStep;
import org.jboss.as.server.DeploymentProcessorTarget;
import org.jboss.as.server.deployment.Phase;
@@ -39,22 +39,13 @@
import org.jboss.msc.service.ServiceController;
import java.util.List;
-import java.util.Locale;
/**
* @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
*/
public class GateInSubsystemAdd extends AbstractBoottimeAddStepHandler
{
- static final DescriptionProvider DESCRIPTION = new DescriptionProvider()
- {
- public ModelNode getModelDescription(Locale locale)
- {
- return GateInSubsystemDescriptions.getSubsystemAddDescription(locale);
- }
- };
-
static final int STRUCTURE_PORTLET_WAR_DEPLOYMENT_INIT = 0x0B80;
static final int DEPENDENCIES_PORTLET_MODULE = 0x1100;
static final int STRUCTURE_GATEIN = 0x2000;
@@ -63,25 +54,13 @@
static final int INSTALL_GATEIN_START = 0x4000;
static final int MANIFEST_DEPENDENCIES_GATEIN = 0x4000;
- private GateInExtension extension;
-
- public GateInSubsystemAdd(GateInExtension extension)
+ protected GateInSubsystemAdd()
{
- this.extension = extension;
}
protected void populateModel(ModelNode operation, ModelNode model)
{
- //Initialize the 'type' child node
- if (operation.hasDefined(Constants.DEPLOYMENT_ARCHIVES))
- {
-
model.get(Constants.DEPLOYMENT_ARCHIVES).set(operation.get(Constants.DEPLOYMENT_ARCHIVES));
- }
- if (operation.hasDefined(Constants.PORTLET_WAR_DEPENDENCIES))
- {
-
model.get(Constants.PORTLET_WAR_DEPENDENCIES).set(operation.get(Constants.PORTLET_WAR_DEPENDENCIES));
- }
- // Can we read extension configuration here?
+ /* noop */
}
protected void performBoottime(OperationContext context, ModelNode operation,
ModelNode model,
@@ -94,15 +73,14 @@
{
final SharedPortletTldsMetaDataBuilder tldsBuilder = new
SharedPortletTldsMetaDataBuilder();
- processorTarget.addDeploymentProcessor(Phase.STRUCTURE, STRUCTURE_GATEIN, new
GateInStructureDeploymentProcessor(extension));
- processorTarget.addDeploymentProcessor(Phase.PARSE,
STRUCTURE_PORTLET_WAR_DEPLOYMENT_INIT, new
PortletWarDeploymentInitializingProcessor(extension));
- processorTarget.addDeploymentProcessor(Phase.PARSE,
MANIFEST_DEPENDENCIES_GATEIN, new GateInDependenciesDeploymentProcessor(extension));
- processorTarget.addDeploymentProcessor(Phase.PARSE,
INSTALL_GATEIN_CHILD_WARS, new WarDependenciesDeploymentProcessor(extension));
+ processorTarget.addDeploymentProcessor(Phase.STRUCTURE, STRUCTURE_GATEIN, new
GateInStructureDeploymentProcessor());
+ processorTarget.addDeploymentProcessor(Phase.PARSE,
STRUCTURE_PORTLET_WAR_DEPLOYMENT_INIT, new PortletWarDeploymentInitializingProcessor());
+ processorTarget.addDeploymentProcessor(Phase.PARSE,
MANIFEST_DEPENDENCIES_GATEIN, new GateInDependenciesDeploymentProcessor());
+ processorTarget.addDeploymentProcessor(Phase.PARSE,
INSTALL_GATEIN_CHILD_WARS, new WarDependenciesDeploymentProcessor());
- //processorTarget.addDeploymentProcessor(Phase.DEPENDENCIES,
DEPENDENCIES_PORTLET_MODULE,
- // new
PortletWarClassloadingDependencyProcessor(tldsBuilder.create()));
- processorTarget.addDeploymentProcessor(Phase.POST_MODULE,
POST_MODULE_GATEIN_INIT, new GateInInitDeploymentProcessor(extension));
- processorTarget.addDeploymentProcessor(Phase.INSTALL, INSTALL_GATEIN_START,
new GateInStarterDeploymentProcessor(extension));
+ processorTarget.addDeploymentProcessor(Phase.DEPENDENCIES,
DEPENDENCIES_PORTLET_MODULE, new
PortletWarClassloadingDependencyProcessor(tldsBuilder.create()));
+ processorTarget.addDeploymentProcessor(Phase.POST_MODULE,
POST_MODULE_GATEIN_INIT, new GateInInitDeploymentProcessor());
+ processorTarget.addDeploymentProcessor(Phase.INSTALL, INSTALL_GATEIN_START,
new GateInStarterDeploymentProcessor());
}
}, OperationContext.Stage.RUNTIME);
}
Added:
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDefinition.java
===================================================================
---
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDefinition.java
(rev 0)
+++
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDefinition.java 2012-02-27
11:46:34 UTC (rev 8472)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., 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.gatein.integration.jboss.as7;
+
+import org.jboss.as.controller.PathElement;
+import org.jboss.as.controller.ReloadRequiredRemoveStepHandler;
+import org.jboss.as.controller.SimpleResourceDefinition;
+import org.jboss.as.controller.descriptions.DefaultResourceAddDescriptionProvider;
+import org.jboss.as.controller.descriptions.DefaultResourceRemoveDescriptionProvider;
+import org.jboss.as.controller.descriptions.DescriptionProvider;
+import org.jboss.as.controller.descriptions.ModelDescriptionConstants;
+import org.jboss.as.controller.descriptions.ResourceDescriptionResolver;
+import org.jboss.as.controller.registry.ManagementResourceRegistration;
+import org.jboss.as.controller.registry.OperationEntry;
+
+import java.util.EnumSet;
+
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADD;
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.REMOVE;
+
+/**
+ * @author Tomaz Cerar
+ */
+public class GateInSubsystemDefinition extends SimpleResourceDefinition
+{
+ protected static GateInSubsystemDefinition INSTANCE = new
GateInSubsystemDefinition();
+
+ private GateInSubsystemDefinition()
+ {
+ super(PathElement.pathElement(ModelDescriptionConstants.SUBSYSTEM,
GateInExtension.SUBSYSTEM_NAME),
+
GateInExtension.getResourceDescriptionResolver(GateInExtension.SUBSYSTEM_NAME));
+ }
+
+ @Override
+ public void registerOperations(final ManagementResourceRegistration registration)
+ {
+ final GateInSubsystemAdd subsystemAdd = new GateInSubsystemAdd();
+ final ResourceDescriptionResolver rootResolver =
GateInSubsystemDefinition.INSTANCE.getResourceDescriptionResolver();
+ final DescriptionProvider subsystemAddDescription = new
DefaultResourceAddDescriptionProvider(registration, rootResolver);
+ registration.registerOperationHandler(ADD, subsystemAdd, subsystemAddDescription,
EnumSet.of(OperationEntry.Flag.RESTART_ALL_SERVICES));
+ registration.registerOperationHandler(REMOVE,
ReloadRequiredRemoveStepHandler.INSTANCE, new
DefaultResourceRemoveDescriptionProvider(rootResolver),
EnumSet.of(OperationEntry.Flag.RESTART_ALL_SERVICES));
+ }
+}
Property changes on:
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDefinition.java
___________________________________________________________________
Added: svn:executable
+ *
Deleted:
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDescribe.java
===================================================================
---
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDescribe.java 2012-02-27
11:31:11 UTC (rev 8471)
+++
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDescribe.java 2012-02-27
11:46:34 UTC (rev 8472)
@@ -1,73 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat, Inc., 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.gatein.integration.jboss.as7;
-
-import org.jboss.as.controller.OperationContext;
-import org.jboss.as.controller.OperationFailedException;
-import org.jboss.as.controller.OperationStepHandler;
-import org.jboss.as.controller.PathAddress;
-import org.jboss.as.controller.descriptions.DescriptionProvider;
-import org.jboss.dmr.ModelNode;
-
-import java.util.Locale;
-
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.*;
-
-/**
- * @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
- */
-public class GateInSubsystemDescribe implements OperationStepHandler,
DescriptionProvider
-{
-
- static final GateInSubsystemDescribe INSTANCE = new GateInSubsystemDescribe();
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void execute(OperationContext context, ModelNode operation) throws
OperationFailedException
- {
- final PathAddress rootAddress =
PathAddress.pathAddress(PathAddress.pathAddress(operation.require(OP_ADDR)).getLastElement());
- final ModelNode subModel =
context.readResource(PathAddress.EMPTY_ADDRESS).getModel();
-
- final ModelNode subsystemAdd = new ModelNode();
- subsystemAdd.get(OP).set(ADD);
- subsystemAdd.get(OP_ADDR).set(rootAddress.toModelNode());
- if (subModel.hasDefined(Constants.DEPLOYMENT_ARCHIVES))
- {
-
subsystemAdd.get(Constants.DEPLOYMENT_ARCHIVES).set(subModel.get(Constants.DEPLOYMENT_ARCHIVES));
- }
- if (subModel.hasDefined(Constants.PORTLET_WAR_DEPENDENCIES))
- {
-
subsystemAdd.get(Constants.PORTLET_WAR_DEPENDENCIES).set(subModel.get(Constants.PORTLET_WAR_DEPENDENCIES));
- }
- context.getResult().add(subsystemAdd);
-
- context.completeStep();
- }
-
- @Override
- public ModelNode getModelDescription(Locale locale)
- {
- return new ModelNode();
- }
-}
Deleted:
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDescriptionProviders.java
===================================================================
---
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDescriptionProviders.java 2012-02-27
11:31:11 UTC (rev 8471)
+++
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDescriptionProviders.java 2012-02-27
11:46:34 UTC (rev 8472)
@@ -1,44 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat, Inc., 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.gatein.integration.jboss.as7;
-
-import org.jboss.as.controller.descriptions.DescriptionProvider;
-import org.jboss.dmr.ModelNode;
-
-import java.util.Locale;
-
-/**
- * Common web description providers.
- *
- * @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
- */
-public class GateInSubsystemDescriptionProviders
-{
- public static final DescriptionProvider SUBSYSTEM = new DescriptionProvider()
- {
- @Override
- public ModelNode getModelDescription(Locale locale)
- {
- return GateInSubsystemDescriptions.getSubsystemDescription(locale);
- }
- };
-}
Deleted:
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDescriptions.java
===================================================================
---
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDescriptions.java 2012-02-27
11:31:11 UTC (rev 8471)
+++
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemDescriptions.java 2012-02-27
11:46:34 UTC (rev 8472)
@@ -1,78 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat, Inc., 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.gatein.integration.jboss.as7;
-
-import org.jboss.dmr.ModelNode;
-
-import java.util.Locale;
-import java.util.ResourceBundle;
-
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.*;
-
-/**
- * @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
- */
-public class GateInSubsystemDescriptions
-{
- static final String RESOURCE_NAME =
GateInSubsystemDescriptions.class.getPackage().getName() +
".LocalDescriptions";
-
- public static ModelNode getSubsystemDescription(final Locale locale)
- {
- final ResourceBundle bundle = getResourceBundle(locale);
-
- final ModelNode node = new ModelNode();
-
- node.get(DESCRIPTION).set(bundle.getString("gatein.description"));
- node.get(HEAD_COMMENT_ALLOWED).set(true);
- node.get(TAIL_COMMENT_ALLOWED).set(true);
- node.get(NAMESPACE).set(GateInExtension.NAMESPACE);
-
- node.get(CHILDREN, "deployment-archives",
DESCRIPTION).set(bundle.getString("gatein.deployment-archives.description"));
- node.get(CHILDREN, "deployment-archives", MIN_OCCURS).set(0);
- node.get(CHILDREN, "deployment-archives", MAX_OCCURS).set(1);
- node.get(CHILDREN, "deployment-archives", MODEL_DESCRIPTION);
-
- node.get(CHILDREN, "portlet-war-dependencies",
DESCRIPTION).set(bundle.getString("gatein.portlet-war-dependencies.description"));
- node.get(CHILDREN, "portlet-war-dependencies", MIN_OCCURS).set(0);
- node.get(CHILDREN, "portlet-war-dependencies", MAX_OCCURS).set(1);
- node.get(CHILDREN, "portlet-war-dependencies", MODEL_DESCRIPTION);
-
- return node;
- }
-
- static ResourceBundle getResourceBundle(Locale locale)
- {
- if (locale == null)
- {
- locale = Locale.getDefault();
- }
- return ResourceBundle.getBundle(RESOURCE_NAME, locale);
- }
-
- public static ModelNode getSubsystemAddDescription(Locale locale)
- {
- final ResourceBundle bundle = getResourceBundle(locale);
- final ModelNode subsystem = new ModelNode();
-
subsystem.get(DESCRIPTION).set(bundle.getString("gatein.add.description"));
- return subsystem;
- }
-}
Modified:
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemParser.java
===================================================================
---
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemParser.java 2012-02-27
11:31:11 UTC (rev 8471)
+++
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/GateInSubsystemParser.java 2012-02-27
11:46:34 UTC (rev 8472)
@@ -21,6 +21,7 @@
*/
package org.gatein.integration.jboss.as7;
+import org.jboss.as.controller.parsing.ParseUtils;
import org.jboss.as.controller.persistence.SubsystemMarshallingContext;
import org.jboss.dmr.ModelNode;
import org.jboss.dmr.Property;
@@ -31,11 +32,18 @@
import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamException;
+import java.util.EnumSet;
import java.util.List;
-import static org.gatein.integration.jboss.as7.Constants.*;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.*;
-import static org.jboss.as.controller.parsing.ParseUtils.*;
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADD;
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP;
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR;
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SUBSYSTEM;
+import static org.jboss.as.controller.parsing.ParseUtils.requireNoAttributes;
+import static org.jboss.as.controller.parsing.ParseUtils.requireNoContent;
+import static org.jboss.as.controller.parsing.ParseUtils.requireNoNamespaceAttribute;
+import static org.jboss.as.controller.parsing.ParseUtils.unexpectedAttribute;
+import static org.jboss.as.controller.parsing.ParseUtils.unexpectedElement;
/**
* GateIn subsystem parser.
@@ -61,13 +69,13 @@
context.startSubsystemElement(GateInExtension.NAMESPACE, false);
ModelNode node = context.getModelNode();
- if (node.hasDefined(DEPLOYMENT_ARCHIVES))
+ if (node.hasDefined(Constants.DEPLOYMENT_ARCHIVE))
{
- writeDeploymentArchives(writer, node.get(DEPLOYMENT_ARCHIVES));
+ writeDeploymentArchives(writer, node.get(Constants.DEPLOYMENT_ARCHIVE));
}
- if (node.hasDefined(PORTLET_WAR_DEPENDENCIES))
+ if (node.hasDefined(Constants.PORTLET_WAR_DEPENDENCY))
{
- writePortletWarDependencies(writer, node.get(PORTLET_WAR_DEPENDENCIES));
+ writePortletWarDependencies(writer,
node.get(Constants.PORTLET_WAR_DEPENDENCY));
}
writer.writeEndElement();
}
@@ -81,20 +89,8 @@
{
writer.writeStartElement(Element.ARCHIVE.getLocalName());
writer.writeAttribute(Attribute.NAME.getLocalName(), archive.getName());
- if (archive.getValue().isDefined() && archive.getValue().asInt() >
0)
- {
- for (Property property : archive.getValue().asPropertyList())
- {
- if (MAIN.equals(property.getName()))
- {
- writer.writeAttribute(Attribute.MAIN.getLocalName(), TRUE);
- }
- else
- {
- throw new RuntimeException("Unexpected model property: " +
property + " on " + archive);
- }
- }
- }
+ ModelNode model = archive.getValue();
+ DeploymentArchiveDefinition.MAIN.marshallAsAttribute(model, false, writer);
writer.writeEndElement();
}
writer.writeEndElement();
@@ -111,20 +107,8 @@
{
writer.writeStartElement(Element.DEPENDENCY.getLocalName());
writer.writeAttribute(Attribute.NAME.getLocalName(), dependency.getName());
- if (dependency.getValue().isDefined() &&
dependency.getValue().asInt() > 0)
- {
- for (Property property : dependency.getValue().asPropertyList())
- {
- if (IMPORT_SERVICES.equals(property.getName()))
- {
- writer.writeAttribute(Attribute.IMPORT_SERVICES.getLocalName(),
TRUE);
- }
- else
- {
- throw new RuntimeException("Unexpected model property: " +
property + " on " + dependency);
- }
- }
- }
+ ModelNode model = dependency.getValue();
+ PortletWarDependancyDefinition.IMPORT_SERVICES.marshallAsAttribute(model,
false, writer);
writer.writeEndElement();
}
writer.writeEndElement();
@@ -168,14 +152,12 @@
{
case DEPLOYMENT_ARCHIVES:
{
- final ModelNode deploymentArchives = parseDeploymentArchives(reader);
- subsystem.get(DEPLOYMENT_ARCHIVES).set(deploymentArchives);
+ parseDeploymentArchives(reader, address, list);
break;
}
case PORTLET_WAR_DEPENDENCIES:
{
- final ModelNode portletWarDeps = parsePortletWarDependencies(reader);
- subsystem.get(PORTLET_WAR_DEPENDENCIES).set(portletWarDeps);
+ parsePortletWarDependencies(reader, address, list);
break;
}
default:
@@ -183,17 +165,16 @@
throw unexpectedElement(reader);
}
}
- }
- else
+ } else
{
throw unexpectedElement(reader);
}
}
}
- static ModelNode parseDeploymentArchives(XMLExtendedStreamReader reader) throws
XMLStreamException
+ static void parseDeploymentArchives(XMLExtendedStreamReader reader, ModelNode parent,
List<ModelNode> operations) throws XMLStreamException
{
- final ModelNode model = new ModelNode();
+
// no attributes
requireNoAttributes(reader);
// elements
@@ -204,7 +185,7 @@
{
case ARCHIVE:
{
- parseArchive(reader, model);
+ parseArchive(reader, parent, operations);
break;
}
default:
@@ -213,32 +194,29 @@
}
// validate archives
- int mainCount = 0;
- for (Property p : model.asPropertyList())
- {
- if (p.getValue().isDefined())
- {
- List<Property> props = p.getValue().asPropertyList();
- if (props.size() > 0 && MAIN.equals(props.get(0).getName()))
- {
- mainCount++;
- }
+ //TODO: this must go in DeploymentArchiveAdd
+ /*int mainCount = 0;
+ for (Property p : model.asPropertyList()) {
+ if (p.getValue().isDefined()) {
+ List<Property> props = p.getValue().asPropertyList();
+ if (props.size() > 0 && MAIN.equals(props.get(0).getName())) {
+ mainCount++;
+ }
}
- }
+ }
- if (mainCount != 1)
- {
+ if (mainCount != 1) {
throw new RuntimeException("Exactly one archive has to be marked as a main
archive (found: " + mainCount + ")");
- }
+ } */
- return model;
}
- static void parseArchive(XMLExtendedStreamReader reader, ModelNode model) throws
XMLStreamException
+ static void parseArchive(XMLExtendedStreamReader reader, ModelNode parent,
List<ModelNode> operations) throws XMLStreamException
{
- // attributes
+ ModelNode model = new ModelNode();
+
final int count = reader.getAttributeCount();
- boolean main = false;
+
String name = null;
for (int i = 0; i < count; i++)
{
@@ -254,8 +232,7 @@
}
case MAIN:
{
- requireTrueOrFalse(value);
- main = Boolean.parseBoolean(value);
+ DeploymentArchiveDefinition.MAIN.parseAndSetParameter(value, model,
reader);
break;
}
default:
@@ -266,22 +243,21 @@
if (name == null)
{
throw new RuntimeException("Attribute '" +
Attribute.NAME.getLocalName()
- + "' of '" + Element.ARCHIVE.getLocalName() +
"' element can not be null!");
+ + "' of '" + Element.ARCHIVE.getLocalName() + "'
element can not be null!");
}
- ModelNode attrList = new ModelNode();
- if (main)
- {
- attrList.add(MAIN, new ModelNode());
- }
- model.add(name, attrList);
+ ModelNode address = parent.clone();
+ address.add(Constants.DEPLOYMENT_ARCHIVE, name);
+ model.get(OP).set(ADD);
+ model.get(OP_ADDR).set(address);
+ operations.add(model);
+
requireNoContent(reader);
}
- static ModelNode parsePortletWarDependencies(XMLExtendedStreamReader reader) throws
XMLStreamException
+ static void parsePortletWarDependencies(XMLExtendedStreamReader reader, ModelNode
parent, List<ModelNode> operations) throws XMLStreamException
{
- final ModelNode model = new ModelNode();
// no attributes
requireNoAttributes(reader);
// elements
@@ -292,22 +268,21 @@
{
case DEPENDENCY:
{
- parseDependency(reader, model);
+ parseDependency(reader, parent, operations);
break;
}
default:
throw unexpectedElement(reader);
}
}
-
- return model;
}
- static void parseDependency(XMLExtendedStreamReader reader, ModelNode model) throws
XMLStreamException
+ static void parseDependency(XMLExtendedStreamReader reader, ModelNode parent,
List<ModelNode> operations) throws XMLStreamException
{
+
+ final ModelNode model = new ModelNode();
// attributes
final int count = reader.getAttributeCount();
- boolean importSvcs = false;
String name = null;
for (int i = 0; i < count; i++)
{
@@ -323,8 +298,9 @@
}
case IMPORT_SERVICES:
{
- requireTrueOrFalse(value);
- importSvcs = Boolean.parseBoolean(value);
+ PortletWarDependancyDefinition.IMPORT_SERVICES.parseAndSetParameter(value,
model, reader);
+ /*requireTrueOrFalse(value);
+ importSvcs = Boolean.parseBoolean(value);*/
break;
}
default:
@@ -334,25 +310,16 @@
if (name == null)
{
- throw new RuntimeException("Attribute '" +
Attribute.NAME.getLocalName()
- + "' of '" + Element.ARCHIVE.getLocalName() +
"' element can not be null!");
+ throw ParseUtils.missingRequired(reader, EnumSet.of(Attribute.NAME));
}
- ModelNode attrList = new ModelNode();
- if (importSvcs)
- {
- attrList.add(IMPORT_SERVICES, new ModelNode());
- }
- model.add(name, attrList);
+ ModelNode address = parent.clone();
+ address.add(Constants.PORTLET_WAR_DEPENDENCY, name);
+ model.get(OP).set(ADD);
+ model.get(OP_ADDR).set(address);
+ operations.add(model);
+
requireNoContent(reader);
}
-
- private static void requireTrueOrFalse(String value)
- {
- if (!"true".equals(value) && !"false".equals(value))
- {
- throw new RuntimeException("Invalid value for boolean attribute: " +
value);
- }
- }
}
Added:
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/PortletWarDependancyAdd.java
===================================================================
---
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/PortletWarDependancyAdd.java
(rev 0)
+++
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/PortletWarDependancyAdd.java 2012-02-27
11:46:34 UTC (rev 8472)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat, Inc., 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.gatein.integration.jboss.as7;
+
+import org.jboss.as.controller.AbstractAddStepHandler;
+import org.jboss.as.controller.OperationFailedException;
+import org.jboss.dmr.ModelNode;
+
+/**
+ * @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
+ */
+public class PortletWarDependancyAdd extends AbstractAddStepHandler {
+ public static final PortletWarDependancyAdd INSTANCE = new
PortletWarDependancyAdd();
+
+ private PortletWarDependancyAdd() {
+ }
+
+ @Override
+ protected void populateModel(ModelNode operation, ModelNode model) throws
OperationFailedException {
+ PortletWarDependancyDefinition.IMPORT_SERVICES.validateAndSet(operation,model);
+ }
+}
Property changes on:
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/PortletWarDependancyAdd.java
___________________________________________________________________
Added: svn:executable
+ *
Added:
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/PortletWarDependancyDefinition.java
===================================================================
---
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/PortletWarDependancyDefinition.java
(rev 0)
+++
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/PortletWarDependancyDefinition.java 2012-02-27
11:46:34 UTC (rev 8472)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., 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.gatein.integration.jboss.as7;
+
+import org.jboss.as.controller.PathElement;
+import org.jboss.as.controller.ReloadRequiredRemoveStepHandler;
+import org.jboss.as.controller.SimpleAttributeDefinition;
+import org.jboss.as.controller.SimpleAttributeDefinitionBuilder;
+import org.jboss.as.controller.SimpleResourceDefinition;
+import org.jboss.as.controller.registry.AttributeAccess;
+import org.jboss.as.controller.registry.ManagementResourceRegistration;
+import org.jboss.dmr.ModelNode;
+import org.jboss.dmr.ModelType;
+
+/**
+ * @author Tomaz Cerar
+ */
+public class PortletWarDependancyDefinition extends SimpleResourceDefinition
+{
+ protected static final PortletWarDependancyDefinition INSTANCE = new
PortletWarDependancyDefinition();
+
+ protected static final SimpleAttributeDefinition IMPORT_SERVICES =
+ new SimpleAttributeDefinitionBuilder(Constants.IMPORT_SERVICES, ModelType.BOOLEAN,
true)
+ .setAllowExpression(false)
+ .setDefaultValue(new ModelNode(false))
+ .setXmlName(Constants.IMPORT_SERVICES)
+ .setFlags(AttributeAccess.Flag.RESTART_ALL_SERVICES)
+ .build();
+
+ private PortletWarDependancyDefinition()
+ {
+ super(PathElement.pathElement(Constants.PORTLET_WAR_DEPENDENCY),
GateInExtension.getResourceDescriptionResolver(Constants.PORTLET_WAR_DEPENDENCY),
+ PortletWarDependancyAdd.INSTANCE, new ReloadRequiredRemoveStepHandler()
+ );
+ }
+
+ @Override
+ public void registerAttributes(ManagementResourceRegistration resourceRegistration)
+ {
+ resourceRegistration.registerReadOnlyAttribute(IMPORT_SERVICES, null);
+ }
+}
Property changes on:
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/PortletWarDependancyDefinition.java
___________________________________________________________________
Added: svn:executable
+ *
Deleted:
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/SetGateInArchivesHandler.java
===================================================================
---
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/SetGateInArchivesHandler.java 2012-02-27
11:31:11 UTC (rev 8471)
+++
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/SetGateInArchivesHandler.java 2012-02-27
11:46:34 UTC (rev 8472)
@@ -1,62 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat, Inc., 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.gatein.integration.jboss.as7;
-
-import org.jboss.as.controller.AbstractAddStepHandler;
-import org.jboss.as.controller.OperationFailedException;
-import org.jboss.as.controller.descriptions.DescriptionProvider;
-import org.jboss.dmr.ModelNode;
-import org.jboss.dmr.ModelType;
-
-import java.util.Locale;
-import java.util.ResourceBundle;
-
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.*;
-
-/**
- * @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
- */
-public class SetGateInArchivesHandler extends AbstractAddStepHandler implements
DescriptionProvider
-{
- public static final SetGateInArchivesHandler INSTANCE = new
SetGateInArchivesHandler();
-
- private SetGateInArchivesHandler()
- {
- }
-
- @Override
- protected void populateModel(ModelNode operation, ModelNode model) throws
OperationFailedException
- {
-
- }
-
- public ModelNode getModelDescription(Locale locale)
- {
- final ResourceBundle bundle =
GateInSubsystemDescriptions.getResourceBundle(locale);
- ModelNode node = new ModelNode();
-
node.get(DESCRIPTION).set(bundle.getString("gatein.set-deployment-archives.description"));
- node.get(REQUEST_PROPERTIES, "services",
DESCRIPTION).set(bundle.getString("gatein.deployment-archives.archive.services.description"));
- node.get(REQUEST_PROPERTIES, "services", TYPE).set(ModelType.UNDEFINED);
- node.get(REQUEST_PROPERTIES, "services", REQUIRED).set(false);
- return node;
- }
-}
Modified:
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInDependenciesDeploymentProcessor.java
===================================================================
---
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInDependenciesDeploymentProcessor.java 2012-02-27
11:31:11 UTC (rev 8471)
+++
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInDependenciesDeploymentProcessor.java 2012-02-27
11:46:34 UTC (rev 8472)
@@ -21,7 +21,6 @@
*/
package org.gatein.integration.jboss.as7.deployment;
-import org.gatein.integration.jboss.as7.GateInExtension;
import org.gatein.integration.jboss.as7.GateInExtensionConfiguration;
import org.jboss.as.server.deployment.Attachments;
import org.jboss.as.server.deployment.DeploymentPhaseContext;
@@ -43,22 +42,13 @@
final ModuleIdentifier gateInLibId =
ModuleIdentifier.fromString("org.gatein.lib");
- private GateInExtension extension;
- private GateInExtensionConfiguration config;
+ private GateInExtensionConfiguration config =GateInExtensionConfiguration.INSTANCE;
- public GateInDependenciesDeploymentProcessor(GateInExtension extension)
- {
- this.extension = extension;
- this.config = extension.getConfiguration();
- }
-
public void deploy(final DeploymentPhaseContext phaseContext) throws
DeploymentUnitProcessingException
{
final DeploymentUnit du = phaseContext.getDeploymentUnit();
- if (du.getAttachment(GateInEarKey.KEY) != null
- || du.getAttachment(GateInExtKey.KEY) != null
- || du.getAttachment(PortletWarKey.INSTANCE) != null)
+ if (config.isGateInOrPortletArchive(du))
{
// add dependency on org.gatein.lib
List<ModuleDependency> dependencies =
du.getAttachmentList(Attachments.MANIFEST_DEPENDENCIES);
@@ -66,14 +56,13 @@
if (!containsDependency(dependencies, gateInLibId))
{
du.addToAttachmentList(Attachments.MANIFEST_DEPENDENCIES,
- new ModuleDependency(Module.getBootModuleLoader(), gateInLibId, false,
false, true));
+ new ModuleDependency(Module.getBootModuleLoader(), gateInLibId, false,
false, true, false));
}
// add gatein deployment modules cross-dependencies
ModuleIdentifier moduleId = du.getAttachment(Attachments.MODULE_IDENTIFIER);
- if (du.getAttachment(GateInEarKey.KEY) != null
- || du.getAttachment(GateInExtKey.KEY) != null)
+ if (config.isGateInArchive(du))
{
final ServiceModuleLoader deploymentModuleLoader =
du.getAttachment(Attachments.SERVICE_MODULE_LOADER);
@@ -82,7 +71,7 @@
if (!containsDependency(dependencies, config.getGateInEarModule()))
{
du.addToAttachmentList(Attachments.MANIFEST_DEPENDENCIES,
- new ModuleDependency(deploymentModuleLoader,
config.getGateInEarModule(), false, false, false));
+ new ModuleDependency(deploymentModuleLoader,
config.getGateInEarModule(), false, false, false, false));
}
}
@@ -93,7 +82,7 @@
if (!containsDependency(dependencies, id))
{
du.addToAttachmentList(Attachments.MANIFEST_DEPENDENCIES,
- new ModuleDependency(deploymentModuleLoader, id, false, false,
false));
+ new ModuleDependency(deploymentModuleLoader, id, false, false,
false, false));
}
}
}
Modified:
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInInitDeploymentProcessor.java
===================================================================
---
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInInitDeploymentProcessor.java 2012-02-27
11:31:11 UTC (rev 8471)
+++
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInInitDeploymentProcessor.java 2012-02-27
11:46:34 UTC (rev 8472)
@@ -44,34 +44,28 @@
{
private final Logger log = Logger.getLogger(GateInInitDeploymentProcessor.class);
- private GateInExtension extension;
+ private GateInExtensionConfiguration config = GateInExtensionConfiguration.INSTANCE;
- public GateInInitDeploymentProcessor(GateInExtension extension)
- {
- this.extension = extension;
- }
-
@Override
public void deploy(DeploymentPhaseContext phaseContext) throws
DeploymentUnitProcessingException
{
final DeploymentUnit du = phaseContext.getDeploymentUnit();
- if (du.getAttachment(GateInEarKey.KEY) != null
- || du.getAttachment(GateInExtKey.KEY) != null)
+ if (config.isGateInArchive(du))
{
log.info("Module is on GateIn Extension modules list");
- GateInExtensionConfiguration conf = extension.getConfiguration();
- ServiceName initSvcName =
GateInExtension.deploymentUnitName(conf.getGateInEarModule(), "gatein",
"init");
+
+ ServiceName initSvcName =
GateInExtension.deploymentUnitName(config.getGateInEarModule(), "gatein",
"init");
ServiceTarget target = phaseContext.getServiceTarget();
if (du.getAttachment(GateInEarKey.KEY) != null)
{
// install InitService with dependency on all the deployment modules reaching
POST_MODULE
// TODO: we are starting up InitService before child modules
(jboss.deployment.subunit.*) have gone through POST_MODULE
- ServiceBuilder<InitService> builder = target.addService(initSvcName,
new InitService(extension))
-
.addDependency(GateInExtension.deploymentUnitName(conf.getGateInEarModule(),
Phase.POST_MODULE));
+ ServiceBuilder<InitService> builder = target.addService(initSvcName,
new InitService())
+
.addDependency(GateInExtension.deploymentUnitName(config.getGateInEarModule(),
Phase.POST_MODULE));
- for (ModuleIdentifier module : conf.getGateInExtModules())
+ for (ModuleIdentifier module : config.getGateInExtModules())
{
builder.addDependency(GateInExtension.deploymentUnitName(module,
Phase.POST_MODULE));
}
Modified:
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInStarterDeploymentProcessor.java
===================================================================
---
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInStarterDeploymentProcessor.java 2012-02-27
11:31:11 UTC (rev 8471)
+++
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInStarterDeploymentProcessor.java 2012-02-27
11:46:34 UTC (rev 8472)
@@ -44,15 +44,8 @@
{
private ConcurrentHashMap<ModuleIdentifier, ModuleIdentifier>
deploymentModules;
- private GateInExtension extension;
- private GateInExtensionConfiguration config;
+ private GateInExtensionConfiguration config = GateInExtensionConfiguration.INSTANCE;
- public GateInStarterDeploymentProcessor(GateInExtension extension)
- {
- this.extension = extension;
- this.config = extension.getConfiguration();
- }
-
private synchronized ConcurrentHashMap<ModuleIdentifier, ModuleIdentifier>
getDeploymentModules()
{
if (deploymentModules == null)
@@ -76,7 +69,7 @@
// Then enumerate all the child components which should all be scheduled for
startup at that point
// to get the dependencies for StartupService
- if (du.getAttachment(GateInEarKey.KEY) != null ||
du.getAttachment(GateInExtKey.KEY) != null)
+ if (config.isGateInArchive(du))
{
ModuleIdentifier moduleId = du.getAttachment(Attachments.MODULE_IDENTIFIER);
getDeploymentModules().remove(moduleId);
Modified:
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInStructureDeploymentProcessor.java
===================================================================
---
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInStructureDeploymentProcessor.java 2012-02-27
11:31:11 UTC (rev 8471)
+++
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/GateInStructureDeploymentProcessor.java 2012-02-27
11:46:34 UTC (rev 8472)
@@ -23,15 +23,12 @@
import org.gatein.integration.jboss.as7.GateInExtension;
import org.gatein.integration.jboss.as7.GateInExtensionConfiguration;
-import org.jboss.as.ee.structure.DeploymentType;
-import org.jboss.as.ee.structure.DeploymentTypeMarker;
import org.jboss.as.server.deployment.Attachments;
import org.jboss.as.server.deployment.DeploymentPhaseContext;
import org.jboss.as.server.deployment.DeploymentUnit;
import org.jboss.as.server.deployment.DeploymentUnitProcessingException;
import org.jboss.as.server.deployment.DeploymentUnitProcessor;
import org.jboss.as.server.deployment.Services;
-import org.jboss.as.web.WebSubsystemServices;
import org.jboss.logging.Logger;
import org.jboss.modules.ModuleIdentifier;
import org.jboss.msc.service.AbstractServiceListener;
@@ -39,10 +36,6 @@
import org.jboss.msc.service.ServiceListener;
import org.jboss.msc.service.ServiceName;
-import java.util.Collections;
-import java.util.LinkedList;
-import java.util.List;
-
/**
* @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
*/
@@ -75,13 +68,10 @@
};
- private GateInExtension extension;
- private GateInExtensionConfiguration config;
+ private GateInExtensionConfiguration config = GateInExtensionConfiguration.INSTANCE;
- public GateInStructureDeploymentProcessor(GateInExtension extension)
+ public GateInStructureDeploymentProcessor()
{
- this.extension = extension;
- this.config = extension.getConfiguration();
}
@Override
@@ -121,14 +111,13 @@
{
DeploymentUnit du = phaseContext.getDeploymentUnit();
DeploymentUnit parent = du.getParent();
- if (parent.getAttachment(GateInEarKey.KEY) != null
- || parent.getAttachment(GateInExtKey.KEY) != null)
+ if (config.isGateInArchive(parent))
{
//if (DeploymentTypeMarker.isType(DeploymentType.WAR, du))
//{
//
config.getChildWars().add(WebSubsystemServices.JBOSS_WEB.append(du.getName()));
//}
- config.getChildSubUnits().add(Services.deploymentUnitName(parent.getName(),
du.getName()));
+ config.addChildSubUnit(Services.deploymentUnitName(parent.getName(),
du.getName()));
}
}
@@ -140,7 +129,7 @@
void installListener(DeploymentPhaseContext phaseContext, ModuleIdentifier moduleId)
{
ServiceName serviceName = Services.deploymentUnitName(
- GateInExtension.skipModuleLoaderPrefix(moduleId.getName()));
+ GateInExtension.skipModuleLoaderPrefix(moduleId.getName()));
ServiceController<?> svcc =
phaseContext.getServiceRegistry().getService(serviceName);
svcc.addListener(ServiceListener.Inheritance.ALL, listener);
Modified:
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/PortletWarClassloadingDependencyProcessor.java
===================================================================
---
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/PortletWarClassloadingDependencyProcessor.java 2012-02-27
11:31:11 UTC (rev 8471)
+++
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/PortletWarClassloadingDependencyProcessor.java 2012-02-27
11:46:34 UTC (rev 8472)
@@ -21,6 +21,7 @@
*/
package org.gatein.integration.jboss.as7.deployment;
+import org.gatein.integration.jboss.as7.GateInExtensionConfiguration;
import org.jboss.as.server.deployment.Attachments;
import org.jboss.as.server.deployment.DeploymentPhaseContext;
import org.jboss.as.server.deployment.DeploymentUnit;
@@ -30,9 +31,6 @@
import org.jboss.as.server.deployment.module.ModuleSpecification;
import org.jboss.as.web.deployment.TldsMetaData;
import org.jboss.metadata.web.spec.TldMetaData;
-import org.jboss.modules.Module;
-import org.jboss.modules.ModuleIdentifier;
-import org.jboss.modules.ModuleLoader;
import java.util.List;
import java.util.Map;
@@ -43,12 +41,10 @@
public class PortletWarClassloadingDependencyProcessor implements
DeploymentUnitProcessor
{
- private static final ModuleIdentifier GATEIN_WCI =
ModuleIdentifier.create("org.gatein.wci");
- private static final ModuleIdentifier GATEIN_PC =
ModuleIdentifier.create("org.gatein.pc");
- private static final ModuleIdentifier JAVAX_PORTLET =
ModuleIdentifier.create("javax.portlet.api");
-
private List<TldMetaData> tldMetas;
+ private GateInExtensionConfiguration conf = GateInExtensionConfiguration.INSTANCE;
+
public PortletWarClassloadingDependencyProcessor(List<TldMetaData> tldMetaData)
{
this.tldMetas = tldMetaData;
@@ -57,22 +53,22 @@
@Override
public void deploy(DeploymentPhaseContext phaseContext) throws
DeploymentUnitProcessingException
{
- final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
- if (deploymentUnit.getAttachment(PortletWarKey.INSTANCE) == null)
+ final DeploymentUnit du = phaseContext.getDeploymentUnit();
+ if (!conf.isPortletArchive(du))
{
return; // Skip non portlet deployments
}
- final ModuleLoader moduleLoader = Module.getBootModuleLoader();
- final ModuleSpecification moduleSpecification =
deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
+ final ModuleSpecification moduleSpecification =
du.getAttachment(Attachments.MODULE_SPECIFICATION);
// Add module dependencies
- moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader,
GATEIN_WCI, false, false, false));
- moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader,
GATEIN_PC, false, false, false));
- moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader,
JAVAX_PORTLET, false, false, false));
+ for (ModuleDependency dep: conf.getPortletWarDependencies())
+ {
+ moduleSpecification.addSystemDependency(dep);
+ }
// Provide tlds for portlet taglibs
- provideTlds(deploymentUnit);
+ provideTlds(du);
}
private void provideTlds(DeploymentUnit deploymentUnit)
Modified:
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/PortletWarDeploymentInitializingProcessor.java
===================================================================
---
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/PortletWarDeploymentInitializingProcessor.java 2012-02-27
11:31:11 UTC (rev 8471)
+++
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/PortletWarDeploymentInitializingProcessor.java 2012-02-27
11:46:34 UTC (rev 8472)
@@ -21,7 +21,6 @@
*/
package org.gatein.integration.jboss.as7.deployment;
-import org.gatein.integration.jboss.as7.GateInExtension;
import org.jboss.as.ee.structure.DeploymentType;
import org.jboss.as.ee.structure.DeploymentTypeMarker;
import org.jboss.as.server.deployment.Attachments;
@@ -39,13 +38,7 @@
{
private static final String PORTLET_XML = "WEB-INF/portlet.xml";
- private GateInExtension extension;
- public PortletWarDeploymentInitializingProcessor(GateInExtension extension)
- {
- this.extension = extension;
- }
-
@Override
public void deploy(DeploymentPhaseContext phaseContext) throws
DeploymentUnitProcessingException
{
Modified:
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/WarDependenciesDeploymentProcessor.java
===================================================================
---
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/WarDependenciesDeploymentProcessor.java 2012-02-27
11:31:11 UTC (rev 8471)
+++
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/deployment/WarDependenciesDeploymentProcessor.java 2012-02-27
11:46:34 UTC (rev 8472)
@@ -21,7 +21,6 @@
*/
package org.gatein.integration.jboss.as7.deployment;
-import org.gatein.integration.jboss.as7.GateInExtension;
import org.gatein.integration.jboss.as7.GateInExtensionConfiguration;
import org.jboss.as.server.deployment.DeploymentPhaseContext;
import org.jboss.as.server.deployment.DeploymentUnit;
@@ -32,20 +31,16 @@
import org.jboss.metadata.web.jboss.JBossWebMetaData;
import org.jboss.msc.service.ServiceName;
-import java.lang.Override;import java.lang.String;
+import java.lang.Override;
+import java.lang.String;
/**
* @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
*/
public class WarDependenciesDeploymentProcessor implements DeploymentUnitProcessor
{
- private GateInExtensionConfiguration config;
+ private GateInExtensionConfiguration config = GateInExtensionConfiguration.INSTANCE;
- public WarDependenciesDeploymentProcessor(GateInExtension extension)
- {
- this.config = extension.getConfiguration();
- }
-
private void processWarDeployment(DeploymentUnit du)
{
WarMetaData warMetaData = du.getAttachment(WarMetaData.ATTACHMENT_KEY);
@@ -54,19 +49,25 @@
final JBossWebMetaData metaData = warMetaData.getMergedJBossWebMetaData();
String pathName;
- if (metaData.getContextRoot() == null) {
+ if (metaData.getContextRoot() == null)
+ {
pathName = "/" + du.getName().substring(0, du.getName().length() -
4);
- } else {
+ }
+ else
+ {
pathName = metaData.getContextRoot();
- if ("/".equals(pathName)) {
- pathName = "";
- } else if (pathName.length() > 0 && pathName.charAt(0) !=
'/') {
- pathName = "/" + pathName;
+ if ("/".equals(pathName))
+ {
+ pathName = "";
}
+ else if (pathName.length() > 0 && pathName.charAt(0) != '/')
+ {
+ pathName = "/" + pathName;
+ }
}
final ServiceName deploymentServiceName =
WebSubsystemServices.deploymentServiceName("default-host", pathName);
- config.getChildWars().add(deploymentServiceName);
+ config.addChildWar(deploymentServiceName);
}
@Override
@@ -75,15 +76,14 @@
DeploymentUnit du = phaseContext.getDeploymentUnit();
DeploymentUnit parent = du.getParent();
- if (du.getParent() != null) {
- if (parent.getAttachment(GateInEarKey.KEY) != null
- || parent.getAttachment(GateInExtKey.KEY) != null)
+ if (parent != null)
+ {
+ if (config.isGateInArchive(parent))
{
processWarDeployment(du);
}
}
- else if (du.getAttachment(GateInEarKey.KEY) != null
- || du.getAttachment(GateInExtKey.KEY) != null)
+ else if (config.isGateInArchive(du))
{
processWarDeployment(du);
}
Modified:
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/web/InitService.java
===================================================================
---
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/web/InitService.java 2012-02-27
11:31:11 UTC (rev 8471)
+++
portal/trunk/packaging/jboss-as7/extension/src/main/java/org/gatein/integration/jboss/as7/web/InitService.java 2012-02-27
11:46:34 UTC (rev 8472)
@@ -23,6 +23,7 @@
import org.exoplatform.container.RootContainer;
import org.gatein.integration.jboss.as7.GateInExtension;
+import org.gatein.integration.jboss.as7.GateInExtensionConfiguration;
import org.jboss.as.server.moduleservice.ModuleLoadService;
import org.jboss.as.server.moduleservice.ServiceModuleLoader;
import org.jboss.modules.Module;
@@ -38,19 +39,14 @@
public class InitService implements Service<InitService>
{
- private GateInExtension extension;
+ private GateInExtensionConfiguration config = GateInExtensionConfiguration.INSTANCE;
- public InitService(GateInExtension extension)
- {
- this.extension = extension;
- }
-
@Override
public void start(StartContext context) throws StartException
{
System.out.println("InitService START");
ServiceController<?> svc = context.getController().getServiceContainer()
-
.getRequiredService(ServiceModuleLoader.moduleServiceName(extension.getConfiguration().getGateInEarModule()));
+
.getRequiredService(ServiceModuleLoader.moduleServiceName(config.getGateInEarModule()));
ModuleLoadService modService = (ModuleLoadService) svc.getService();
Module module = modService.getValue();
Modified:
portal/trunk/packaging/jboss-as7/extension/src/main/resources/org/gatein/integration/jboss/as7/LocalDescriptions.properties
===================================================================
---
portal/trunk/packaging/jboss-as7/extension/src/main/resources/org/gatein/integration/jboss/as7/LocalDescriptions.properties 2012-02-27
11:31:11 UTC (rev 8471)
+++
portal/trunk/packaging/jboss-as7/extension/src/main/resources/org/gatein/integration/jboss/as7/LocalDescriptions.properties 2012-02-27
11:46:34 UTC (rev 8472)
@@ -27,3 +27,25 @@
gatein.set-deployment-archives.description=Sets the deployment archives that are part of
GateIn portal installation.
gatein.portlet-war-dependencies.description=Set of dependencies to make available to
portlet wars.
gatein.deployment-archives.archive.services.description=Should META-INF/services
configuration be imported for ServiceLoader to find it?
+
+gatein=GateIn subsystem configuration.
+gatein.add=Adds the GateIn subsystem.
+gatein.remove=Removes gatein subsystem
+gatein.deployment-archive=Set of deployment archives forming a GateIn portal
installation.
+gatein.portlet-war-dependency=Set of dependencies to make available to portlet wars.
+
+deployment-archive.add=Adds deployment archive
+deployment-archive.remove=Removes deployment archive
+deployment-archive.main=Marks archive as main
+deployment-archive=Deployment archive
+portlet-war-dependency=Portlet war dependency
+portlet-war-dependency.add=Adds deployment archive
+portlet-war-dependency.remove=Removes deployment archive
+portlet-war-dependency.import-services=Marks that dependency should also import services
+gatein.portal=GateIn portal defintion
+portal=GateIn portal defintion
+portal.add=Adds portal
+portal.remove=Removes portal
+#gatein.set-deployment-archives.description=Sets the deployment archives that are part of
GateIn portal installation.
+#gatein.portlet-war-dependencies.description=Set of dependencies to make available to
portlet wars.
+#gatein.deployment-archives.archive.services.description=Should META-INF/services
configuration be imported for ServiceLoader to find it?
Added:
portal/trunk/packaging/jboss-as7/extension/src/main/resources/schema/jboss-as-gatein-1.0.xsd
===================================================================
---
portal/trunk/packaging/jboss-as7/extension/src/main/resources/schema/jboss-as-gatein-1.0.xsd
(rev 0)
+++
portal/trunk/packaging/jboss-as7/extension/src/main/resources/schema/jboss-as-gatein-1.0.xsd 2012-02-27
11:46:34 UTC (rev 8472)
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ JBoss, Home of Professional Open Source.
+ ~ Copyright 2011, Red Hat, Inc., 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.
+ -->
+
+<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="urn:jboss:domain:gatein:1.0"
+ xmlns="urn:jboss:domain:gatein:1.0"
+ elementFormDefault="qualified"
+ attributeFormDefault="unqualified"
+ version="1.0">
+
+ <!-- The gatein subsystem root element -->
+ <xs:element name="subsystem" type="gatein-rootType"/>
+
+ <!-- The gatein subsystem configuration -->
+ <xs:complexType name="gatein-rootType">
+ <xs:annotation>
+ <xs:documentation>
+ <![CDATA[
+ The gatein subsystem, used to configure gatein support
+ ]]>
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:sequence>
+ <xs:element minOccurs="0" maxOccurs="1"
name="deployment-archives" type="deploymentArchivesType"/>
+ <xs:element minOccurs="0" maxOccurs="1"
name="portlet-war-dependencies"
type="portletWarDependenciesType"/>
+ </xs:sequence>
+ </xs:complexType>
+
+
+ <xs:complexType name="deploymentArchivesType">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="archive" type="archiveType">
+ <xs:annotation>
+ <xs:documentation>
+ <![CDATA[
+ TODO: Description ...
+ ]]>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:choice>
+ </xs:complexType>
+
+ <xs:complexType name="archiveType">
+ <xs:attribute name="name" use="required"/>
+ <xs:attribute name="main" type="xs:boolean"
use="optional" default="false"/>
+ </xs:complexType>
+
+ <xs:complexType name="portletWarDependenciesType">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="dependency" type="dependencyType">
+ <xs:annotation>
+ <xs:documentation>
+ <![CDATA[
+ TODO: Description ...
+ ]]>
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:choice>
+ </xs:complexType>
+
+ <xs:complexType name="dependencyType">
+ <xs:attribute name="name" use="required"/>
+ <xs:attribute name="import-services" type="xs:boolean"
use="optional" default="false"/>
+ </xs:complexType>
+
+</xs:schema>
Property changes on:
portal/trunk/packaging/jboss-as7/extension/src/main/resources/schema/jboss-as-gatein-1.0.xsd
___________________________________________________________________
Added: svn:executable
+ *
Deleted:
portal/trunk/packaging/jboss-as7/extension/src/main/resources/schema/jboss-gatein.xsd
===================================================================
---
portal/trunk/packaging/jboss-as7/extension/src/main/resources/schema/jboss-gatein.xsd 2012-02-27
11:31:11 UTC (rev 8471)
+++
portal/trunk/packaging/jboss-as7/extension/src/main/resources/schema/jboss-gatein.xsd 2012-02-27
11:46:34 UTC (rev 8472)
@@ -1,89 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ JBoss, Home of Professional Open Source.
- ~ Copyright 2011, Red Hat, Inc., 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.
- -->
-
-<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
- targetNamespace="urn:jboss:domain:gatein:1.0"
- xmlns="urn:jboss:domain:gatein:1.0"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="1.0">
-
- <!-- The gatein subsystem root element -->
- <xs:element name="subsystem" type="gatein-rootType"/>
-
- <!-- The gatein subsystem configuration -->
- <xs:complexType name="gatein-rootType">
- <xs:annotation>
- <xs:documentation>
- <![CDATA[
- The gatein subsystem, used to configure gatein support
- ]]>
- </xs:documentation>
- </xs:annotation>
-
- <xs:sequence>
- <xs:element minOccurs="0" maxOccurs="1"
name="deployment-archives" type="deploymentArchivesType"/>
- <xs:element minOccurs="0" maxOccurs="1"
name="portlet-war-dependencies"
type="portletWarDependenciesType"/>
- </xs:sequence>
- </xs:complexType>
-
-
- <xs:complexType name="deploymentArchivesType">
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element name="archive" type="archiveType">
- <xs:annotation>
- <xs:documentation>
- <![CDATA[
- TODO: Description ...
- ]]>
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:choice>
- </xs:complexType>
-
- <xs:complexType name="archiveType">
- <xs:attribute name="name" use="required"/>
- <xs:attribute name="main" type="xs:boolean"
use="optional" default="false"/>
- </xs:complexType>
-
- <xs:complexType name="portletWarDependenciesType">
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element name="dependency" type="dependencyType">
- <xs:annotation>
- <xs:documentation>
- <![CDATA[
- TODO: Description ...
- ]]>
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:choice>
- </xs:complexType>
-
- <xs:complexType name="dependencyType">
- <xs:attribute name="name" use="required"/>
- <xs:attribute name="import-services" type="xs:boolean"
use="optional" default="false"/>
- </xs:complexType>
-
-</xs:schema>
Modified:
portal/trunk/packaging/jboss-as7/extension/src/test/java/org/gatein/integration/jboss/as7/SubsystemParsingTestCase.java
===================================================================
---
portal/trunk/packaging/jboss-as7/extension/src/test/java/org/gatein/integration/jboss/as7/SubsystemParsingTestCase.java 2012-02-27
11:31:11 UTC (rev 8471)
+++
portal/trunk/packaging/jboss-as7/extension/src/test/java/org/gatein/integration/jboss/as7/SubsystemParsingTestCase.java 2012-02-27
11:46:34 UTC (rev 8472)
@@ -21,24 +21,30 @@
*/
package org.gatein.integration.jboss.as7;
-import junit.framework.Assert;
-import org.gatein.integration.jboss.as7.support.AbstractParsingTest;
-import org.gatein.integration.jboss.as7.support.KernelServices;
-import org.jboss.as.controller.PathAddress;
-import org.jboss.as.controller.PathElement;
-import org.jboss.dmr.ModelNode;
-import org.jboss.dmr.Property;
-import org.junit.Test;
+import org.jboss.as.subsystem.test.*;
-import java.util.List;
+import java.io.IOException;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.*;
-
/**
* @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
*/
-public class SubsystemParsingTestCase extends AbstractParsingTest
+public class SubsystemParsingTestCase extends AbstractSubsystemBaseTest
{
+ private static final String SUBSYSTEM_XML =
+ "<subsystem xmlns=\"" + GateInExtension.NAMESPACE +
"\">\n" +
+ " <deployment-archives>\n" +
+ " <archive name=\"" + Archive.GATEIN.getLocalName() +
"\" main=\"true\" />\n" +
+ " <archive name=\"" +
Archive.GATEIN_SAMPLE_EXTENSION.getLocalName() + "\" />\n" +
+ " <archive name=\"" +
Archive.GATEIN_SAMPLE_PORTAL.getLocalName() + "\" />\n" +
+ " <archive name=\"" +
Archive.GATEIN_SAMPLE_SKIN.getLocalName() + "\" />\n" +
+ " </deployment-archives>\n" +
+ " <portlet-war-dependencies>\n" +
+ " <dependency name=\"" +
Module.ORG_GATEIN_LIB.getLocalName() + "\" import-services=\"true\"
/>\n" +
+ " <dependency name=\"" +
Module.ORG_GATEIN_WCI.getLocalName() + "\" />\n" +
+ " <dependency name=\"" +
Module.JAVAX_PORTLET_API.getLocalName() + "\" />\n" +
+ " </portlet-war-dependencies>\n" +
+ "</subsystem>";
+
static enum Archive
{
GATEIN("gatein.ear"),
@@ -78,198 +84,14 @@
}
}
- /**
- * Tests that the xml is parsed into the correct operations
- */
- @Test
- public void testParseSubsystem() throws Exception
+ public SubsystemParsingTestCase()
{
- //Parse the subsystem xml
- String subsystemXml =
- "<subsystem xmlns=\"" + GateInExtension.NAMESPACE +
"\">\n" +
- " <deployment-archives>\n" +
- " <archive name=\"" +
Archive.GATEIN.getLocalName() + "\" main=\"true\" />\n" +
- " <archive name=\"" +
Archive.GATEIN_SAMPLE_EXTENSION.getLocalName() + "\" />\n" +
- " <archive name=\"" +
Archive.GATEIN_SAMPLE_PORTAL.getLocalName() + "\" />\n" +
- " <archive name=\"" +
Archive.GATEIN_SAMPLE_SKIN.getLocalName() + "\" />\n" +
- " </deployment-archives>\n" +
- " <portlet-war-dependencies>\n" +
- " <dependency name=\"" +
Module.ORG_GATEIN_LIB.getLocalName() + "\" import-services=\"true\"
/>\n" +
- " <dependency name=\"" +
Module.ORG_GATEIN_WCI.getLocalName() + "\" />\n" +
- " <dependency name=\"" +
Module.JAVAX_PORTLET_API.getLocalName() + "\" />\n" +
- " </portlet-war-dependencies>\n" +
- "</subsystem>";
-
- List<ModelNode> operations = super.parse(subsystemXml);
-
- ///Check that we have the expected number of operations
- Assert.assertEquals(1, operations.size());
-
- //Check that the operation has correct content
- //Add subsystem operation is what we expect
- ModelNode addSubsystem = operations.get(0);
- Assert.assertEquals(ADD, addSubsystem.get(OP).asString());
- PathAddress addr = PathAddress.pathAddress(addSubsystem.get(OP_ADDR));
- Assert.assertEquals(1, addr.size());
- PathElement element = addr.getElement(0);
- Assert.assertEquals(SUBSYSTEM, element.getKey());
- Assert.assertEquals(GateInExtension.SUBSYSTEM_NAME, element.getValue());
-
- //We expect to have deployment-archives node set
- ModelNode deploymentArchives = addSubsystem.get(Constants.DEPLOYMENT_ARCHIVES);
- Assert.assertNotNull(Constants.DEPLOYMENT_ARCHIVES, deploymentArchives);
-
- List<Property> archives = deploymentArchives.asPropertyList();
- Assert.assertEquals(Archive.GATEIN.getLocalName(), archives.get(0).getName());
- Assert.assertEquals(Constants.MAIN,
archives.get(0).getValue().asPropertyList().get(0).getName());
- Assert.assertEquals(1, archives.get(0).getValue().asPropertyList().size());
-
- Assert.assertEquals(Archive.GATEIN_SAMPLE_EXTENSION.getLocalName(),
archives.get(1).getName());
- Assert.assertFalse(archives.get(1).getValue().isDefined());
-
- Assert.assertEquals(Archive.GATEIN_SAMPLE_PORTAL.getLocalName(),
archives.get(2).getName());
- Assert.assertFalse(archives.get(2).getValue().isDefined());
-
- Assert.assertEquals(Archive.GATEIN_SAMPLE_SKIN.getLocalName(),
archives.get(3).getName());
- Assert.assertFalse(archives.get(3).getValue().isDefined());
-
-
- ModelNode portletWarDependencies =
addSubsystem.get(Constants.PORTLET_WAR_DEPENDENCIES);
- Assert.assertNotNull(Constants.PORTLET_WAR_DEPENDENCIES, portletWarDependencies);
-
- List<Property> modules = portletWarDependencies.asPropertyList();
- Assert.assertEquals(Module.ORG_GATEIN_LIB.getLocalName(),
modules.get(0).getName());
- Assert.assertEquals(Module.ORG_GATEIN_WCI.getLocalName(),
modules.get(1).getName());
- Assert.assertEquals(Module.JAVAX_PORTLET_API.getLocalName(),
modules.get(2).getName());
+ super(GateInExtension.SUBSYSTEM_NAME, new GateInExtension());
}
- /**
- * Test that the model created from the xml looks as expected
- */
-
- @Test
- public void testInstallIntoController() throws Exception
+ @Override
+ protected String getSubsystemXml() throws IOException
{
- //Parse the subsystem xml and install into the controller
- String subsystemXml =
- "<subsystem xmlns=\"" + GateInExtension.NAMESPACE +
"\">\n" +
- " <deployment-archives>\n" +
- " <archive name=\"" +
Archive.GATEIN.getLocalName() + "\" main=\"true\" />\n" +
- " <archive name=\"" +
Archive.GATEIN_SAMPLE_EXTENSION.getLocalName() + "\" />\n" +
- " <archive name=\"" +
Archive.GATEIN_SAMPLE_PORTAL.getLocalName() + "\" />\n" +
- " <archive name=\"" +
Archive.GATEIN_SAMPLE_SKIN.getLocalName() + "\" />\n" +
- " </deployment-archives>\n" +
- " <portlet-war-dependencies>\n" +
- " <dependency name=\"" +
Module.ORG_GATEIN_LIB.getLocalName() + "\" import-services=\"true\"
/>\n" +
- " <dependency name=\"" +
Module.ORG_GATEIN_WCI.getLocalName() + "\" />\n" +
- " <dependency name=\"" +
Module.JAVAX_PORTLET_API.getLocalName() + "\" />\n" +
- " </portlet-war-dependencies>\n" +
- "</subsystem>";
- KernelServices services = super.installInController(subsystemXml);
-
- //Read the whole model and make sure it looks as expected
- ModelNode model = services.readWholeModel();
- //Useful for debugging :-)
- //System.out.println(model);
-
-
Assert.assertTrue(model.get(SUBSYSTEM).hasDefined(GateInExtension.SUBSYSTEM_NAME));
- model = model.get(SUBSYSTEM, GateInExtension.SUBSYSTEM_NAME);
-
- //We expect to have deployment-archives node set
- ModelNode deploymentArchives = model.get(Constants.DEPLOYMENT_ARCHIVES);
- Assert.assertNotNull(Constants.DEPLOYMENT_ARCHIVES, deploymentArchives);
-
- List<Property> archives = deploymentArchives.asPropertyList();
- Assert.assertEquals(Archive.GATEIN.getLocalName(), archives.get(0).getName());
- Assert.assertEquals(Constants.MAIN,
archives.get(0).getValue().asPropertyList().get(0).getName());
- Assert.assertEquals(1, archives.get(0).getValue().asPropertyList().size());
-
- Assert.assertEquals(Archive.GATEIN_SAMPLE_EXTENSION.getLocalName(),
archives.get(1).getName());
- Assert.assertFalse(archives.get(1).getValue().isDefined());
-
- Assert.assertEquals(Archive.GATEIN_SAMPLE_PORTAL.getLocalName(),
archives.get(2).getName());
- Assert.assertFalse(archives.get(2).getValue().isDefined());
-
- Assert.assertEquals(Archive.GATEIN_SAMPLE_SKIN.getLocalName(),
archives.get(3).getName());
- Assert.assertFalse(archives.get(3).getValue().isDefined());
-
-
- ModelNode portletWarDependencies = model.get(Constants.PORTLET_WAR_DEPENDENCIES);
- Assert.assertNotNull(Constants.PORTLET_WAR_DEPENDENCIES, portletWarDependencies);
-
- List<Property> modules = portletWarDependencies.asPropertyList();
- Assert.assertEquals(Module.ORG_GATEIN_LIB.getLocalName(),
modules.get(0).getName());
- Assert.assertEquals(Module.ORG_GATEIN_WCI.getLocalName(),
modules.get(1).getName());
- Assert.assertEquals(Module.JAVAX_PORTLET_API.getLocalName(),
modules.get(2).getName());
+ return SUBSYSTEM_XML;
}
-
- /**
- * Starts a controller with a given subsystem xml and then checks that a second
- * controller started with the xml marshalled from the first one results in the same
model
- */
-
- @Test
- public void testParseAndMarshalModel() throws Exception
- {
- //Parse the subsystem xml and install into the first controller
- String subsystemXml =
- "<subsystem xmlns=\"" + GateInExtension.NAMESPACE +
"\">\n" +
- " <deployment-archives>\n" +
- " <archive name=\"" +
Archive.GATEIN.getLocalName() + "\" main=\"true\" />\n" +
- " <archive name=\"" +
Archive.GATEIN_SAMPLE_EXTENSION.getLocalName() + "\" />\n" +
- " <archive name=\"" +
Archive.GATEIN_SAMPLE_PORTAL.getLocalName() + "\" />\n" +
- " <archive name=\"" +
Archive.GATEIN_SAMPLE_SKIN.getLocalName() + "\" />\n" +
- " </deployment-archives>\n" +
- " <portlet-war-dependencies>\n" +
- " <dependency name=\"" +
Module.ORG_GATEIN_LIB.getLocalName() + "\" import-services=\"true\"
/>\n" +
- " <dependency name=\"" +
Module.ORG_GATEIN_WCI.getLocalName() + "\" />\n" +
- " <dependency name=\"" +
Module.JAVAX_PORTLET_API.getLocalName() + "\" />\n" +
- " </portlet-war-dependencies>\n" +
- "</subsystem>";
-
- KernelServices servicesA = super.installInController(subsystemXml);
- //Get the model and the persisted xml from the first controller
- ModelNode modelA = servicesA.readWholeModel();
- String marshalled = servicesA.getPersistedSubsystemXml();
-
- //Install the persisted xml from the first controller into a second controller
- KernelServices servicesB = super.installInController(marshalled);
- ModelNode modelB = servicesB.readWholeModel();
-
- //Make sure the models from the two controllers are identical
- super.compare(modelA, modelB);
- }
-
- /**
- * Starts a controller with the given subsystem xml and then checks that a second
- * controller started with the operations from its describe action results in the same
model
- */
-
- @Test
- public void testDescribeHandler() throws Exception
- {
- //Parse the subsystem xml and install into the first controller
- String subsystemXml =
- "<subsystem xmlns=\"" + GateInExtension.NAMESPACE +
"\">" +
- "</subsystem>";
- KernelServices servicesA = super.installInController(subsystemXml);
- //Get the model and the describe operations from the first controller
- ModelNode modelA = servicesA.readWholeModel();
- ModelNode describeOp = new ModelNode();
- describeOp.get(OP).set(DESCRIBE);
- describeOp.get(OP_ADDR).set(
- PathAddress.pathAddress(
- PathElement.pathElement(SUBSYSTEM,
GateInExtension.SUBSYSTEM_NAME)).toModelNode());
- List<ModelNode> operations =
super.checkResultAndGetContents(servicesA.executeOperation(describeOp)).asList();
-
-
- //Install the describe options from the first controller into a second controller
- KernelServices servicesB = super.installInController(operations);
- ModelNode modelB = servicesB.readWholeModel();
-
- //Make sure the models from the two controllers are identical
- super.compare(modelA, modelB);
- }
-
- /* TODO: test invalid configuration detection */
}
Modified: portal/trunk/packaging/jboss-as7/modules/build.xml
===================================================================
--- portal/trunk/packaging/jboss-as7/modules/build.xml 2012-02-27 11:31:11 UTC (rev 8471)
+++ portal/trunk/packaging/jboss-as7/modules/build.xml 2012-02-27 11:46:34 UTC (rev 8472)
@@ -205,9 +205,6 @@
<maven-resource group="org.gatein.captcha"
artifact="simplecaptcha" />
<maven-resource group="org.apache.tika"
artifact="tika-core" />
<maven-resource group="org.apache.tika"
artifact="tika-parsers" />
- <!--maven-resource group="org.gatein.wci"
artifact="wci-exo" />
- <maven-resource group="org.gatein.wci"
artifact="wci-jboss7" />
- <maven-resource group="org.gatein.wci"
artifact="wci-wci" /-->
<maven-resource group="org.apache.ws.commons"
artifact="ws-commons-util" />
<maven-resource group="com.experlog" artifact="xapool"
/>
<maven-resource group="org.apache.xmlbeans"
artifact="xmlbeans" />
@@ -218,7 +215,7 @@
<module-def name="org.gatein.wci">
<maven-resource group="org.gatein.wci"
artifact="wci-jboss7" />
<maven-resource group="org.gatein.wci"
artifact="wci-wci" />
- <maven-resource group="org.gatein.wci"
artifact="wci-exo" />
+ <!--maven-resource group="org.gatein.wci"
artifact="wci-exo" /-->
</module-def>
<module-def name="org.gatein.common">
Modified: portal/trunk/packaging/jboss-as7/modules/pom.xml
===================================================================
--- portal/trunk/packaging/jboss-as7/modules/pom.xml 2012-02-27 11:31:11 UTC (rev 8471)
+++ portal/trunk/packaging/jboss-as7/modules/pom.xml 2012-02-27 11:46:34 UTC (rev 8472)
@@ -45,20 +45,6 @@
</exclusion>
</exclusions>
</dependency>
- <dependency>
- <groupId>org.gatein.wci</groupId>
- <artifactId>wci-jboss6</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.gatein.wci</groupId>
- <artifactId>wci-wci</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss.web</groupId>
- <artifactId>jbossweb</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
<dependency>
<groupId>org.gatein.wci</groupId>
@@ -71,6 +57,13 @@
</exclusions>
</dependency>
+
+ <!-- Gatein wci -->
+ <!--dependency>
+ <groupId>org.gatein.wci</groupId>
+ <artifactId>wci-exo</artifactId>
+ </dependency-->
+
<dependency>
<groupId>org.gatein.common</groupId>
<artifactId>common-common</artifactId>
@@ -664,23 +657,6 @@
<artifactId>common-logging</artifactId>
</dependency>
- <!-- Gatein wci -->
- <dependency>
- <groupId>org.gatein.wci</groupId>
- <artifactId>wci-wci</artifactId>
- </dependency>
- <dependency>
- <groupId>org.gatein.wci</groupId>
- <artifactId>wci-jboss7</artifactId>
- </dependency>
- <dependency>
- <groupId>org.gatein.wci</groupId>
- <artifactId>wci-exo</artifactId>
- </dependency>
-
-
-
-
<!-- Gatein PC -->
<dependency>
<groupId>org.gatein.pc</groupId>
Modified:
portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/modules/org/jboss/as/web/main/module.xml
===================================================================
---
portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/modules/org/jboss/as/web/main/module.xml 2012-02-27
11:31:11 UTC (rev 8471)
+++
portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/modules/org/jboss/as/web/main/module.xml 2012-02-27
11:46:34 UTC (rev 8472)
@@ -23,11 +23,14 @@
-->
<module xmlns="urn:jboss:module:1.1" name="org.jboss.as.web">
+ <properties>
+ <property name="jboss.api" value="private"/>
+ </properties>
<resources>
- <resource-root path="jboss-as-web-7.1.0.CR1b.jar"/>
+ <resource-root path="jboss-as-web-7.1.0.Final.jar"/>
<resource-root path="jasper-jdt-7.0.3.Final.jar"/>
- <resource-root path="jbossweb-7.0.7.Final.jar"/>
+ <resource-root path="jbossweb-7.0.10.Final.jar"/>
<!-- Insert resources here -->
</resources>
@@ -42,6 +45,7 @@
<module name="javax.servlet.jsp.api"/>
<module name="org.jboss.jandex"/>
<module name="org.jboss.staxmapper"/>
+ <module name="org.jboss.as.clustering.api"
optional="true"/>
<module name="org.jboss.as.clustering.web.spi"
optional="true"/>
<module name="org.jboss.as.controller"/>
<module name="org.jboss.as.ee"/>
@@ -51,6 +55,7 @@
<module name="org.jboss.as.server"/>
<module name="org.jboss.as.threads"/>
<module name="org.jboss.invocation"/>
+ <module name="org.jboss.marshalling"/>
<module name="org.jboss.metadata"/>
<module name="org.jboss.modules"/>
<module name="org.jboss.msc"/>
Modified:
portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/configuration/standalone.xml
===================================================================
---
portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/configuration/standalone.xml 2012-02-27
11:31:11 UTC (rev 8471)
+++
portal/trunk/packaging/jboss-as7/pkg/src/main/resources/jboss/standalone/configuration/standalone.xml 2012-02-27
11:46:34 UTC (rev 8472)
@@ -4,11 +4,11 @@
<extensions>
<extension module="org.jboss.as.clustering.infinispan"/>
+ <extension module="org.jboss.as.configadmin"/>
<extension module="org.jboss.as.connector"/>
<extension module="org.jboss.as.deployment-scanner"/>
<extension module="org.jboss.as.ee"/>
<extension module="org.jboss.as.ejb3"/>
- <extension module="org.jboss.as.jaxr"/>
<extension module="org.jboss.as.jaxrs"/>
<extension module="org.jboss.as.jdr"/>
<extension module="org.jboss.as.jmx"/>
@@ -36,6 +36,11 @@
<properties path="mgmt-users.properties"
relative-to="jboss.server.config.dir"/>
</authentication>
</security-realm>
+ <security-realm name="ApplicationRealm">
+ <authentication>
+ <properties path="application-users.properties"
relative-to="jboss.server.config.dir"/>
+ </authentication>
+ </security-realm>
</security-realms>
<management-interfaces>
<native-interface security-realm="ManagementRealm">
@@ -86,13 +91,12 @@
</handlers>
</root-logger>
</subsystem>
+ <subsystem xmlns="urn:jboss:domain:configadmin:1.0"/>
<subsystem xmlns="urn:jboss:domain:datasources:1.0">
<datasources>
- <datasource jndi-name="java:jboss/datasources/ExampleDS"
enabled="true" use-java-context="true"
- pool-name="ExampleDS">
+ <datasource jndi-name="java:jboss/datasources/ExampleDS"
pool-name="ExampleDS" enabled="true"
use-java-context="true">
<connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url>
<driver>h2</driver>
- <pool></pool>
<security>
<user-name>sa</user-name>
<password>sa</password>
@@ -105,8 +109,8 @@
</drivers>
</datasources>
</subsystem>
- <subsystem xmlns="urn:jboss:domain:deployment-scanner:1.0">
- <deployment-scanner scan-interval="5000"
relative-to="jboss.server.base.dir" path="deployments"
deployment-timeout="300"/>
+ <subsystem xmlns="urn:jboss:domain:deployment-scanner:1.1">
+ <deployment-scanner path="deployments"
relative-to="jboss.server.base.dir" scan-interval="5000"
deployment-timeout="300"/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:ee:1.0"/>
<subsystem xmlns="urn:jboss:domain:ejb3:1.2">
@@ -140,43 +144,45 @@
</timer-service>
<remote connector-ref="remoting-connector"
thread-pool-name="default"/>
<thread-pools>
- <thread-pool name="default" max-threads="10"
keepalive-time="100"/>
+ <thread-pool name="default">
+ <max-threads count="10"/>
+ <keepalive-time time="100"
unit="milliseconds"/>
+ </thread-pool>
</thread-pools>
</subsystem>
<subsystem xmlns="urn:jboss:domain:infinispan:1.1"
default-cache-container="hibernate">
<cache-container name="hibernate"
default-cache="local-query">
<local-cache name="entity">
+ <transaction mode="NON_XA"/>
<eviction strategy="LRU"
max-entries="10000"/>
<expiration max-idle="100000"/>
</local-cache>
<local-cache name="local-query">
+ <transaction mode="NONE"/>
<eviction strategy="LRU"
max-entries="10000"/>
<expiration max-idle="100000"/>
</local-cache>
<local-cache name="timestamps">
+ <transaction mode="NONE"/>
<eviction strategy="NONE"/>
</local-cache>
</cache-container>
</subsystem>
- <subsystem xmlns="urn:jboss:domain:jaxr:1.0">
- <connection-factory
jndi-name="java:jboss/jaxr/ConnectionFactory"/>
- <juddi-server publish-url="http://localhost:8080/juddi/publish"
query-url="http://localhost:8080/juddi/query"/>
- </subsystem>
<subsystem xmlns="urn:jboss:domain:jaxrs:1.0"/>
<subsystem xmlns="urn:jboss:domain:jca:1.1">
- <archive-validation enabled="false"/>
+ <archive-validation enabled="true"
fail-on-error="true" fail-on-warn="false"/>
<bean-validation enabled="false"/>
<default-workmanager>
- <short-running-threads blocking="true">
- <core-threads count="10" per-cpu="20"/>
- <queue-length count="10" per-cpu="20"/>
- <max-threads count="10" per-cpu="20"/>
+ <short-running-threads>
+ <core-threads count="50"/>
+ <queue-length count="50"/>
+ <max-threads count="50"/>
<keepalive-time time="10" unit="seconds"/>
</short-running-threads>
- <long-running-threads blocking="true">
- <core-threads count="10" per-cpu="20"/>
- <queue-length count="10" per-cpu="20"/>
- <max-threads count="10" per-cpu="20"/>
+ <long-running-threads>
+ <core-threads count="50"/>
+ <queue-length count="50"/>
+ <max-threads count="50"/>
<keepalive-time time="10" unit="seconds"/>
</long-running-threads>
</default-workmanager>
@@ -184,6 +190,7 @@
<subsystem xmlns="urn:jboss:domain:jdr:1.0"/>
<subsystem xmlns="urn:jboss:domain:jmx:1.1">
<show-model value="true"/>
+ <remoting-connector/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:jpa:1.0">
<jpa default-datasource=""/>
@@ -194,47 +201,25 @@
</mail-session>
</subsystem>
<subsystem xmlns="urn:jboss:domain:naming:1.1"/>
- <subsystem xmlns="urn:jboss:domain:osgi:1.1"
activation="lazy">
- <configuration
pid="org.apache.felix.webconsole.internal.servlet.OsgiManager">
- <property name="manager.root"
value="jboss-osgi"/>
- </configuration>
+ <subsystem xmlns="urn:jboss:domain:osgi:1.2"
activation="lazy">
<properties>
<!-- Specifies the beginning start level of the framework -->
<property
name="org.osgi.framework.startlevel.beginning">1</property>
</properties>
<capabilities>
<!-- modules registered with the OSGi layer on startup -->
- <capability name="javax.api"/>
- <capability name="javax.servlet.api"/>
+ <capability name="javax.servlet.api:v25"/>
<capability name="javax.transaction.api"/>
- <!-- bundles installed on startup -->
- <capability name="org.apache.aries.util"/>
- <capability name="org.jboss.osgi.webconsole"/>
- <capability name="org.osgi.compendium"/>
<!-- bundles started in startlevel 1 -->
<capability name="org.apache.felix.log"
startlevel="1"/>
<capability name="org.jboss.osgi.logging"
startlevel="1"/>
<capability name="org.apache.felix.configadmin"
startlevel="1"/>
<capability name="org.jboss.as.osgi.configadmin"
startlevel="1"/>
- <!-- bundles started in startlevel 2 -->
- <capability name="org.apache.aries.jmx"
startlevel="2"/>
- <capability name="org.apache.felix.eventadmin"
startlevel="2"/>
- <capability name="org.apache.felix.metatype"
startlevel="2"/>
- <capability name="org.apache.felix.scr"
startlevel="2"/>
- <capability name="org.apache.felix.webconsole"
startlevel="2"/>
- <capability name="org.jboss.netty"
startlevel="2"/>
- <capability name="org.jboss.osgi.jmx"
startlevel="2"/>
- <capability name="org.jboss.osgi.http"
startlevel="2"/>
- <capability name="org.projectodd.stilts"
startlevel="2"/>
- <!-- bundles started in startlevel 3 -->
- <capability name="org.jboss.osgi.blueprint"
startlevel="3"/>
- <capability name="org.jboss.osgi.webapp"
startlevel="3"/>
- <capability name="org.jboss.osgi.xerces"
startlevel="3"/>
</capabilities>
</subsystem>
<subsystem xmlns="urn:jboss:domain:pojo:1.0"/>
<subsystem xmlns="urn:jboss:domain:remoting:1.1">
- <connector name="remoting-connector"
socket-binding="remoting"/>
+ <connector name="remoting-connector"
socket-binding="remoting" security-realm="ApplicationRealm"/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:resource-adapters:1.0"/>
<subsystem xmlns="urn:jboss:domain:sar:1.0"/>
@@ -242,7 +227,15 @@
<security-domains>
<security-domain name="other"
cache-type="default">
<authentication>
- <login-module code="UsersRoles"
flag="required"/>
+ <login-module code="Remoting"
flag="optional">
+ <module-option name="password-stacking"
value="useFirstPass"/>
+ </login-module>
+ <login-module code="RealmUsersRoles"
flag="required">
+ <module-option name="usersProperties"
value="${jboss.server.config.dir}/application-users.properties"/>
+ <module-option name="rolesProperties"
value="${jboss.server.config.dir}/application-roles.properties"/>
+ <module-option name="realm"
value="ApplicationRealm"/>
+ <module-option name="password-stacking"
value="useFirstPass"/>
+ </login-module>
</authentication>
</security-domain>
<security-domain name="jboss-web-policy"
cache-type="default">
@@ -291,7 +284,7 @@
</security-domain>
</security-domains>
</subsystem>
- <subsystem xmlns="urn:jboss:domain:threads:1.0"/>
+ <subsystem xmlns="urn:jboss:domain:threads:1.1"/>
<subsystem xmlns="urn:jboss:domain:transactions:1.1">
<core-environment>
<process-id>
@@ -301,35 +294,22 @@
<recovery-environment socket-binding="txn-recovery-environment"
status-socket-binding="txn-status-manager"/>
<coordinator-environment default-timeout="300"/>
</subsystem>
- <subsystem xmlns="urn:jboss:domain:web:1.1"
default-virtual-server="default-host">
+ <subsystem xmlns="urn:jboss:domain:web:1.1"
default-virtual-server="default-host" native="false">
<connector name="http" protocol="HTTP/1.1"
scheme="http" socket-binding="http"/>
<virtual-server name="default-host"
enable-welcome-root="true">
<alias name="localhost"/>
<alias name="example.com"/>
</virtual-server>
</subsystem>
- <subsystem xmlns="urn:jboss:domain:webservices:1.0"
xmlns:javaee="http://java.sun.com/xml/ns/javaee"
xmlns:jaxwsconfig="urn:jboss:jbossws-jaxws-config:4.0">
+ <subsystem xmlns="urn:jboss:domain:webservices:1.1">
<modify-wsdl-address>true</modify-wsdl-address>
<wsdl-host>${jboss.bind.address:127.0.0.1}</wsdl-host>
- <!--
- <wsdl-port>8080</wsdl-port>
- <wsdl-secure-port>8443</wsdl-secure-port>
- -->
- <endpoint-config>
-
<jaxwsconfig:config-name>Standard-Endpoint-Config</jaxwsconfig:config-name>
+ <endpoint-config name="Standard-Endpoint-Config"/>
+ <endpoint-config name="Recording-Endpoint-Config">
+ <pre-handler-chain name="recording-handlers"
protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP
##SOAP12_HTTP_MTOM">
+ <handler name="RecordingHandler"
class="org.jboss.ws.common.invocation.RecordingServerHandler"/>
+ </pre-handler-chain>
</endpoint-config>
- <endpoint-config>
-
<jaxwsconfig:config-name>Recording-Endpoint-Config</jaxwsconfig:config-name>
- <jaxwsconfig:pre-handler-chains>
- <javaee:handler-chain
xmlns="http://java.sun.com/xml/ns/javaee">
- <javaee:protocol-bindings>##SOAP11_HTTP
##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM</javaee:protocol-bindings>
- <javaee:handler>
-
<javaee:handler-name>RecordingHandler</javaee:handler-name>
-
<javaee:handler-class>org.jboss.ws.common.invocation.RecordingServerHandler</javaee:handler-class>
- </javaee:handler>
- </javaee:handler-chain>
- </jaxwsconfig:pre-handler-chains>
- </endpoint-config>
</subsystem>
<subsystem xmlns="urn:jboss:domain:weld:1.0"/>
<subsystem xmlns="urn:jboss:domain:gatein:1.0">
@@ -359,14 +339,9 @@
<socket-binding-group name="standard-sockets"
default-interface="public"
port-offset="${jboss.socket.binding.port-offset:0}">
<socket-binding name="http" port="8080"/>
<socket-binding name="https" port="8443"/>
- <socket-binding name="jacorb" port="3528"/>
- <socket-binding name="jacorb-ssl" port="3529"/>
- <socket-binding name="jmx-connector-registry"
interface="management" port="1090"/>
- <socket-binding name="jmx-connector-server"
interface="management" port="1091"/>
<socket-binding name="management-native"
interface="management"
port="${jboss.management.native.port:9999}"/>
<socket-binding name="management-http"
interface="management" port="${jboss.management.http.port:9990}"/>
- <socket-binding name="messaging" port="5445"/>
- <socket-binding name="messaging-throughput"
port="5455"/>
+ <socket-binding name="management-https"
interface="management"
port="${jboss.management.https.port:9443}"/>
<socket-binding name="osgi-http" interface="management"
port="8090"/>
<socket-binding name="remoting" port="4447"/>
<socket-binding name="txn-recovery-environment"
port="4712"/>
@@ -375,5 +350,4 @@
<remote-destination host="localhost" port="25"/>
</outbound-socket-binding>
</socket-binding-group>
-
-</server>
\ No newline at end of file
+</server>
Modified: portal/trunk/packaging/jboss-as7/pom.xml
===================================================================
--- portal/trunk/packaging/jboss-as7/pom.xml 2012-02-27 11:31:11 UTC (rev 8471)
+++ portal/trunk/packaging/jboss-as7/pom.xml 2012-02-27 11:46:34 UTC (rev 8472)
@@ -1,4 +1,5 @@
-<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.exoplatform.portal</groupId>
@@ -12,40 +13,40 @@
<name>GateIn JBoss AS 7.x.x packaging</name>
<properties>
- <version.jboss.as.release>7.1.0.CR1b</version.jboss.as.release>
- <version.jboss.as>7.1.0.CR1b</version.jboss.as>
- <version.org.jboss.vfs>3.0.0.GA</version.org.jboss.vfs>
-
<version.org.gatein.wci.as7>2.1.0-Beta07-AS7-Beta02</version.org.gatein.wci.as7>
- <version.exo.kernel.as7>2.3.2-GA-AS7-Beta02</version.exo.kernel.as7>
+ <version.jboss.as.release>7.1.0.Final</version.jboss.as.release>
+ <version.jboss.as>7.1.0.Final</version.jboss.as>
+ <version.org.jboss.vfs>3.1.0.Final</version.org.jboss.vfs>
+
<version.org.gatein.wci.as7>2.1.1-Beta03-AS7-Beta03</version.org.gatein.wci.as7>
+ <version.exo.kernel.as7>2.3.6-GA-AS7-Beta03</version.exo.kernel.as7>
<version.org.gatein.naming>1.0.0-Beta01</version.org.gatein.naming>
<exo.projects.app.jboss7.version>jboss-as-${version.jboss.as.release}</exo.projects.app.jboss7.version>
</properties>
<build>
<defaultGoal>package</defaultGoal>
<plugins>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <phase>generate-resources</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks>
- <echo>"
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <echo>"
-DON'T FORGET TO FIRST READ packaging/jboss-as7/README.txt
+ DON'T FORGET TO FIRST READ packaging/jboss-as7/README.txt
-"
-</echo>
- </tasks>
- </configuration>
- </execution>
- </executions>
- </plugin>
+ "
+ </echo>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
@@ -87,6 +88,12 @@
<version>${version.jboss.as}</version>
</dependency>
<dependency>
+ <groupId>org.jboss.as</groupId>
+ <artifactId>jboss-as-subsystem-test</artifactId>
+ <scope>test</scope>
+ <version>${version.jboss.as}</version>
+ </dependency>
+ <dependency>
<groupId>org.jboss</groupId>
<artifactId>jboss-vfs</artifactId>
<version>${version.org.jboss.vfs}</version>
Modified: portal/trunk/packaging/pom.xml
===================================================================
--- portal/trunk/packaging/pom.xml 2012-02-27 11:31:11 UTC (rev 8471)
+++ portal/trunk/packaging/pom.xml 2012-02-27 11:46:34 UTC (rev 8472)
@@ -45,6 +45,7 @@
<module>jetty</module>
<module>jboss-as5</module>
<module>jboss-as6</module>
+ <module>jboss-as7</module>
</modules>
</profile>
<profile>
@@ -54,6 +55,7 @@
<module>jetty</module>
<module>jboss-as5</module>
<module>jboss-as6</module>
+ <module>jboss-as7</module>
</modules>
</profile>
<profile>