[jboss-svn-commits] JBL Code SVN: r32779 - in labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA: product/rosetta and 11 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Fri May 7 08:46:20 EDT 2010
Author: kevin.conner at jboss.com
Date: 2010-05-07 08:46:13 -0400 (Fri, 07 May 2010)
New Revision: 32779
Added:
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/java/org/apache/
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/java/org/apache/juddi/
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/java/org/apache/juddi/datastore/
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/java/org/apache/juddi/datastore/jdbc/
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/java/org/apache/juddi/datastore/jdbc/JBossESBDataStore.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry/aspect/ScoutAspect.java
Removed:
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/java/org/apache/juddi/
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/java/org/apache/juddi/datastore/
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/java/org/apache/juddi/datastore/jdbc/
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/java/org/apache/juddi/datastore/jdbc/JBossESBDataStore.java
Modified:
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/build-distr.xml
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry/aspect/JUDDIAspect.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/resources/META-INF/jboss-aop.xml
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/build.xml
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPool.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsSession.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsXASession.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryImpl.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPoolUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServer.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServerMBean.java
labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/src/org/jboss/soa/esb/server/aop/AOPUnitTest.java
Log:
Merge 4.4.0.GA_CP4_CR4 into SOA branch
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/build-distr.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/build-distr.xml 2010-05-07 12:04:17 UTC (rev 32778)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/build-distr.xml 2010-05-07 12:46:13 UTC (rev 32779)
@@ -104,8 +104,11 @@
<copy todir="${build.dir}/jbossesb.sar/lib">
<fileset dir="${lib.ext.dir}" includes="jbossts-common.jar"/>
<fileset dir="${build.lib.dir}" includes="jbossesb*.jar"/>
+ <!-- We use AOP on scout to get around an issue, use the modified jar for now
+ <fileset dir="${lib.dir}" includes="scout-*.jar"/>
+ -->
<!-- scout -->
- <fileset dir="${lib.dir}" includes="scout-*.jar"/>
+ <fileset dir="${aoplib.dir}" includes="scout-*.jar"/>
<!-- xbean for reading/marchalling xml for configuration, and scout -->
<fileset dir="${lib.dir}" includes="xbean*.jar"/>
<fileset dir="${lib.dir}" includes="stax-api-*.jar"/>
Copied: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/java/org/apache (from rev 32778, labs/jbossesb/tags/JBESB_4_4_GA_CP4_CR4/product/rosetta/aop/java/org/apache)
Copied: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/java/org/apache/juddi (from rev 32778, labs/jbossesb/tags/JBESB_4_4_GA_CP4_CR4/product/rosetta/aop/java/org/apache/juddi)
Copied: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/java/org/apache/juddi/datastore (from rev 32778, labs/jbossesb/tags/JBESB_4_4_GA_CP4_CR4/product/rosetta/aop/java/org/apache/juddi/datastore)
Copied: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/java/org/apache/juddi/datastore/jdbc (from rev 32778, labs/jbossesb/tags/JBESB_4_4_GA_CP4_CR4/product/rosetta/aop/java/org/apache/juddi/datastore/jdbc)
Deleted: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/java/org/apache/juddi/datastore/jdbc/JBossESBDataStore.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_4_GA_CP4_CR4/product/rosetta/aop/java/org/apache/juddi/datastore/jdbc/JBossESBDataStore.java 2010-05-07 12:04:17 UTC (rev 32778)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/java/org/apache/juddi/datastore/jdbc/JBossESBDataStore.java 2010-05-07 12:46:13 UTC (rev 32779)
@@ -1,41 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.apache.juddi.datastore.jdbc;
-
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.util.Vector;
-
-import org.apache.juddi.datatype.binding.BindingTemplate;
-
-/**
- * Utility class to provide exposure of juddi internals.
- * @author kevin
- */
-public class JBossESBDataStore
-{
- @SuppressWarnings("unchecked")
- public static Vector<BindingTemplate> selectByServiceKey(final String serviceKey, final Connection connection) throws SQLException
- {
- return BindingTemplateTable.selectByServiceKey(serviceKey,connection);
- }
-}
Copied: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/java/org/apache/juddi/datastore/jdbc/JBossESBDataStore.java (from rev 32778, labs/jbossesb/tags/JBESB_4_4_GA_CP4_CR4/product/rosetta/aop/java/org/apache/juddi/datastore/jdbc/JBossESBDataStore.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/java/org/apache/juddi/datastore/jdbc/JBossESBDataStore.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/java/org/apache/juddi/datastore/jdbc/JBossESBDataStore.java 2010-05-07 12:46:13 UTC (rev 32779)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.apache.juddi.datastore.jdbc;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.util.Vector;
+
+import org.apache.juddi.datatype.binding.BindingTemplate;
+
+/**
+ * Utility class to provide exposure of juddi internals.
+ * @author kevin
+ */
+public class JBossESBDataStore
+{
+ @SuppressWarnings("unchecked")
+ public static Vector<BindingTemplate> selectByServiceKey(final String serviceKey, final Connection connection) throws SQLException
+ {
+ return BindingTemplateTable.selectByServiceKey(serviceKey,connection);
+ }
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry/aspect/JUDDIAspect.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry/aspect/JUDDIAspect.java 2010-05-07 12:04:17 UTC (rev 32778)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry/aspect/JUDDIAspect.java 2010-05-07 12:46:13 UTC (rev 32779)
@@ -21,8 +21,13 @@
*/
package org.jboss.internal.soa.esb.services.registry.aspect;
+import java.sql.Connection;
import java.util.Vector;
+import org.apache.juddi.datastore.jdbc.JBossESBDataStore;
+import org.apache.juddi.datastore.jdbc.JDBCDataStore;
+import org.apache.juddi.datatype.binding.BindingTemplate;
+import org.apache.juddi.datatype.binding.TModelInstanceDetails;
import org.apache.juddi.util.Config;
import org.jboss.aop.joinpoint.MethodCalledByMethodInvocation;
import org.jboss.aop.joinpoint.MethodInvocation;
@@ -67,6 +72,32 @@
return new Vector<Object>() ;
}
+ public Object fetchBindingByServiceKey(final MethodCalledByMethodInvocation invocation)
+ throws Throwable
+ {
+ final JDBCDataStore jdbcDataStore = (JDBCDataStore)invocation.getTargetObject() ;
+ final Object[] args = invocation.getArguments() ;
+ final String serviceKey = (String)args[0] ;
+ final Connection connection = jdbcDataStore.getConnection() ;
+ if (connection != null)
+ {
+ final Vector<BindingTemplate> result = JBossESBDataStore.selectByServiceKey(serviceKey,connection);
+ if (result.size() > 0)
+ {
+ final TModelInstanceDetails dummyDetails = new TModelInstanceDetails() ;
+ for (BindingTemplate bindingTemplate: result)
+ {
+ bindingTemplate.setTModelInstanceDetails(dummyDetails) ;
+ }
+ }
+ return result ;
+ }
+ else
+ {
+ return new Vector(0) ;
+ }
+ }
+
public Object getStringProperty(final MethodCalledByMethodInvocation invocation)
throws Throwable
{
Copied: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry/aspect/ScoutAspect.java (from rev 32778, labs/jbossesb/tags/JBESB_4_4_GA_CP4_CR4/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry/aspect/ScoutAspect.java)
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry/aspect/ScoutAspect.java (rev 0)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry/aspect/ScoutAspect.java 2010-05-07 12:46:13 UTC (rev 32779)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.internal.soa.esb.services.registry.aspect;
+
+import javax.xml.registry.LifeCycleManager;
+import javax.xml.registry.infomodel.Service;
+
+import org.apache.ws.scout.registry.BusinessQueryManagerImpl;
+import org.apache.ws.scout.registry.infomodel.ServiceImpl;
+import org.jboss.aop.joinpoint.MethodCalledByMethodInvocation;
+
+/**
+ * Aspect used to prevent scout from loading the complete service
+ * graph for the registry just to return a binding.
+ *
+ * Updated to intercept calls for the organizational information when
+ * querying a specific service.
+ *
+ * @author <a href='mailto:Kevin.Conner at jboss.com'>Kevin Conner</a>
+ */
+public class ScoutAspect
+{
+ public Object getRegistryObject(final MethodCalledByMethodInvocation invocation)
+ throws Throwable
+ {
+ final BusinessQueryManagerImpl bqmImpl = (BusinessQueryManagerImpl)invocation.getCallingObject() ;
+ final Object[] args = invocation.getArguments() ;
+ final String id = (String)args[0] ;
+ final String objectType = (String)args[1] ;
+
+ if (LifeCycleManager.SERVICE.equals(objectType))
+ {
+ final LifeCycleManager lcm = bqmImpl.getRegistryService().getBusinessLifeCycleManager() ;
+ final Service service = new ServiceImpl(lcm);
+ service.setKey(lcm.createKey(id));
+ return service ;
+ }
+ else
+ {
+ return invocation.invokeNext() ;
+ }
+ }
+}
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/resources/META-INF/jboss-aop.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/resources/META-INF/jboss-aop.xml 2010-05-07 12:04:17 UTC (rev 32778)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/aop/resources/META-INF/jboss-aop.xml 2010-05-07 12:46:13 UTC (rev 32779)
@@ -4,8 +4,13 @@
"http://labs.jboss.com/portal/jbossaop/dtd/jboss-aop_1_0.dtd">
<aop>
+ <aspect class="org.jboss.internal.soa.esb.services.registry.aspect.ScoutAspect" scope="PER_VM"/>
<aspect class="org.jboss.internal.soa.esb.services.registry.aspect.JUDDIAspect" scope="PER_VM"/>
+ <bind pointcut="withincode(* org.apache.ws.scout.registry.BusinessQueryManagerImpl->findServiceBindings(..)) AND call(* org.apache.ws.scout.registry.BusinessQueryManagerImpl->getRegistryObject(..))">
+ <advice name="getRegistryObject" aspect="org.jboss.internal.soa.esb.services.registry.aspect.ScoutAspect"/>
+ </bind>
+
<bind pointcut="execution(* org.apache.juddi.util.xml.XMLUtils->getText(..))">
<advice name="getText" aspect="org.jboss.internal.soa.esb.services.registry.aspect.JUDDIAspect"/>
</bind>
@@ -14,6 +19,10 @@
<advice name="fetchServiceByBusinessKey" aspect="org.jboss.internal.soa.esb.services.registry.aspect.JUDDIAspect"/>
</bind>
+ <bind pointcut="withincode(* org.apache.juddi.datastore.jdbc.JDBCDataStore->fetchService(..)) AND call(* org.apache.juddi.datastore.jdbc.JDBCDataStore->fetchBindingByServiceKey(..))">
+ <advice name="fetchBindingByServiceKey" aspect="org.jboss.internal.soa.esb.services.registry.aspect.JUDDIAspect"/>
+ </bind>
+
<bind pointcut="withincode(* org.apache.juddi.registry.rmi.JNDIRegistration->register()) AND call(* org.apache.juddi.util.Config->getStringProperty(..))">
<advice name="getStringProperty" aspect="org.jboss.internal.soa.esb.services.registry.aspect.JUDDIAspect"/>
</bind>
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/build.xml 2010-05-07 12:04:17 UTC (rev 32778)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/build.xml 2010-05-07 12:46:13 UTC (rev 32779)
@@ -5,6 +5,7 @@
<property name="org.jboss.esb.rosetta.distrib.dir" location="${org.jboss.esb.internal.dest}/jbossesb"/>
<property name="org.jboss.esb.rosetta.classes.dir" location="${org.jboss.esb.internal.dest}/classes/rosetta"/>
<property name="org.jboss.esb.rosetta.aop.classes.dir" location="${org.jboss.esb.rosetta.classes.dir}-aop"/>
+ <property name="org.jboss.esb.rosetta.aopc.scout.classes.dir" location="${org.jboss.esb.rosetta.classes.dir}-scout-aopc"/>
<property name="org.jboss.esb.rosetta.aopc.juddi.classes.dir" location="${org.jboss.esb.rosetta.classes.dir}-juddi-aopc"/>
<property name="org.jboss.esb.rosetta.src.dir" location="src"/>
<property name="org.jboss.esb.root.dir" location="../"/>
@@ -175,12 +176,21 @@
<target name="aop" depends="aop-jar">
<taskdef name="aopc" classname="org.jboss.aop.ant.AopC" classpathref="aop-classpath"/>
+ <delete dir="${org.jboss.esb.rosetta.aopc.scout.classes.dir}" quiet="true"/>
<delete dir="${org.jboss.esb.rosetta.aopc.juddi.classes.dir}" quiet="true"/>
+ <mkdir dir="${org.jboss.esb.rosetta.aopc.scout.classes.dir}"/>
<mkdir dir="${org.jboss.esb.rosetta.aopc.juddi.classes.dir}"/>
+ <unzip src="${org.jboss.esb.lib.dir}/scout-1.0.jar" dest="${org.jboss.esb.rosetta.aopc.scout.classes.dir}"/>
<unzip src="${org.jboss.esb.lib.dir}/juddi-2.0rc5.jar" dest="${org.jboss.esb.rosetta.aopc.juddi.classes.dir}"/>
<aopc compilerclasspathref="aop-classpath">
+ <classpath path="${org.jboss.esb.rosetta.aopc.scout.classes.dir}"/>
+ <src path="${org.jboss.esb.rosetta.aopc.scout.classes.dir}"/>
+ <aoppath path="aop/resources/META-INF/jboss-aop.xml"/>
+ <aopclasspath path="${org.jboss.esb.rosetta.aop.classes.dir}"/>
+ </aopc>
+ <aopc compilerclasspathref="aop-classpath">
<classpath>
<pathelement path="${org.jboss.esb.rosetta.aopc.juddi.classes.dir}"/>
<fileset dir="${org.jboss.esb.ext.lib.dir}" includes="commons-logging*.jar"/>
@@ -192,6 +202,7 @@
<aoppath path="aop/resources/META-INF/jboss-aop.xml"/>
<aopclasspath path="${org.jboss.esb.rosetta.aop.classes.dir}"/>
</aopc>
+ <zip destfile="${org.jboss.esb.aoplib.dir}/scout-1.0.aop.jar" basedir="${org.jboss.esb.rosetta.aopc.scout.classes.dir}"/>
<zip destfile="${org.jboss.esb.aoplib.dir}/juddi-2.0rc5.aop.jar" basedir="${org.jboss.esb.rosetta.aopc.juddi.classes.dir}"/>
</target>
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPool.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPool.java 2010-05-07 12:04:17 UTC (rev 32778)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPool.java 2010-05-07 12:46:13 UTC (rev 32779)
@@ -812,17 +812,15 @@
final JmsSession session ;
if (transacted) {
- session = new JmsXASession(JmsConnectionPool.this, ((XAConnection)currentConnection).createXASession(), currentID);
+ session = new JmsXASession(JmsConnectionPool.this, ((XAConnection)currentConnection).createXASession(), currentID, acknowledgeMode);
} else {
- session = new JmsSession(JmsConnectionPool.this, currentConnection.createSession(transacted, acknowledgeMode), currentID);
+ session = new JmsSession(JmsConnectionPool.this, currentConnection.createSession(transacted, acknowledgeMode), currentID, acknowledgeMode);
}
return session ;
}
}) ;
- //Create a new Session
- ArrayList<JmsSession> freeSessions = freeSessionsMap.get(acknowledgeMode);
// For now we only support JTA transacted sessions
try
{
@@ -989,14 +987,7 @@
}
public void releaseInUseSession(JmsSession session) {
- final int mode ;
- try {
- mode = session.getAcknowledgeMode() ;
- } catch (final JMSException jmse) {
- logger.warn("JMSException while calling getAcknowledgeMode") ;
- logger.debug("JMSException while calling getAcknowledgeMode", jmse) ;
- return ;
- }
+ final int mode = session.getRequestedAcknowledgeMode() ;
final ArrayList<JmsSession> sessions = (inUseSessionsMap == null ? null : inUseSessionsMap.get(mode));
if (sessions != null) {
@@ -1018,14 +1009,7 @@
}
else
{
- final int mode ;
- try {
- mode = session.getAcknowledgeMode() ;
- } catch (final JMSException jmse) {
- logger.warn("JMSException while calling getAcknowledgeMode") ;
- logger.debug("JMSException while calling getAcknowledgeMode", jmse) ;
- return ;
- }
+ final int mode = session.getRequestedAcknowledgeMode() ;
final ArrayList<JmsSession> sessions = (freeSessionsMap == null ? null : freeSessionsMap.get(mode));
if (sessions != null) {
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsSession.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsSession.java 2010-05-07 12:04:17 UTC (rev 32778)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsSession.java 2010-05-07 12:46:13 UTC (rev 32779)
@@ -69,6 +69,11 @@
*/
private final int acknowledgeMode ;
/**
+ * The requested acknowledge mode for this session.
+ */
+ private final int requestedAcknowledgeMode ;
+
+ /**
* Flag indicating whether this session is suspect or not.
*/
private boolean suspect ;
@@ -91,15 +96,16 @@
* @param pool The pool associated with this session.
* @param session The session delegate.
* @param id The pool instance id.
- * @param isJTA True if this tales part in a JTA transaction
+ * @param requestedAcknowledgeMode The requested acknowledge mode for this session.
* @throws JMSException
*/
- JmsSession(final JmsConnectionPool pool, final Session session, final long id)
+ JmsSession(final JmsConnectionPool pool, final Session session, final long id, final int requestedAcknowledgeMode)
throws JMSException
{
this.pool = pool ;
this.id = id ;
this.session = (Session)getExceptionHandler(pool, Session.class, session) ;
+ this.requestedAcknowledgeMode = requestedAcknowledgeMode ;
acknowledgeMode = session.getAcknowledgeMode() ;
// Workaround for JBESB-1873
if ("org.jboss.jms.client.JBossSession".equals(session.getClass().getName()))
@@ -420,6 +426,11 @@
{
return suspect ;
}
+
+ public int getRequestedAcknowledgeMode()
+ {
+ return requestedAcknowledgeMode ;
+ }
/**
* Wrap the object in an exception handler.
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsXASession.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsXASession.java 2010-05-07 12:04:17 UTC (rev 32778)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsXASession.java 2010-05-07 12:46:13 UTC (rev 32779)
@@ -74,12 +74,13 @@
* @param pool The current connection pool
* @param session The session delegate.
* @param id The pool instance id.
+ * @param requestedAcknowledgeMode The requested acknowledge mode for this session.
* @throws JMSException
*/
- JmsXASession(final JmsConnectionPool pool, final XASession session, final long id)
+ JmsXASession(final JmsConnectionPool pool, final XASession session, final long id, final int requestedAcknowledgeMode)
throws JMSException
{
- super(pool, session, id) ;
+ super(pool, session, id, requestedAcknowledgeMode) ;
this.pool = pool ;
this.session = (XASession)getExceptionHandler(pool, XASession.class, session) ;
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryImpl.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryImpl.java 2010-05-07 12:04:17 UTC (rev 32778)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryImpl.java 2010-05-07 12:46:13 UTC (rev 32779)
@@ -75,6 +75,7 @@
private static Logger logger = Logger.getLogger(JAXRRegistryImpl.class);
private JAXRConnectionFactory jaxrConnectionFactory;
private Organization jbossESBOrganization;
+ private ClassificationScheme jbossESBScheme;
private static Concept jbossTModel;
public static final String JBOSS_ESB_CATEGORY = "org.jboss.soa.esb.:category";
@@ -97,10 +98,7 @@
//Adding the category as prefix for the name
service = blm.createService(blm.createInternationalString(serviceName));
service.setDescription(blm.createInternationalString(serviceDescription));
- Collection<String> findQualifiers = new ArrayList<String>();
- findQualifiers.add(FindQualifier.AND_ALL_KEYS);
- findQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
- ClassificationScheme cScheme = bqm.findClassificationSchemeByName(findQualifiers, JBOSS_ESB_CATEGORY);
+ ClassificationScheme cScheme = getClassificationScheme(bqm, blm);
Classification classification = blm.createClassification(cScheme, "category", category);
service.addClassification(classification);
service.setProvidingOrganization(organization);
@@ -172,10 +170,7 @@
serviceBindings.add(serviceBinding);
service.addServiceBindings(serviceBindings);
- Collection<String> findQualifiers = new ArrayList<String>();
- findQualifiers.add(FindQualifier.AND_ALL_KEYS);
- findQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
- ClassificationScheme cScheme = bqm.findClassificationSchemeByName(findQualifiers, JBOSS_ESB_CATEGORY);
+ ClassificationScheme cScheme = getClassificationScheme(bqm, blm);
Classification classification = blm.createClassification(cScheme, "category", category);
service.addClassification(classification);
@@ -202,7 +197,7 @@
+ category + " and name = " + serviceName);
}
Collection serviceBindings = findServiceBindings(service);
- service.addServiceBindings(serviceBindings);
+ String toBeDeletedEPRXml = EPRHelper.toXMLString(toBeDeletedEPR).trim();
for (Iterator i=serviceBindings.iterator();i.hasNext();){
ServiceBinding serviceBinding = (ServiceBinding) i.next();
String eprXML = serviceBinding.getAccessURI().trim();
@@ -218,7 +213,6 @@
logger.error(ue.getMessage(), ue);
}
}
- String toBeDeletedEPRXml = EPRHelper.toXMLString(toBeDeletedEPR).trim();
if (eprXML.equals(toBeDeletedEPRXml)) {
RegistryService rs = connection.getRegistryService();
BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
@@ -300,18 +294,7 @@
//Converting them to EPRs
for (Iterator i=serviceBindings.iterator();i.hasNext();) {
ServiceBinding serviceBinding = (ServiceBinding) i.next();
-
- Collection<String> findQualifiers = new ArrayList<String>();
- findQualifiers.add(FindQualifier.AND_ALL_KEYS);
- findQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
- ClassificationScheme cScheme = bqm.findClassificationSchemeByName(findQualifiers, JBOSS_ESB_CATEGORY);
- Classification classification = blm.createClassification(cScheme, "category", category);
-
- SpecificationLink sl = new SpecificationLinkImpl(blm);
- sl.setSpecificationObject(jbossTModel);
- serviceBinding.getSpecificationLinks().add(sl);
- @SuppressWarnings("unused")
String eprXML = serviceBinding.getAccessURI();
EPR epr = null;
//for backwards compatibility still have the decoder if
@@ -360,9 +343,6 @@
Collection<ServiceBinding> serviceBindings = findServiceBindings(service);
if (serviceBindings.iterator().hasNext()) {
ServiceBinding serviceBinding = (ServiceBinding) serviceBindings.iterator().next();
- SpecificationLink sl = new SpecificationLinkImpl(blm);
- sl.setSpecificationObject(jbossTModel);
- serviceBinding.getSpecificationLinks().add(sl);
String eprXML = serviceBinding.getAccessURI();
// for backwards compatibility still have the decoder if
@@ -456,25 +436,8 @@
RegistryService rs = connection.getRegistryService();
BusinessQueryManager bqm = rs.getBusinessQueryManager();
BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
- // Define find qualifiers and name patterns
- Collection<String> findQualifiers = new ArrayList<String>();
- findQualifiers.add(FindQualifier.AND_ALL_KEYS);
- findQualifiers.add(FindQualifier.EXACT_NAME_MATCH);
- findQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
- ClassificationScheme cScheme = bqm.findClassificationSchemeByName(findQualifiers, JBOSS_ESB_CATEGORY);
+ final ClassificationScheme cScheme = getClassificationScheme(bqm, blm) ;
Collection<Classification> classifications = new ArrayList<Classification>();
- // If the scheme returned null, then we have to create a org.jboss.soa.esb.:category scheme to use
- if (cScheme == null) {
- try {
- ClassificationScheme scheme = blm.createClassificationScheme(JBOSS_ESB_CATEGORY, JBOSS_ESB_CATEGORY);
- ArrayList<ClassificationScheme> cSchemes = new ArrayList<ClassificationScheme>();
- cSchemes.add(scheme);
- BulkResponse br = blm.saveClassificationSchemes(cSchemes);
- } catch (Exception e) {
- throw new JAXRException(e);
- }
- cScheme = bqm.findClassificationSchemeByName(findQualifiers, JBOSS_ESB_CATEGORY);
- }
Classification classification =
blm.createClassification(
cScheme,
@@ -483,6 +446,10 @@
Collection<String> namePatterns = new ArrayList<String>();
namePatterns.add(serviceName);
//Find based upon qualifier type and values
+ Collection<String> findQualifiers = new ArrayList<String>();
+ findQualifiers.add(FindQualifier.AND_ALL_KEYS);
+ findQualifiers.add(FindQualifier.EXACT_NAME_MATCH);
+ findQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
logger.log(Level.DEBUG, "Going to query the registry for name pattern " + namePatterns);
BulkResponse response = bqm.findServices(null, findQualifiers,
namePatterns, classifications, null);
@@ -527,10 +494,7 @@
RegistryService rs = connection.getRegistryService();
BusinessQueryManager bqm = rs.getBusinessQueryManager();
BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
- Collection<String> findQualifiers = new ArrayList<String>();
- findQualifiers.add(FindQualifier.AND_ALL_KEYS);
- findQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
- ClassificationScheme cScheme = bqm.findClassificationSchemeByName(findQualifiers, JBOSS_ESB_CATEGORY);
+ ClassificationScheme cScheme = getClassificationScheme(bqm, blm);
//Create classification
Classification classification =
blm.createClassification(
@@ -538,8 +502,8 @@
"category", category );
// Define find qualifiers and name patterns
- //Collection<String> findQualifiers = new ArrayList<String>();
- //findQualifiers.add(FindQualifier.AND_ALL_KEYS);
+ Collection<String> findQualifiers = new ArrayList<String>();
+ findQualifiers.add(FindQualifier.AND_ALL_KEYS);
findQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
Collection<Classification> classifications = new ArrayList<Classification>();
classifications.add(classification);
@@ -765,6 +729,38 @@
return jbossESBOrganization;
}
+
+ /**
+ * finds the JBossESB category classification scheme and creates one if it is not there.
+ *
+ * @return JBossESB category classification scheme
+ * @throws JAXRException For errors during querying/creating.
+ */
+ private synchronized ClassificationScheme getClassificationScheme(final BusinessQueryManager bqm, final BusinessLifeCycleManager blm) throws JAXRException
+ {
+ if (jbossESBScheme == null) {
+ // Define find qualifiers and name patterns
+ Collection<String> findQualifiers = new ArrayList<String>();
+ findQualifiers.add(FindQualifier.AND_ALL_KEYS);
+ findQualifiers.add(FindQualifier.EXACT_NAME_MATCH);
+ findQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
+ ClassificationScheme cScheme = bqm.findClassificationSchemeByName(findQualifiers, JBOSS_ESB_CATEGORY);
+ // If the scheme returned null, then we have to create a org.jboss.soa.esb.:category scheme to use
+ if (cScheme == null) {
+ try {
+ ClassificationScheme scheme = blm.createClassificationScheme(JBOSS_ESB_CATEGORY, JBOSS_ESB_CATEGORY);
+ ArrayList<ClassificationScheme> cSchemes = new ArrayList<ClassificationScheme>();
+ cSchemes.add(scheme);
+ BulkResponse br = blm.saveClassificationSchemes(cSchemes);
+ } catch (Exception e) {
+ throw new JAXRException(e);
+ }
+ cScheme = bqm.findClassificationSchemeByName(findQualifiers, JBOSS_ESB_CATEGORY);
+ }
+ jbossESBScheme = cScheme ;
+ }
+ return jbossESBScheme ;
+ }
/**
* Find the ServiceBindings for a given Service
@@ -775,6 +771,15 @@
@SuppressWarnings("unchecked")
private Collection<ServiceBinding> findServiceBindings(Service service) throws RegistryException
{
+ final Collection currentBindings ;
+ try {
+ currentBindings = service.getServiceBindings() ;
+ } catch (final JAXRException jaxre) {
+ throw new RegistryException(jaxre.getLocalizedMessage(), jaxre);
+ }
+ if ((currentBindings != null) && (currentBindings.size() > 0)) {
+ return currentBindings;
+ }
if (jbossTModel == null) {
try {
jbossTModel = getJBossESBTModel(jaxrConnectionFactory);
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPoolUnitTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPoolUnitTest.java 2010-05-07 12:04:17 UTC (rev 32778)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/product/rosetta/tests/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPoolUnitTest.java 2010-05-07 12:46:13 UTC (rev 32779)
@@ -63,6 +63,7 @@
/**
* Unit tests for handling JBM specific error conditions in JmsConnectionPool
+ * and JBMQ acknowledge behaviour.
*
* @author <a href='kevin.conner at jboss.com'>Kevin Conner</a>
*/
@@ -98,6 +99,32 @@
}
@Test
+ public void testSessionAcknowledgeBehaviour()
+ throws Exception
+ {
+ MockSessionInvocationHandler.changeAcknowledgeMode = true ;
+ try
+ {
+ final JmsConnectionPool pool = new JmsConnectionPool(getPoolEnv()) ;
+ final int acknowledgeMode = Session.CLIENT_ACKNOWLEDGE ;
+ Assert.assertEquals("current pool free count", 0, pool.getFreeSessionsInPool(acknowledgeMode)) ;
+ Assert.assertEquals("current pool in use count", 0, pool.getInUseSessionsInPool(acknowledgeMode)) ;
+ final JmsSession session = pool.getSession(acknowledgeMode) ;
+ Assert.assertEquals("Session class", JmsSession.class, session.getClass()) ;
+ Assert.assertEquals("current pool free count", 0, pool.getFreeSessionsInPool(acknowledgeMode)) ;
+ Assert.assertEquals("current pool in use count", 1, pool.getInUseSessionsInPool(acknowledgeMode)) ;
+ Assert.assertTrue("Different acknowledge mode", acknowledgeMode != session.getAcknowledgeMode()) ;
+ pool.closeSession(session) ;
+ Assert.assertEquals("current pool free count", 1, pool.getFreeSessionsInPool(acknowledgeMode)) ;
+ Assert.assertEquals("current pool in use count", 0, pool.getInUseSessionsInPool(acknowledgeMode)) ;
+ }
+ finally
+ {
+ MockSessionInvocationHandler.changeAcknowledgeMode = false ;
+ }
+ }
+
+ @Test
public void testSessionRepeatableAcquire()
throws Exception
{
@@ -257,6 +284,36 @@
}
@Test
+ public void testXASessionAcknowledgeBehaviour()
+ throws Exception
+ {
+ final TransactionStrategy transactionStrategy = TransactionStrategy.getTransactionStrategy(true) ;
+ TransactionStrategy.setTransactionStrategy(new MockActiveTransactionStrategy()) ;
+ MockSessionInvocationHandler.changeAcknowledgeMode = true ;
+ try
+ {
+ final JmsConnectionPool pool = new JmsConnectionPool(getPoolEnv()) ;
+ // transactional sessions are requested with transacted acknowledge mode
+ final int acknowledgeMode = Session.SESSION_TRANSACTED ;
+ Assert.assertEquals("current pool free count", 0, pool.getFreeSessionsInPool(acknowledgeMode)) ;
+ Assert.assertEquals("current pool in use count", 0, pool.getInUseSessionsInPool(acknowledgeMode)) ;
+ final JmsSession session = pool.getSession() ;
+ Assert.assertEquals("Session class", JmsXASession.class, session.getClass()) ;
+ Assert.assertEquals("current pool free count", 0, pool.getFreeSessionsInPool(acknowledgeMode)) ;
+ Assert.assertEquals("current pool in use count", 1, pool.getInUseSessionsInPool(acknowledgeMode)) ;
+ Assert.assertTrue("Different acknowledge mode", acknowledgeMode != session.getAcknowledgeMode()) ;
+ pool.closeSession(session) ;
+ Assert.assertEquals("current pool free count", 1, pool.getFreeSessionsInPool(acknowledgeMode)) ;
+ Assert.assertEquals("current pool in use count", 0, pool.getInUseSessionsInPool(acknowledgeMode)) ;
+ }
+ finally
+ {
+ MockSessionInvocationHandler.changeAcknowledgeMode = false ;
+ TransactionStrategy.setTransactionStrategy(transactionStrategy) ;
+ }
+ }
+
+ @Test
public void testXASessionRetry()
throws Exception
{
@@ -550,6 +607,7 @@
{
private final Integer acknowledgeMode ;
static boolean throwFault ;
+ static boolean changeAcknowledgeMode ;
MockSessionInvocationHandler(final Integer acknowledgeMode)
{
@@ -562,7 +620,14 @@
final String methodName = method.getName() ;
if ("getAcknowledgeMode".equals(methodName))
{
- return acknowledgeMode ;
+ if (changeAcknowledgeMode)
+ {
+ return (acknowledgeMode + 1) & 3 ;
+ }
+ else
+ {
+ return acknowledgeMode ;
+ }
}
else if ("createBrowser".equals(methodName))
{
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServer.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServer.java 2010-05-07 12:04:17 UTC (rev 32778)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServer.java 2010-05-07 12:46:13 UTC (rev 32779)
@@ -32,12 +32,18 @@
import javax.xml.registry.JAXRResponse;
import javax.xml.registry.LifeCycleManager;
import javax.xml.registry.RegistryService;
-import javax.xml.registry.infomodel.InternationalString;
import javax.xml.registry.infomodel.Organization;
import javax.xml.registry.infomodel.Service;
import javax.xml.registry.infomodel.ServiceBinding;
+import org.apache.ws.scout.registry.IRegistry;
import org.apache.ws.scout.registry.infomodel.ServiceImpl;
+import org.apache.ws.scout.uddi.BindingTemplate;
+import org.apache.ws.scout.uddi.BindingTemplates;
+import org.apache.ws.scout.uddi.BusinessService;
+import org.apache.ws.scout.uddi.ServiceDetail;
+import org.apache.ws.scout.uddi.TModelInstanceDetails;
+import org.apache.ws.scout.uddi.TModelInstanceInfo;
import org.jboss.internal.soa.esb.addressing.helpers.EPRHelper;
import org.jboss.internal.soa.esb.services.registry.JAXRConnectionFactory;
import org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl;
@@ -137,6 +143,12 @@
return null ;
}
+ public String verifyJuddiPerformanceIssue()
+ throws JAXRException, ConfigurationException, org.apache.ws.scout.registry.RegistryException
+ {
+ return new TestScoutRegistryImpl().checkServiceNestedBindings() ;
+ }
+
private String verifyHeuristic(final String value)
{
final char[] contents = value.toCharArray() ;
@@ -195,56 +207,19 @@
return "could not find service bindings for DeadLetterService" ;
}
- final Class<ServiceImpl> serviceImplClass = ServiceImpl.class ;
- final Field field ;
- try
+ for(ServiceBinding serviceBinding: serviceBindings)
{
- field = serviceImplClass.getDeclaredField("org") ;
- }
- catch (final NoSuchFieldException nsfe)
- {
- return "Could not locate org field" ;
- }
- field.setAccessible(true) ;
- try
- {
- for(ServiceBinding serviceBinding: serviceBindings)
+ final Service bindingService = serviceBinding.getService() ;
+ if (bindingService == null)
{
- final Service bindingService = serviceBinding.getService() ;
- if (bindingService == null)
- {
- return "Could not find service associated with binding" ;
- }
- if (bindingService.getSubmittingOrganization() != null)
- {
- return "FAILED: Submitting organization is present in service binding" ;
- }
- if (!(bindingService instanceof ServiceImpl))
- {
- return "Binding service is not a ServiceImpl, need to change the test" ;
- }
- final ServiceImpl serviceImpl = (ServiceImpl)bindingService ;
- if (serviceImpl.getSubmittingOrganizationKey() == null)
- {
- return "FAILED: Submitting organization key is not present in service binding" ;
- }
- try
- {
- if (field.get(serviceImpl) != null)
- {
- return "FAILED: Organization is present in service binding" ;
- }
- }
- catch (final IllegalAccessException iae)
- {
- return "FAILED: Could not access org field in current service" ;
- }
+ return "Could not find service associated with binding" ;
}
+ final Collection<ServiceBinding> nestedServiceBindings = (Collection<ServiceBinding>)bindingService.getServiceBindings();
+ if ((nestedServiceBindings != null) && (nestedServiceBindings.size() > 0))
+ {
+ return "Nested service contains service bindings for DeadLetterService" ;
+ }
}
- finally
- {
- field.setAccessible(false) ;
- }
return null ;
}
@@ -330,6 +305,93 @@
scoutConnectionFactory.closeConnection(connection) ;
}
}
+
+ public String checkServiceNestedBindings()
+ throws JAXRException, ConfigurationException, org.apache.ws.scout.registry.RegistryException
+ {
+ final String serviceKey ;
+ {
+ final Service service = findService("JBossESB-Internal", "DeadLetterService") ;
+
+ if (service == null)
+ {
+ return "Service not found" ;
+ }
+ serviceKey = service.getKey().getId() ;
+ }
+
+ final IRegistry registry ;
+ final ScoutConnectionFactory scoutConnectionFactory = new ScoutConnectionFactory() ;
+ final Connection connection = scoutConnectionFactory.getConnection();
+ try
+ {
+ final Field field ;
+ try
+ {
+ field = connection.getClass().getDeclaredField("registry") ;
+ }
+ catch (final NoSuchFieldException nsfe)
+ {
+ return "Could not locate org field" ;
+ }
+ field.setAccessible(true) ;
+ try
+ {
+ final Object registryImpl ;
+ try
+ {
+ registryImpl = field.get(connection) ;
+ }
+ catch (final IllegalAccessException iae)
+ {
+ return "FAILED: Could not access org field in current service" ;
+ }
+ if (registryImpl == null)
+ {
+ return "FAILED: Registry implementation is null" ;
+ }
+ if (!(registryImpl instanceof IRegistry))
+ {
+ return "FAILED: Registry implementation is not of correct type";
+ }
+ registry = (IRegistry)registryImpl ;
+ }
+ finally
+ {
+ field.setAccessible(false) ;
+ }
+
+ final ServiceDetail serviceDetail = registry.getServiceDetail(serviceKey) ;
+ final BusinessService[] businessServiceArray = serviceDetail.getBusinessServiceArray() ;
+ if (businessServiceArray == null)
+ {
+ return "FAILED: no business services returned from registry" ;
+ }
+ for (BusinessService businessService: businessServiceArray)
+ {
+ final BindingTemplates bindingTemplates = businessService.getBindingTemplates() ;
+ final BindingTemplate[] bindingTemplateArray = bindingTemplates.getBindingTemplateArray() ;
+ for (BindingTemplate bindingTemplate: bindingTemplateArray)
+ {
+ final TModelInstanceDetails tModelInstanceDetails = bindingTemplate.getTModelInstanceDetails() ;
+ if (tModelInstanceDetails == null)
+ {
+ return "FAILED: Missing tModelInstanceDetails returned from registry" ;
+ }
+ final TModelInstanceInfo[] tModelInstanceInfoArray = tModelInstanceDetails.getTModelInstanceInfoArray() ;
+ if ((tModelInstanceInfoArray != null) && (tModelInstanceInfoArray.length > 0))
+ {
+ return "FAILED: tModelInstanceInfo set, must have come from the database. Should be hidden by AOP" ;
+ }
+ }
+ }
+ }
+ finally
+ {
+ scoutConnectionFactory.closeConnection(connection) ;
+ }
+ return null ;
+ }
}
private static class ScoutConnectionFactory extends JAXRConnectionFactory
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServerMBean.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServerMBean.java 2010-05-07 12:04:17 UTC (rev 32778)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServerMBean.java 2010-05-07 12:46:13 UTC (rev 32779)
@@ -49,4 +49,7 @@
public String verifyOrganizationalStructure()
throws RegistryException, JAXRException, ConfigurationException ;
+
+ public String verifyJuddiPerformanceIssue()
+ throws JAXRException, ConfigurationException, org.apache.ws.scout.registry.RegistryException ;
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/src/org/jboss/soa/esb/server/aop/AOPUnitTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/src/org/jboss/soa/esb/server/aop/AOPUnitTest.java 2010-05-07 12:04:17 UTC (rev 32778)
+++ labs/jbossesb/workspace/platform/JBESB_4_4_SOA_4_3_GA/qa/junit/src/org/jboss/soa/esb/server/aop/AOPUnitTest.java 2010-05-07 12:46:13 UTC (rev 32779)
@@ -75,6 +75,20 @@
}
/**
+ * Test for juddi performance issue, retrieving details bindings while acquiring service.
+ * @throws Exception For any failures.
+ */
+ public void testJuddiPerformanceIssue()
+ throws Exception
+ {
+ final String result = (String)execute("verifyJuddiPerformanceIssue", null, null) ;
+ if (result != null)
+ {
+ fail(result) ;
+ }
+ }
+
+ /**
* Test for juddi CDATA issue..
* @throws Exception For any failures.
*/
More information about the jboss-svn-commits
mailing list