Author: mwringe
Date: 2009-04-20 13:44:54 -0400 (Mon, 20 Apr 2009)
New Revision: 13237
Added:
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPConsumerDeploymentImpl.java
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/resources/portal-wsrp-war/WEB-INF/jboss-web.xml
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/resources/tests/test-wsrp-consumer-sar/META-INF/jboss-dependency.xml
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-dependency.xml
Removed:
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeployer.java
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeployerMBean.java
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeployment.java
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeploymentFactory.java
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeploymentMBean.java
Modified:
branches/JBoss_Portal_Branch_2_7_AS5/build/build-thirdparty.xml
branches/JBoss_Portal_Branch_2_7_AS5/build/build.xml
branches/JBoss_Portal_Branch_2_7_AS5/jems/build.xml
branches/JBoss_Portal_Branch_2_7_AS5/server/src/resources/portal-server-sar/META-INF/jboss-service.xml
branches/JBoss_Portal_Branch_2_7_AS5/testsuite/imports/server-config.xml
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/.classpath
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/build.xml
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/main/org/jboss/portal/test/wsrp/deployment/DeploymentTestCase.java
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockConsumerRegistry.java
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/main/org/jboss/portal/wsrp/services/AbstractJNDIServiceFactory.java
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/resources/portal-wsrp-sar/META-INF/jboss-service.xml
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/resources/tests/test-consumer-jar/org/jboss/portal/test/wsrp/consumer/persistent-jboss-beans.xml
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml
Log:
Update wsrp to use the portal deployers.
Modified: branches/JBoss_Portal_Branch_2_7_AS5/build/build-thirdparty.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/build/build-thirdparty.xml 2009-04-20 17:43:21
UTC (rev 13236)
+++ branches/JBoss_Portal_Branch_2_7_AS5/build/build-thirdparty.xml 2009-04-20 17:44:54
UTC (rev 13237)
@@ -112,11 +112,12 @@
<componentref name="jboss/jboss-man"
version="2.0.0.Beta12"/>
<componentref name="jboss/jboss-mdr"
version="2.0.0.Beta15"/> <!-- 5.0.0.GA uses 2.0.1.GA -->
<componentref name="jboss/jboss-metadata"
version="1.0.0-SNAPSHOT"/>
+ <componentref name="jboss/jboss-reflect"
version="2.0.2.GA"/>
<componentref name="jboss/jbossretro-rt"
version="1.0.5.GA"/>
<componentref name="jboss/jbossws" version="2.0.1.SP2"/>
<componentref name="jboss/jbossxb" version="2.0.0.GA"/>
<componentref name="jboss/jbosssx" version="2.0.1.GA"/>
<!-- 5.0.1.GA uses 2.0.2.SP6 -->
- <componentref name="jboss/jnp-client"
version="5.0.0.Beta4"/>
+ <componentref name="jboss/jnpserver"
version="5.0.1.GA"/>
<componentref name="jboss/microcontainer"
version="2.0.0.Beta12"/>
<componentref name="jboss/remoting"
version="2.2.2.SP10-brew"/>
<componentref name="jboss/serialization"
version="1.0.3.GA-brew"/>
Modified: branches/JBoss_Portal_Branch_2_7_AS5/build/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/build/build.xml 2009-04-20 17:43:21 UTC (rev
13236)
+++ branches/JBoss_Portal_Branch_2_7_AS5/build/build.xml 2009-04-20 17:44:54 UTC (rev
13237)
@@ -303,7 +303,7 @@
<!--<copy file="../core-search/output/lib/portal-search.sar"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/>-->
<copy file="../widget/output/lib/portal-widget.war"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/>
<copy file="../widget/output/lib/portal-widget-netvibes.war"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/>
-<!-- <copy file="../wsrp/output/lib/portal-wsrp.sar"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/> -->
+ <copy file="../wsrp/output/lib/portal-wsrp.sar"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/>
</target>
<target name="undeploy-all"
@@ -325,7 +325,7 @@
<!--<delete
file="${jboss.home}/server/${portal.deploy.dir}/portal-search.sar"/>-->
<delete
file="${jboss.home}/server/${portal.deploy.dir}/portal-widget.war"/>
<delete
file="${jboss.home}/server/${portal.deploy.dir}/portal-widget-netvibes.war"/>
-<!-- <delete
file="${jboss.home}/server/${portal.deploy.dir}/portal-wsrp.sar"/> -->
+ <delete
file="${jboss.home}/server/${portal.deploy.dir}/portal-wsrp.sar"/>
</target>
<target name="exploded-deploy"
Modified: branches/JBoss_Portal_Branch_2_7_AS5/jems/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/jems/build.xml 2009-04-20 17:43:21 UTC (rev
13236)
+++ branches/JBoss_Portal_Branch_2_7_AS5/jems/build.xml 2009-04-20 17:44:54 UTC (rev
13237)
@@ -98,10 +98,11 @@
<path refid="jboss.microcontainer.classpath"/>
<path refid="jboss/common.core.classpath"/>
<path refid="jboss/common.logging.spi.classpath"/>
- <path refid="jboss/jnp.client.classpath"/>
+ <path refid="jboss.jnpserver.classpath"/>
<path refid="jbossas/core.libs.classpath"/>
<path refid="hibernate.hibernate.classpath"/>
<path refid="apache.log4j.classpath"/>
+ <path refid="sun.jaxb.classpath"/>
</path>
<!-- Configure modules -->
Modified:
branches/JBoss_Portal_Branch_2_7_AS5/server/src/resources/portal-server-sar/META-INF/jboss-service.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_7_AS5/server/src/resources/portal-server-sar/META-INF/jboss-service.xml 2009-04-20
17:43:21 UTC (rev 13236)
+++
branches/JBoss_Portal_Branch_2_7_AS5/server/src/resources/portal-server-sar/META-INF/jboss-service.xml 2009-04-20
17:44:54 UTC (rev 13237)
@@ -54,15 +54,15 @@
</mbean>
<!-- Server deployer -->
- <mbean
+<!-- <mbean
code="org.jboss.portal.server.deployment.jboss.ServerDeployer"
name="portal:deployer=PortalWebApp">
<depends>jboss.system:service=MainDeployer</depends>
<depends optional-attribute-name="PortalServer"
proxy-type="attribute">portal:service=Server</depends>
- </mbean>
+ </mbean> -->
<!-- Adapt the web app to the server deployer -->
- <mbean
+<!-- <mbean
code="org.jboss.portal.server.deployment.WebAppAdapter"
name="portal:deployer=Adapter"
xmbean-dd=""
@@ -70,16 +70,16 @@
<xmbean/>
<depends optional-attribute-name="Deployer"
proxy-type="attribute">portal:deployer=PortalWebApp</depends>
<depends
optional-attribute-name="InterceptedDeployer">jboss.web:service=WebServer</depends>
- </mbean>
+ </mbean> -->
<!-- Web app enhancer -->
- <mbean
+<!-- <mbean
code="org.jboss.portal.server.deployment.WebAppEnhancer"
name="portal:service=Deployer,type=Enhancer"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
<depends
optional-attribute-name="InterceptedDeployer">jboss.web:service=WebServer</depends>
- </mbean>
+ </mbean> -->
-</server>
\ No newline at end of file
+</server>
Modified: branches/JBoss_Portal_Branch_2_7_AS5/testsuite/imports/server-config.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/testsuite/imports/server-config.xml 2009-04-20
17:43:21 UTC (rev 13236)
+++ branches/JBoss_Portal_Branch_2_7_AS5/testsuite/imports/server-config.xml 2009-04-20
17:44:54 UTC (rev 13237)
@@ -94,7 +94,7 @@
<server:config javaHome="${env.JAVA_HOME}"
jbossHome="${jboss.dist}" udpGroup="${udpGroup}">
<server name="default" host="${node0}">
<jvmarg value="${jpda.cmdline}"/>
- <jvmarg value="-Xmx128m"/>
+ <jvmarg value="-Xmx256m"/>
<sysproperty key="java.endorsed.dirs"
value="${jboss.dist}/lib/endorsed"/>
</server>
</server:config>
Modified: branches/JBoss_Portal_Branch_2_7_AS5/wsrp/.classpath
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/wsrp/.classpath 2009-04-20 17:43:21 UTC (rev
13236)
+++ branches/JBoss_Portal_Branch_2_7_AS5/wsrp/.classpath 2009-04-20 17:44:54 UTC (rev
13237)
@@ -38,5 +38,8 @@
<classpathentry kind="lib"
path="/thirdparty/jboss/common-core/lib/jboss-common-core.jar"/>
<classpathentry kind="lib"
path="/thirdparty/jboss/jbossws/lib/jboss-jaxrpc.jar"/>
<classpathentry kind="lib"
path="/thirdparty/jboss/microcontainer/lib/jboss-kernel.jar"/>
+ <classpathentry kind="lib"
path="/thirdparty/jboss-portal/modules/deployer/lib/portal-deployer-wsrp-lib.jar"
sourcepath="/module-deployer"/>
+ <classpathentry kind="lib"
path="/thirdparty/jboss-portal/modules/metadata/lib/portal-metadata-wsrp-lib.jar"/>
+ <classpathentry kind="lib"
path="/thirdparty/jboss-portal/modules/deployer/lib/portal-deployer-lib.jar"/>
<classpathentry kind="output" path="output/classes"/>
</classpath>
Modified: branches/JBoss_Portal_Branch_2_7_AS5/wsrp/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/wsrp/build.xml 2009-04-20 17:43:21 UTC (rev
13236)
+++ branches/JBoss_Portal_Branch_2_7_AS5/wsrp/build.xml 2009-04-20 17:44:54 UTC (rev
13237)
@@ -96,6 +96,8 @@
<property name="jboss.deploy.dir"
value="${jboss.home}/server/${portal.deploy.dir}"/>
<!-- Lib directory for current JBoss configuration -->
<property name="jboss.deploy.lib.dir"
value="${jboss.deploy.dir}/../lib"/>
+ <property name="jboss.common.lib.dir"
value="${jboss.home}/common/lib"/>
+ <property name="jboss.lib.dir"
value="${jboss.home}/lib"/>
<!-- Configure thirdparty libraries --> &libraries;
&libraries-as5;
@@ -106,9 +108,12 @@
<path refid="jboss.portal/modules/common.classpath"/>
<path refid="jboss.portal/modules/portlet.classpath"/>
<path refid="jboss.portal/modules/test.classpath"/>
+ <path refid="jboss.portal/modules/metadata.classpath"/>
+ <path refid="jboss.portal/modules/deployer.classpath"/>
<path refid="oswego.concurrent.classpath"/>
<path refid="junit.junit.classpath"/>
<path refid="sun.servlet.classpath"/>
+ <path refid="sun.jaxb.classpath"/>
<path refid="glassfish.jaf.classpath"/>
<pathelement
path="${jbossas/core.libs.lib}/jboss-common-core.jar"/>
<pathelement path="${jbossas/core.libs.lib}/jboss-jmx.jar"/>
@@ -141,13 +146,18 @@
<path refid="jboss.portal/modules/portlet.classpath"/>
<pathelement
location="${jboss.portal/modules/test.lib}/portal-test-jboss-lib.jar"/>
<path refid="jboss.microcontainer.classpath"/>
- <pathelement path="${jboss.deploy.lib.dir}/log4j.jar"/>
+ <pathelement path="${jboss.common.lib.dir}/log4j.jar"/>
<path refid="apache.xerces.classpath"/>
- <pathelement path="${jboss.deploy.lib.dir}/jnpserver.jar"/>
- <pathelement
path="${jboss.deploy.lib.dir}/jmx-adaptor-plugin.jar"/>
- <pathelement path="${jboss.deploy.lib.dir}/jboss.jar"/>
- <pathelement path="${jboss.deploy.lib.dir}/jbosssx.jar"/>
- <pathelement
path="${jboss.deploy.lib.dir}/jboss-transaction.jar"/>
+ <pathelement path="${jboss.common.lib.dir}/jnpserver.jar"/>
+ <pathelement
path="${jboss.common.lib.dir}/jmx-adaptor-plugin.jar"/>
+ <pathelement path="${jboss.common.lib.dir}/jboss.jar"/>
+ <pathelement path="${jboss.common.lib.dir}/jbosssx.jar"/>
+ <pathelement path="${jboss.lib.dir}/jboss-reflect.jar"/>
+ <pathelement
path="${jboss.common.lib.dir}/jbossws-common.jar"/>
+ <pathelement
path="${jboss.common.lib.dir}/jboss-integration.jar"/>
+ <pathelement path="${jboss.common.lib.dir}/jbossjta.jar"/>
+ <pathelement
path="${jboss.common.lib.dir}/jbossts-common.jar"/>
+ <pathelement path="${jboss.common.lib.dir}/jboss-jca.jar"/>
<path refid="jboss.serialization.classpath"/>
<path refid="jboss.remoting.classpath"/>
<path refid="jboss.portal-registration.classpath"/>
@@ -544,8 +554,8 @@
<fileset dir="${jboss.portal-server.root}/lib"
includes="portal-server.sar"/>
</copy>
- <mkdir dir="${build.resources.test}/test-wsrp-producer-sar/lib"/>
- <copy todir="${build.resources.test}/test-wsrp-producer-sar/lib"
overwrite="true">
+ <!--<mkdir
dir="${build.resources.test}/test-wsrp-producer-sar/lib"/>-->
+ <copy todir="${build.resources.test}/test-wsrp-producer-sar"
overwrite="true">
<fileset dir="${build.lib}"
includes="portal-wsrp-lib.jar"/>
<fileset dir="${build.lib.test}"
includes="test-wsrp-producer-lib.jar"/>
<fileset dir="${jboss.portal/modules/common.lib}"
includes="portal-common-portal-lib.jar"/>
@@ -819,7 +829,7 @@
<jvmarg
value="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8787"/>-->
<sysproperty key="test.root"
value="${build.lib}/tests"/>
<sysproperty key="jboss.aop.path"
value="${build.resources}/portal-wsrp-sar/wsrp-aop.xml"/>
- <sysproperty key="jboss.aop.class.path"
value="${jbossas/core.libs.lib}/jboss-aspect-library.jar"/>
+ <!--<sysproperty key="jboss.aop.class.path"
value="${jbossas/core.libs.lib}/jboss-aspect-library.jar"/>-->
</x-sysproperty>
<x-test>
<test todir="${test.reports}"
@@ -860,8 +870,10 @@
<path refid="asm.asm.classpath"/>
<path refid="antlr.antlr.classpath"/>
- <pathelement path="${jboss.deploy.lib.dir}/jboss-jca.jar"/>
- <pathelement
path="${jboss.deploy.lib.dir}/jboss-common-jdbc-wrapper.jar"/>
+ <pathelement path="${jboss.common.lib.dir}/jboss-jca.jar"/>
+ <pathelement
path="${jboss.common.lib.dir}/jboss-common-jdbc-wrapper.jar"/>
+ <pathelement
path="${jboss.lib.dir}/jboss-logging-log4j.jar"/>
+ <pathelement path="${jboss.lib.dir}/jboss-mdr.jar"/>
<!-- not directly available in AS -->
<pathelement
path="${jbossas/core.libs.lib}/jboss-local-jdbc.jar"/>
Modified:
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/main/org/jboss/portal/test/wsrp/deployment/DeploymentTestCase.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/main/org/jboss/portal/test/wsrp/deployment/DeploymentTestCase.java 2009-04-20
17:43:21 UTC (rev 13236)
+++
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/main/org/jboss/portal/test/wsrp/deployment/DeploymentTestCase.java 2009-04-20
17:44:54 UTC (rev 13237)
@@ -22,7 +22,16 @@
******************************************************************************/
package org.jboss.portal.test.wsrp.deployment;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
import junit.framework.TestCase;
+
+import org.jboss.portal.deployer.portal.PortalUnmarshallerFactory;
+import org.jboss.portal.metadata.wsrp.consumer.ConsumerDeploymentsMetaData;
+import org.jboss.portal.metadata.wsrp.consumer.WSRPProducerMetaData;
import org.jboss.portal.test.wsrp.framework.support.MockConsumerRegistry;
import org.jboss.portal.wsrp.WSRPConstants;
import org.jboss.portal.wsrp.WSRPConsumer;
@@ -31,16 +40,9 @@
import org.jboss.portal.wsrp.consumer.RegistrationInfo;
import org.jboss.portal.wsrp.core.Property;
import org.jboss.portal.wsrp.core.RegistrationData;
-import org.jboss.portal.wsrp.deployment.WSRPDeployment;
-import org.jboss.portal.wsrp.deployment.WSRPDeploymentFactory;
-import org.jboss.xb.binding.ObjectModelFactory;
-import org.jboss.xb.binding.Unmarshaller;
-import org.jboss.xb.binding.UnmarshallerFactory;
+import org.jboss.portal.wsrp.deployment.WSRPConsumerDeploymentImpl;
+import org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver;
-import java.net.URL;
-import java.util.Collection;
-import java.util.List;
-
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision$
@@ -52,13 +54,18 @@
{
URL wsrpXMLLocation =
Thread.currentThread().getContextClassLoader().getResource("test-wsrp.xml");
assertNotNull(wsrpXMLLocation);
- Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
MockConsumerRegistry registry = new MockConsumerRegistry();
- ObjectModelFactory factory = new WSRPDeploymentFactory(registry);
- Object o = unmarshaller.unmarshal(wsrpXMLLocation.openStream(), factory, null);
- assertNotNull(o);
- assertTrue(o instanceof WSRPDeployment);
+
+ WSRPConsumerDeploymentImpl wsrpDeploymentImpl = new WSRPConsumerDeploymentImpl();
+ wsrpDeploymentImpl.setConsumerRegistry(registry);
+
+ DefaultSchemaResolver resolver = new DefaultSchemaResolver();
+ resolver.addClassBindingForLocation("deployments",
ConsumerDeploymentsMetaData.class);
+ ConsumerDeploymentsMetaData deployments = (ConsumerDeploymentsMetaData)
PortalUnmarshallerFactory.getInstance().getUnmarshaller().unmarshal(
+ wsrpXMLLocation.openStream(), resolver);
+ wsrpDeploymentImpl.deployConsumer(deployments);
+
Collection consumers = registry.getConfiguredConsumers();
assertNotNull(consumers);
assertEquals(6, consumers.size());
@@ -69,9 +76,8 @@
assertNotNull(registry.getConsumer("inDB2"));
assertNotNull(registry.getConsumer("unavailable"));
- // deployment should only contains the consumers with available service factories
- WSRPDeployment deployment = (WSRPDeployment)o;
- List services = deployment.getConsumers();
+ // deployment should only contains the consumers with available service factories
+ List<WSRPConsumer> services = registry.getActiveConsumers();
assertNotNull(services);
assertEquals(4, services.size());
Modified:
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockConsumerRegistry.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockConsumerRegistry.java 2009-04-20
17:43:21 UTC (rev 13236)
+++
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockConsumerRegistry.java 2009-04-20
17:44:54 UTC (rev 13237)
@@ -44,6 +44,7 @@
public class MockConsumerRegistry implements ConsumerRegistry
{
private Map consumers = new HashMap(3);
+ private List activeConsumers = new ArrayList();
public static final String MOCK_SERVICE_DESCRIPTION =
"mock-service-description";
public static final String MOCK_MARKUP = "mock-markup";
public static final String CONSUMER1 = "inDB";
@@ -90,7 +91,7 @@
public void activateConsumerWith(String id) throws ConsumerException
{
- // do nothing
+ activeConsumers.add(consumers.get(id));
}
public void updateProducerInfo(ProducerInfo producerInfo)
@@ -124,4 +125,9 @@
info.setMarkupURL(MOCK_MARKUP);
consumers.put(CONSUMER2, consumer);
}
+
+ public List getActiveConsumers()
+ {
+ return activeConsumers;
+ }
}
Added:
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPConsumerDeploymentImpl.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPConsumerDeploymentImpl.java
(rev 0)
+++
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPConsumerDeploymentImpl.java 2009-04-20
17:44:54 UTC (rev 13237)
@@ -0,0 +1,246 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.wsrp.deployment;
+
+import org.jboss.logging.Logger;
+import org.jboss.portal.common.util.ParameterValidation;
+import org.jboss.portal.metadata.wsrp.consumer.ConsumerDeploymentsMetaData;
+import org.jboss.portal.metadata.wsrp.consumer.EndpointConfigMetaData;
+import org.jboss.portal.metadata.wsrp.consumer.PropertyMetaData;
+import org.jboss.portal.metadata.wsrp.consumer.RegistrationDataMetaData;
+import org.jboss.portal.metadata.wsrp.consumer.WSRPProducerMetaData;
+import org.jboss.portal.wsrp.WSRPConsumer;
+import org.jboss.portal.wsrp.consumer.ConsumerRegistry;
+import org.jboss.portal.wsrp.consumer.EndpointConfigurationInfo;
+import org.jboss.portal.wsrp.consumer.ProducerInfo;
+import org.jboss.portal.wsrp.consumer.RegistrationInfo;
+
+
+/**
+ * @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
+ * @version $Revision$
+ */
+public class WSRPConsumerDeploymentImpl implements
org.jboss.portal.deployer.wsrp.container.WSRPDeployment
+{
+
+ private final Logger log = Logger.getLogger(getClass());
+
+ protected ConsumerRegistry consumerRegistry;
+
+ public WSRPConsumerDeploymentImpl()
+ {
+
+ }
+
+ public ConsumerRegistry getConsumerRegistry()
+ {
+ return consumerRegistry;
+ }
+
+ public void setConsumerRegistry(ConsumerRegistry consumerRegistry)
+ {
+ this.consumerRegistry = consumerRegistry;
+ }
+
+ public void deployConsumer (ConsumerDeploymentsMetaData deployments)
+ {
+ for (WSRPProducerMetaData producer : deployments.getDeployments())
+ {
+ WSRPConsumer consumer = getConsumer(producer);
+ if (consumer != null)
+ {
+ try
+ {
+ consumerRegistry.activateConsumerWith(consumer.getProducerId());
+ }
+ catch (Exception e)
+ {
+ //ignore and continue
+ }
+ }
+ }
+ }
+
+ private WSRPConsumer getConsumer(WSRPProducerMetaData producer)
+ {
+ String id = producer.getId();
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(id, "producer
identifier", "Configuring a producer");
+ WSRPConsumer consumer = consumerRegistry.getConsumer(id);
+
+ boolean setActivate = false;
+
+ if (consumer != null)
+ {
+ String message = "Added consumer for producer '" + id +
"' with status: ";
+
+ // if consumer is active, add it to the list of services
+ if (consumer.getProducerInfo().isActive())
+ {
+ message += "active";
+ setActivate = true;
+ }
+ else
+ {
+ message += "inactive";
+ }
+
+ log.info(message + " (loaded from database).");
+
+ if (setActivate)
+ {
+ return consumer;
+ }
+ else
+ {
+ return null;
+ }
+ }
+ else if (consumer==null)
+ {
+ Integer expirationCacheSeconds = producer.getExpirationCache();
+ consumer = consumerRegistry.createConsumer(id, expirationCacheSeconds);
+ }
+
+
+ RegistrationInfo registrationInfo =
getRegistrationInfo(producer.getRegistrationData(), consumer.getProducerInfo());
+
+ EndpointConfigurationInfo endpointConf;
+ if (producer.getEndpointWSDLUrl() != null)
+ {
+ endpointConf = getEndpointConf(producer.getEndpointWSDLUrl(),
consumer.getProducerInfo());
+ }
+ else
+ {
+ endpointConf = getEndpointConf(producer.getEndpointConfig(),
consumer.getProducerInfo());
+ }
+
+ ProducerInfo info = consumer.getProducerInfo();
+ log.debug("adding consumer " + info.getId() + " to
deployment.");
+
+ String message;
+ if (consumer.getProducerInfo().getEndpointConfigurationInfo().isAvailable())
+ {
+ message = "Added consumer for producer '" +
consumer.getProducerId() + "' from xml configuration.";
+ setActivate = true;
+ }
+ else
+ {
+ message = "There was a problem initializing the WSRP interface for producer
'"
+ + consumer.getProducerId() + "'. The consumer will NOT be
available.";
+ info.setActive(false);
+ setActivate = false;
+ }
+
+ // update the producer info once the whole information is known
+ try
+ {
+ consumerRegistry.updateProducerInfo(info);
+ }
+ catch (Exception e)
+ {
+ log.info("Couldn't update the ProducerInfo for Consumer '" +
info.getId() + "'", e);
+ //return null;
+ }
+
+ log.info(message);
+ if (setActivate)
+ {
+ return consumer;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+
+ protected EndpointConfigurationInfo getEndpointConf (EndpointConfigMetaData
endpointMetaData, ProducerInfo producerInfo)
+ {
+ EndpointConfigurationInfo endpoint = producerInfo.getEndpointConfigurationInfo();
+
+ String markupURL = endpointMetaData.getMarkupURL();
+ if (markupURL != null)
+ {
+ endpoint.setMarkupURL(markupURL);
+ }
+
+ String portletManagementURL = endpointMetaData.getPortletManagementURL();
+ if (portletManagementURL != null)
+ {
+ endpoint.setPortletManagementURL(portletManagementURL);
+ }
+
+ String registrationURL = endpointMetaData.getRegistrationURL();
+ if (registrationURL != null)
+ {
+ endpoint.setRegistrationURL(registrationURL);
+ }
+
+ String serviceDescriptionURL = endpointMetaData.getServiceDescriptionURL();
+ if (serviceDescriptionURL != null)
+ {
+ endpoint.setServiceDescriptionURL(serviceDescriptionURL);
+ }
+
+ return endpoint;
+ }
+
+ protected EndpointConfigurationInfo getEndpointConf (String wsdlURL, ProducerInfo
producerInfo)
+ {
+ EndpointConfigurationInfo endpoint = producerInfo.getEndpointConfigurationInfo();
+
+ try
+ {
+ endpoint.setWsdlDefinitionURL(wsdlURL);
+ }
+ catch (RuntimeException e)
+ {
+ // ignore at this point if the WSDL cannot be retrieved, another attempt will be
made before persisting
+ }
+ return endpoint;
+ }
+
+ protected RegistrationInfo getRegistrationInfo (RegistrationDataMetaData
registrationMetaData, ProducerInfo producerInfo)
+ {
+ RegistrationInfo registration = new RegistrationInfo(producerInfo);
+
+ if (registrationMetaData != null)
+ {
+ String consumerName = registrationMetaData.getConsumerName();
+ if (consumerName != null)
+ {
+ registration.setConsumerName(consumerName);
+ }
+
+ for (PropertyMetaData property : registrationMetaData.getProperties())
+ {
+ registration.setRegistrationPropertyValue(property.getName(),
property.getValue()).setLang(
+ property.getLang());
+ }
+ }
+
+ return registration;
+ }
+
+}
+
Deleted:
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeployer.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeployer.java 2009-04-20
17:43:21 UTC (rev 13236)
+++
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeployer.java 2009-04-20
17:44:54 UTC (rev 13237)
@@ -1,233 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.wsrp.deployment;
-
-import org.jboss.deployment.DeploymentException;
-import org.jboss.deployment.DeploymentInfo;
-import org.jboss.deployment.SubDeployerSupport;
-import org.jboss.portal.common.xml.NullEntityResolver;
-import org.jboss.portal.wsrp.WSRPConsumer;
-import org.jboss.portal.wsrp.consumer.ConsumerException;
-import org.jboss.portal.wsrp.consumer.ConsumerRegistry;
-import org.jboss.xb.binding.ObjectModelFactory;
-import org.jboss.xb.binding.Unmarshaller;
-import org.jboss.xb.binding.UnmarshallerFactory;
-import org.xml.sax.EntityResolver;
-
-import java.net.URL;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class WSRPDeployer extends SubDeployerSupport implements WSRPDeployerMBean
-{
- /** . */
- private static final String[] DEFAULT_ENHANCED_SUFFIXES = new
String[]{"800:-wsrp.xml"};
-
- public WSRPDeployer()
- {
- setEnhancedSuffixes(DEFAULT_ENHANCED_SUFFIXES);
- }
-
- private ConsumerRegistry consumerRegistry;
-
- /** . */
- private URL deployedDefaultWSRPURL;
-
- /** . */
- private String defaultWSRPLocation;
-
- private EntityResolver entityResolver;
-
- public EntityResolver getEntityResolver()
- {
- return entityResolver;
- }
-
- public void setEntityResolver(EntityResolver entityResolver)
- {
- this.entityResolver = entityResolver;
- }
-
- public ConsumerRegistry getConsumerRegistry()
- {
- return consumerRegistry;
- }
-
- public void setConsumerRegistry(ConsumerRegistry consumerRegistry)
- {
- this.consumerRegistry = consumerRegistry;
- }
-
- public String getDefaultWSRPLocation()
- {
- return defaultWSRPLocation;
- }
-
- public void setDefaultWSRPLocation(String defaultWSRPLocation)
- {
- this.defaultWSRPLocation = defaultWSRPLocation;
- }
-
- public void init(DeploymentInfo di) throws DeploymentException
- {
- super.init(di);
-
- try
- {
- Unmarshaller unmarshaller =
UnmarshallerFactory.newInstance().newUnmarshaller();
- ObjectModelFactory factory = new WSRPDeploymentFactory(consumerRegistry);
- if (entityResolver == null)
- {
- log.debug("Could not obtain entity resolver for WSRPDeployer");
- entityResolver = new NullEntityResolver();
- }
- unmarshaller.setEntityResolver(entityResolver);
- di.metaData = unmarshaller.unmarshal(di.localUrl.openStream(), factory, null);
- }
- catch (Exception e)
- {
- throw new DeploymentException(e);
- }
- }
-
- public void start(DeploymentInfo di) throws DeploymentException
- {
- super.start(di);
- WSRPDeployment deployment = (WSRPDeployment)di.metaData;
- for (Object o : deployment.getConsumers())
- {
- WSRPConsumer consumer = (WSRPConsumer)o;
- try
- {
- consumerRegistry.activateConsumerWith(consumer.getProducerId());
- }
- catch (ConsumerException e)
- {
- // ignore and continue
- }
- }
- }
-
- public void stop(DeploymentInfo di) throws DeploymentException
- {
- WSRPDeployment deployment = (WSRPDeployment)di.metaData;
- for (Object o : deployment.getConsumers())
- {
- try
- {
- WSRPConsumer consumer = (WSRPConsumer)o;
- consumer.stop();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- super.stop(di);
- }
-
- protected void startService() throws Exception
- {
- super.startService();
-
- if (defaultWSRPLocation != null)
- {
- URL defaultWSRPURL =
Thread.currentThread().getContextClassLoader().getResource(defaultWSRPLocation);
- if (defaultWSRPURL != null)
- {
- try
- {
- deployedDefaultWSRPURL = defaultWSRPURL;
-
- mainDeployer.deploy(defaultWSRPURL);
- }
- catch (DeploymentException e)
- {
- e.printStackTrace();
- }
- }
- }
- }
-
- protected void stopService() throws Exception
- {
- if (deployedDefaultWSRPURL != null)
- {
- try
- {
- mainDeployer.undeploy(deployedDefaultWSRPURL);
- }
- catch (DeploymentException e)
- {
- e.printStackTrace();
- }
- }
- super.stopService();
- }
-
- /*
-
-<!--
-
-to reuse if we take the wsrp consumer service and create mbeans out of it, for now
-we only do pojos
-
- <mbean
- code="org.jboss.portal.wsrp.services.SOAPInvokerServiceFactory"
- name="portal.wsrp:service=ServiceFactory,id=self"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.common.system.JBossServiceModelMBean">
- <xmbean/>
- <attribute
name="EndpointURL">http://${jboss.bind.address}:8080/portal-wsrp/</attribute>
- <attribute name="PortJNDIMapping">
-
org.jboss.portal.wsrp.core.WSRP_v1_ServiceDescription_PortType=wsrp-client/service/ServiceDescriptionService
-
org.jboss.portal.wsrp.core.WSRP_v1_Markup_PortType=wsrp-client/service/MarkupService
-
org.jboss.portal.wsrp.core.WSRP_v1_Markup_PortType=wsrp-client/service/RegistrationService
-
org.jboss.portal.wsrp.core.WSRP_v1_Markup_PortType=wsrp-client/service/RegistrationService
- </attribute>
- </mbean>
- <mbean
- code="org.jboss.portal.wsrp.consumer.WSRPConsumerImpl"
- name="portal.wsrp:service=WSRPConsumer,id=self"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.common.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="ServiceFactory"
proxy-type="attribute">portal.wsrp:service=ServiceFactory,id=self</depends>
- </mbean>
- <mbean
-
code="org.jboss.portal.federation.impl.PortletInvokerRegistrationService"
- name="portal:service=PortletInvokerRegistration,id=self"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.common.system.JBossServiceModelMBean">
- <xmbean/>
- <attribute name="Id">self</attribute>
- <depends optional-attribute-name="PortletInvoker"
proxy-type="attribute">portal.wsrp:service=WSRPConsumer,id=self</depends>
- <depends optional-attribute-name="FederatingPortletInvoker"
proxy-type="attribute">portal:service=PortletInvoker,type=Federating</depends>
- </mbean>
--->
-
- */
-
-}
Deleted:
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeployerMBean.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeployerMBean.java 2009-04-20
17:43:21 UTC (rev 13236)
+++
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeployerMBean.java 2009-04-20
17:44:54 UTC (rev 13237)
@@ -1,46 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.wsrp.deployment;
-
-import org.jboss.deployment.SubDeployerExtMBean;
-import org.jboss.portal.wsrp.consumer.ConsumerRegistry;
-import org.xml.sax.EntityResolver;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public interface WSRPDeployerMBean extends SubDeployerExtMBean
-{
- String getDefaultWSRPLocation();
-
- void setDefaultWSRPLocation(String defaultWSRPLocation);
-
- ConsumerRegistry getConsumerRegistry();
-
- void setConsumerRegistry(ConsumerRegistry consumerRegistry);
-
- EntityResolver getEntityResolver();
-
- void setEntityResolver(EntityResolver entityResolver);
-}
Deleted:
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeployment.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeployment.java 2009-04-20
17:43:21 UTC (rev 13236)
+++
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeployment.java 2009-04-20
17:44:54 UTC (rev 13237)
@@ -1,47 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.wsrp.deployment;
-
-import org.jboss.system.ServiceMBeanSupport;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class WSRPDeployment extends ServiceMBeanSupport implements WSRPDeploymentMBean
-{
- private final List services;
-
- public WSRPDeployment()
- {
- services = new ArrayList();
- }
-
- public List getConsumers()
- {
- return services;
- }
-}
Deleted:
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeploymentFactory.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeploymentFactory.java 2009-04-20
17:43:21 UTC (rev 13236)
+++
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeploymentFactory.java 2009-04-20
17:44:54 UTC (rev 13237)
@@ -1,355 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.wsrp.deployment;
-
-import org.jboss.logging.Logger;
-import org.jboss.portal.common.util.ParameterValidation;
-import org.jboss.portal.wsrp.WSRPConsumer;
-import org.jboss.portal.wsrp.consumer.ConsumerRegistry;
-import org.jboss.portal.wsrp.consumer.EndpointConfigurationInfo;
-import org.jboss.portal.wsrp.consumer.ProducerInfo;
-import org.jboss.portal.wsrp.consumer.RegistrationInfo;
-import org.jboss.util.StringPropertyReplacer;
-import org.jboss.xb.binding.GenericObjectModelFactory;
-import org.jboss.xb.binding.UnmarshallingContext;
-import org.xml.sax.Attributes;
-
-/**
- * Wire the mbeans to install
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class WSRPDeploymentFactory implements GenericObjectModelFactory
-{
- private final Logger log = Logger.getLogger(getClass());
-
- private ConsumerRegistry consumerRegistry;
-
- private static final boolean DEBUG = false;
-
- /** . */
- private static final String WSRP_PRODUCER = "wsrp-producer";
-
- public static class Property
- {
- String name;
- String value;
- String lang;
- }
-
- public WSRPDeploymentFactory(ConsumerRegistry consumerRegistry)
- {
- this.consumerRegistry = consumerRegistry;
- }
-
- public Object newRoot(Object root, UnmarshallingContext nav, String nsURI, String
localName, Attributes attrs)
- {
- return new WSRPDeployment();
- }
-
- public Object completeRoot(Object root, UnmarshallingContext nav, String nsURI, String
localName)
- {
- return root;
- }
-
- public Object newChild(Object parent, UnmarshallingContext unmarshallingContext,
String nsURI, String localName, Attributes attributes)
- {
- if (parent instanceof WSRPDeployment)
- {
- return newChild((WSRPDeployment)parent, unmarshallingContext, nsURI, localName,
attributes);
- }
- if (parent instanceof RegistrationInfo)
- {
- return newChild((RegistrationInfo)parent, unmarshallingContext, nsURI,
localName, attributes);
- }
- if (parent instanceof WSRPConsumer)
- {
- return newChild((WSRPConsumer)parent, unmarshallingContext, nsURI, localName,
attributes);
- }
- return null;
- }
-
- public void addChild(Object parent, Object child, UnmarshallingContext
unmarshallingContext, String nsURI, String localName)
- {
- if (parent instanceof RegistrationInfo && child instanceof Property)
- {
- addChild((RegistrationInfo)parent, (Property)child, unmarshallingContext, nsURI,
localName);
- }
- else if (parent instanceof WSRPDeployment && child instanceof
WSRPConsumer)
- {
- addChild((WSRPDeployment)parent, (WSRPConsumer)child, unmarshallingContext,
nsURI, localName);
- }
- }
-
- public void setValue(Object parent, UnmarshallingContext unmarshallingContext, String
nsURI, String localName, String value)
- {
- if (parent instanceof EndpointConfigurationInfo)
- {
- setValue((EndpointConfigurationInfo)parent, unmarshallingContext, nsURI,
localName, value);
- }
- else if (parent instanceof Property)
- {
- setValue((Property)parent, unmarshallingContext, nsURI, localName, value);
- }
- else if (parent instanceof RegistrationInfo)
- {
- setValue((RegistrationInfo)parent, unmarshallingContext, nsURI, localName,
value);
- }
- }
-
- public Object newChild(WSRPDeployment deployment, UnmarshallingContext nav, String
nsURI, String localName,
- Attributes attrs)
- {
- if (DEBUG)
- {
- System.out.println("newchild deployment " + localName);
- }
-
- if (WSRP_PRODUCER.equals(localName))
- {
- String id = attrs.getValue("id");
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(id, "producer
identifier", "Configuring a producer");
-
- // check that the consumer doesn't exist in the database first
- WSRPConsumer consumer = consumerRegistry.getConsumer(id);
- if (consumer != null)
- {
- String message = "Added consumer for producer '" + id +
"' with status: ";
-
- // if consumer is active, add it to the list of services
- if (consumer.getProducerInfo().isActive())
- {
- deployment.getConsumers().add(consumer);
- message += "active";
- }
- else
- {
- message += "inactive";
- }
-
- log.info(message + " (loaded from database).");
-
- // consumer already exists, do not further process this producer and use the
DB configuration instead
- return null;
- }
-
- String expirationCache = attrs.getValue("expiration-cache");
- Integer expirationCacheSeconds = null;
- if (expirationCache != null)
- {
- try
- {
- expirationCacheSeconds = new Integer(expirationCache);
- }
- catch (NumberFormatException e)
- {
- log.info("Ignoring bad expiration cache value " +
expirationCache + " for producer '" + id + "'");
- }
- }
-
- // consumer didn't exist in the database, so create one and configure it
- consumer = consumerRegistry.createConsumer(id, expirationCacheSeconds);
-
- return consumer;
- }
- else
- {
- return null;
- }
- }
-
- public Object newChild(WSRPConsumer consumer, UnmarshallingContext nav, String nsURI,
String localName,
- Attributes attrs)
- {
- if (DEBUG)
- {
- System.out.println("newchild service " + localName);
- }
-
- ProducerInfo prodInfo = consumer.getProducerInfo();
-
- if ("endpoint-config".equals(localName) ||
"endpoint-wsdl-url".equals(localName))
- {
- return prodInfo.getEndpointConfigurationInfo();
- }
- else if ("registration-data".equals(localName))
- {
- return new RegistrationInfo(prodInfo);
- }
- else
- {
- return null;
- }
- }
-
- public Object newChild(RegistrationInfo registrationInfo, UnmarshallingContext nav,
String nsURI, String localName,
- Attributes attrs)
- {
- if (DEBUG)
- {
- System.out.println("newChild registrationInfo " + localName);
- }
-
- if ("property".equals(localName))
- {
- return new Property();
- }
- return null;
- }
-
- public void setValue(EndpointConfigurationInfo endpointInfo, UnmarshallingContext nav,
String nsURI,
- String localName, String value)
- {
- if (DEBUG)
- {
- System.out.println("setvalue endpointInfo " + localName);
- }
-
- if ("service-description-url".equals(localName))
- {
- // Resolve value that may contain properties for that one
- value = StringPropertyReplacer.replaceProperties(value);
- endpointInfo.setServiceDescriptionURL(value);
- }
- else if ("markup-url".equals(localName))
- {
- // Resolve value that may contain properties for that one
- value = StringPropertyReplacer.replaceProperties(value);
- endpointInfo.setMarkupURL(value);
- }
- else if ("registration-url".equals(localName))
- {
- // Resolve value that may contain properties for that one
- value = StringPropertyReplacer.replaceProperties(value);
- endpointInfo.setRegistrationURL(value);
- }
- else if ("portlet-management-url".equals(localName))
- {
- // Resolve value that may contain properties for that one
- value = StringPropertyReplacer.replaceProperties(value);
- endpointInfo.setPortletManagementURL(value);
- }
- else if ("endpoint-wsdl-url".equals(localName))
- {
- value = StringPropertyReplacer.replaceProperties(value);
- try
- {
- endpointInfo.setWsdlDefinitionURL(value);
- }
- catch (RuntimeException e)
- {
- // ignore at this point if the WSDL cannot be retrieved, another attempt will
be made before persisting
- }
- }
- }
-
- public void setValue(RegistrationInfo registrationInfo, UnmarshallingContext nav,
String nsURI, String localName,
- String value)
- {
- if (DEBUG)
- {
- System.out.println("setvalue registrationinfo " + localName);
- }
-
- if ("consumer-name".equals(localName))
- {
- value = StringPropertyReplacer.replaceProperties(value);
- registrationInfo.setConsumerName(value);
- }
- }
-
- public void setValue(Property property, UnmarshallingContext nav, String nsURI, String
localName, String value)
- {
- if (DEBUG)
- {
- System.out.println("setvalue property " + localName);
- }
-
- if ("name".equals(localName))
- {
- value = StringPropertyReplacer.replaceProperties(value);
- property.name = value;
- }
- else if ("lang".equals(localName))
- {
- value = StringPropertyReplacer.replaceProperties(value);
- property.lang = value;
- }
- else if ("value".equals(localName))
- {
- value = StringPropertyReplacer.replaceProperties(value);
- property.value = value;
- }
- }
-
- public void addChild(RegistrationInfo registrationInfo, Property property,
- UnmarshallingContext nav, String nsURI, String localName)
- {
- if (DEBUG)
- {
- System.out.println("addchild registrationinfo property " +
localName);
- }
-
- registrationInfo.setRegistrationPropertyValue(property.name,
property.value).setLang(property.lang);
- }
-
- public void addChild(WSRPDeployment deployment, WSRPConsumer consumer,
UnmarshallingContext nav, String nsURI,
- String localName)
- {
- ProducerInfo info = consumer.getProducerInfo();
-
- if (DEBUG)
- {
- System.out.println("adding consumer " + info.getId() + " to
deployment - localName: " + localName);
- }
-
- String message;
- if (consumer.getProducerInfo().getEndpointConfigurationInfo().isAvailable())
- {
- message = "Added consumer for producer '" +
consumer.getProducerId() + "' from xml configuration.";
- deployment.getConsumers().add(consumer);
- }
- else
- {
- message = "There was a problem initializing the WSRP interface for producer
'"
- + consumer.getProducerId() + "'. The consumer will NOT be
available.";
- info.setActive(false);
- }
-
- // update the producer info once the whole information is known
- try
- {
- consumerRegistry.updateProducerInfo(info);
- }
- catch (Exception e)
- {
- // if we couldn't update the info, remove it from the list of service to be
activated
- deployment.getConsumers().remove(consumer);
- log.info("Couldn't update the ProducerInfo for Consumer '" +
info.getId() + "'", e);
- return;
- }
-
- log.info(message);
- }
-}
Deleted:
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeploymentMBean.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeploymentMBean.java 2009-04-20
17:43:21 UTC (rev 13236)
+++
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeploymentMBean.java 2009-04-20
17:44:54 UTC (rev 13237)
@@ -1,33 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.wsrp.deployment;
-
-import org.jboss.system.ServiceMBean;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public interface WSRPDeploymentMBean extends ServiceMBean
-{
-}
Modified:
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/main/org/jboss/portal/wsrp/services/AbstractJNDIServiceFactory.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/main/org/jboss/portal/wsrp/services/AbstractJNDIServiceFactory.java 2009-04-20
17:43:21 UTC (rev 13236)
+++
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/main/org/jboss/portal/wsrp/services/AbstractJNDIServiceFactory.java 2009-04-20
17:44:54 UTC (rev 13237)
@@ -66,16 +66,16 @@
DEFAULT_FACTORY_MAPPING = new Properties();
DEFAULT_FACTORY_MAPPING.setProperty(
"org.jboss.portal.wsrp.core.WSRP_v1_ServiceDescription_PortType",
- "wsrp-client/service/ServiceDescriptionService");
+ "wsrp-client/env/service/ServiceDescriptionService");
DEFAULT_FACTORY_MAPPING.setProperty(
"org.jboss.portal.wsrp.core.WSRP_v1_Markup_PortType",
- "wsrp-client/service/MarkupService");
+ "wsrp-client/env/service/MarkupService");
DEFAULT_FACTORY_MAPPING.setProperty(
"org.jboss.portal.wsrp.core.WSRP_v1_Registration_PortType",
- "wsrp-client/service/RegistrationService");
+ "wsrp-client/env/service/RegistrationService");
DEFAULT_FACTORY_MAPPING.setProperty(
"org.jboss.portal.wsrp.core.WSRP_v1_PortletManagement_PortType",
- "wsrp-client/service/PortletManagementService");
+ "wsrp-client/env/service/PortletManagementService");
}
/** A Map recording the mapping between WSRP port type class name and JDNI name of the
implementing service. */
Modified:
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/resources/portal-wsrp-sar/META-INF/jboss-service.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/resources/portal-wsrp-sar/META-INF/jboss-service.xml 2009-04-20
17:43:21 UTC (rev 13236)
+++
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/resources/portal-wsrp-sar/META-INF/jboss-service.xml 2009-04-20
17:44:54 UTC (rev 13237)
@@ -67,39 +67,14 @@
</mbean>
<mbean
- code="org.jboss.portal.server.impl.xml.EntityResolverService"
- name="portal.wsrp:service=EntityResolver"
+ code="org.jboss.portal.wsrp.deployment.WSRPConsumerDeploymentImpl"
+ name="portal.wsrp:service=WSRPDeploymentImpl"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <attribute name="DTDMapping">
- <properties>
- <entry
- key="-//JBoss Portal//DTD WSRP Remote Producer Configuration
2.6//EN">
- dtd/jboss-wsrp-consumer_2_6.dtd
- </entry>
- <entry
- key="-//JBoss Portal//DTD WSRP Local Producer Configuration
2.6//EN">
- dtd/jboss-wsrp-producer_2_6.dtd
- </entry>
- <entry
key="urn:jboss:portal:wsrp:consumer:v2_6">/xsd/jboss-wsrp-consumer_2_6.xsd</entry>
- <entry
key="urn:jboss:portal:wsrp:producer:v2_6">/xsd/jboss-wsrp-consumer_2_6.xsd</entry>
- </properties>
- </attribute>
+ <depends optional-attribute-name="ConsumerRegistry"
proxy-type="attribute">portal.wsrp:service=ConsumerRegistry</depends>
</mbean>
- <!-- Deployer for *-wsrp.xml files. Deploys default-wsrp.xml which contains the
'self' consumer -->
- <mbean code="org.jboss.portal.wsrp.deployment.WSRPDeployer"
name="portal.wsrp:service=WSRPDeployer">
- <attribute
name="DefaultWSRPLocation">default-wsrp.xml</attribute>
- <depends>jboss.system:service=MainDeployer</depends>
- <depends optional-attribute-name="ConsumerRegistry"
- proxy-type="attribute">portal.wsrp:service=ConsumerRegistry
- </depends>
- <depends optional-attribute-name="EntityResolver"
- proxy-type="attribute">portal.wsrp:service=EntityResolver
- </depends>
- </mbean>
-
<mbean
code="org.jboss.portal.jems.hibernate.SessionFactoryBinder"
name="portal:service=Hibernate,type=WSRPConsumer"
Added:
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/resources/portal-wsrp-war/WEB-INF/jboss-web.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/resources/portal-wsrp-war/WEB-INF/jboss-web.xml
(rev 0)
+++
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/resources/portal-wsrp-war/WEB-INF/jboss-web.xml 2009-04-20
17:44:54 UTC (rev 13237)
@@ -0,0 +1,3 @@
+<jboss-web>
+ <context-root>/portal-wsrp</context-root>
+</jboss-web>
Modified:
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/resources/tests/test-consumer-jar/org/jboss/portal/test/wsrp/consumer/persistent-jboss-beans.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/resources/tests/test-consumer-jar/org/jboss/portal/test/wsrp/consumer/persistent-jboss-beans.xml 2009-04-20
17:43:21 UTC (rev 13236)
+++
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/resources/tests/test-consumer-jar/org/jboss/portal/test/wsrp/consumer/persistent-jboss-beans.xml 2009-04-20
17:44:54 UTC (rev 13237)
@@ -24,8 +24,8 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<deployment
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd"
- xmlns="urn:jboss:bean-deployer">
+ xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_2_0.xsd"
+ xmlns="urn:jboss:bean-deployer:2.0">
<bean name="DataSourceConfig"
class="org.jboss.portal.test.framework.embedded.DataSourceSupport$Config">
<constructor factoryMethod="getBean">
@@ -43,7 +43,9 @@
<bean name="JNDISupport"
class="org.jboss.portal.test.framework.embedded.JNDISupport"/>
- <bean name="TransactionManagerSupport"
class="org.jboss.portal.test.framework.embedded.TransactionManagerSupport"/>
+ <bean name="TransactionManagerSupport"
class="org.jboss.portal.test.framework.embedded.TransactionManagerSupport">
+<!-- <demand>TransactionManager</demand> -->
+ </bean>
<bean name="ConnectionManagerSupport"
class="org.jboss.portal.test.framework.embedded.ConnectionManagerSupport">
<property name="transactionManager"><inject
bean="TransactionManagerSupport"
property="transactionManager"/></property>
@@ -57,13 +59,14 @@
</bean>
<bean name="HibernateSupport"
class="org.jboss.portal.test.framework.embedded.HibernateSupport">
+ <demand>TransactionManager</demand>
<property name="config"><inject
bean="HibernateConfig"/></property>
<property name="mappings">
<list elementClass="java.lang.String">
<value>conf/hibernate/consumer/domain.hbm.xml</value>
</list>
</property>
- <property name="jNDIName">java:/SessionFactory</property>
+ <property name="JNDIName">java:/SessionFactory</property>
</bean>
<bean name="FederatingPortletInvoker"
@@ -71,12 +74,14 @@
<bean name="PortalEventListenerRegistry"
class="org.jboss.portal.core.event.PortalEventListenerRegistryImpl"/>
<bean name="ConsumerRegistry"
class="org.jboss.portal.wsrp.consumer.ConsumerRegistryService">
+ <demand>HibernateSupport</demand>
<property
name="sessionFactoryJNDIName">java:/SessionFactory</property>
<property name="federatingPortletInvoker"><inject
bean="FederatingPortletInvoker"/></property>
<property name="portalEventListenerRegistry"><inject
bean="PortalEventListenerRegistry"/></property>
</bean>
<bean name="TestBean"
class="org.jboss.portal.test.wsrp.consumer.ConsumerRegistryTestCase">
+ <depends>TransactionManager</depends>
<constructor factoryMethod="getBean">
<factory bean="BeanFactory"/>
<parameter>TestBean</parameter>
@@ -84,4 +89,9 @@
<property name="hibernate"><inject
bean="HibernateSupport"/></property>
<property name="registry"><inject
bean="ConsumerRegistry"/></property>
</bean>
+
+ <bean name="TransactionManager"
class="javax.transaction.TransactionManager">
+ <constructor factoryClass="com.arjuna.ats.jta.TransactionManager"
factoryMethod="transactionManager"/>
+ </bean>
+
</deployment>
Added:
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/resources/tests/test-wsrp-consumer-sar/META-INF/jboss-dependency.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/resources/tests/test-wsrp-consumer-sar/META-INF/jboss-dependency.xml
(rev 0)
+++
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/resources/tests/test-wsrp-consumer-sar/META-INF/jboss-dependency.xml 2009-04-20
17:44:54 UTC (rev 13237)
@@ -0,0 +1,3 @@
+<dependency xmlns="urn:jboss:dependency:1.0">
+ <item whenRequired="Real"
dependentState="Create">TransactionManager</item>
+</dependency>
Added:
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-dependency.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-dependency.xml
(rev 0)
+++
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-dependency.xml 2009-04-20
17:44:54 UTC (rev 13237)
@@ -0,0 +1,3 @@
+<dependency xmlns="urn:jboss:dependency:1.0">
+ <item whenRequired="Real"
dependentState="Create">TransactionManager</item>
+</dependency>
\ No newline at end of file
Modified:
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml 2009-04-20
17:43:21 UTC (rev 13236)
+++
branches/JBoss_Portal_Branch_2_7_AS5/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml 2009-04-20
17:44:54 UTC (rev 13237)
@@ -37,22 +37,6 @@
<xmbean/>
</mbean>
- <!-- Portlet deployment factory -->
- <mbean
code="org.jboss.portal.portlet.deployment.jboss.PortletAppDeploymentFactory"
- name="portal:deploymentFactory=PortletApp" xmbean-dd=""
-
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="Deployer"
proxy-type="attribute">portal:deployer=PortalWebApp</depends>
- <depends optional-attribute-name="CoreInfoBuilderFactory"
proxy-type="attribute">
- portal:service=InfoBuilderFactory,type=Core
- </depends>
- <depends optional-attribute-name="PortletContainerInvoker"
proxy-type="attribute">
- portal:service=PortletInvoker,type=Container
- </depends>
- <!--<depends optional-attribute-name="WebAppRegistry"
proxy-type="attribute">portal:service=WebAppRegistry</depends>-->
- <depends optional-attribute-name="Config"
proxy-type="attribute">portal:service=ServerConfig</depends>
- </mbean>
-
<!-- Portlet container stack -->
<mbean
code="org.jboss.portal.portlet.aspects.portlet.ContextDispatcherInterceptor"
name="portal:service=Interceptor,type=Portlet,name=ContextDispatcher"
xmbean-dd=""