[jboss-svn-commits] JBL Code SVN: r28832 - in labs/jbossesb/branches/JBESB_4_4_GA_CP: product/rosetta and 3 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Aug 5 07:27:13 EDT 2009


Author: kevin.conner at jboss.com
Date: 2009-08-05 07:27:12 -0400 (Wed, 05 Aug 2009)
New Revision: 28832

Removed:
   labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry/aspect/ScoutAspect.java
Modified:
   labs/jbossesb/branches/JBESB_4_4_GA_CP/product/build-distr.xml
   labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/aop/resources/META-INF/jboss-aop.xml
   labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/build.xml
   labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServer.java
Log:
Fix build for HP registry: JBESB-2770

Modified: labs/jbossesb/branches/JBESB_4_4_GA_CP/product/build-distr.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/product/build-distr.xml	2009-08-05 10:38:14 UTC (rev 28831)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/product/build-distr.xml	2009-08-05 11:27:12 UTC (rev 28832)
@@ -102,9 +102,6 @@
         <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"/>
             <!-- xbean for reading/marchalling xml for configuration, and scout -->
@@ -114,7 +111,7 @@
             <!-- We use AOP on juddi to get around an issue, use the modified jar for now
             <fileset dir="${lib.dir}" includes="juddi-*.jar"/>
             -->
-            <fileset dir="${lib.dir}" includes="juddi-*.jar"/>
+            <fileset dir="${aoplib.dir}" includes="juddi-*.jar"/>
             <fileset dir="${lib.dir}" includes="juddi-client*.jar"/>
             <!-- ftp -->
             <fileset dir="${lib.ext.dir}" includes="commons-net-*.jar"/>

Deleted: labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry/aspect/ScoutAspect.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry/aspect/ScoutAspect.java	2009-08-05 10:38:14 UTC (rev 28831)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry/aspect/ScoutAspect.java	2009-08-05 11:27:12 UTC (rev 28832)
@@ -1,71 +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.jboss.internal.soa.esb.services.registry.aspect;
-
-import javax.xml.registry.LifeCycleManager;
-import javax.xml.registry.infomodel.Organization;
-import javax.xml.registry.infomodel.Service;
-
-import org.apache.ws.scout.registry.BusinessQueryManagerImpl;
-import org.apache.ws.scout.registry.infomodel.OrganizationImpl;
-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 if (LifeCycleManager.ORGANIZATION.equals(objectType))
-        {
-            final LifeCycleManager lcm = bqmImpl.getRegistryService().getBusinessLifeCycleManager() ;
-            final Organization organization = new OrganizationImpl(lcm) ;
-            organization.setKey(lcm.createKey(id)) ;
-            return organization ;
-        }
-        else
-        {
-            return invocation.invokeNext() ;
-        }
-    }
-}

Modified: labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/aop/resources/META-INF/jboss-aop.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/aop/resources/META-INF/jboss-aop.xml	2009-08-05 10:38:14 UTC (rev 28831)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/aop/resources/META-INF/jboss-aop.xml	2009-08-05 11:27:12 UTC (rev 28832)
@@ -4,13 +4,8 @@
    "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->getServiceFromBusinessService(..)) 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>

Modified: labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/build.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/build.xml	2009-08-05 10:38:14 UTC (rev 28831)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/build.xml	2009-08-05 11:27:12 UTC (rev 28832)
@@ -5,7 +5,6 @@
 	<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="../"/>
@@ -176,21 +175,12 @@
     <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"/>
@@ -201,7 +191,6 @@
             <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/branches/JBESB_4_4_GA_CP/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServer.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServer.java	2009-08-05 10:38:14 UTC (rev 28831)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServer.java	2009-08-05 11:27:12 UTC (rev 28832)
@@ -21,6 +21,7 @@
 
 import java.io.PrintWriter;
 import java.io.StringWriter;
+import java.lang.reflect.Field;
 import java.util.Collection;
 import java.util.List;
 
@@ -36,6 +37,7 @@
 import javax.xml.registry.infomodel.Service;
 import javax.xml.registry.infomodel.ServiceBinding;
 
+import org.apache.ws.scout.registry.infomodel.ServiceImpl;
 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;
@@ -193,18 +195,56 @@
                     return "could not find service bindings for DeadLetterService" ;
                 }
                 
-                for(ServiceBinding serviceBinding: serviceBindings)
+                final Class<ServiceImpl> serviceImplClass = ServiceImpl.class ;
+                final Field field ;
+                try
                 {
-                    final Service bindingService = serviceBinding.getService() ;
-                    if (bindingService == null)
+                    field = serviceImplClass.getDeclaredField("org") ;
+                }
+                catch (final NoSuchFieldException nsfe)
+                {
+                    return "Could not locate org field" ;
+                }
+                field.setAccessible(true) ;
+                try
+                {
+                    for(ServiceBinding serviceBinding: serviceBindings)
                     {
-                        return "Could not find service associated with binding" ;
+                        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" ;
+                        }
                     }
-                    if (bindingService.getProvidingOrganization() != null)
-                    {
-                        return "FAILED: Organization is present in service binding" ;
-                    }
                 }
+                finally
+                {
+                    field.setAccessible(false) ;
+                }
                 
                 return null ;
             }
@@ -240,26 +280,48 @@
                     return "Failed to obtain service as registry object" ;
                 }
                 
-                final Organization organization = registryService.getProvidingOrganization() ;
-                if (organization == null)
+                if (registryService.getSubmittingOrganization() != null)
                 {
-                    return "No Organization returned with service" ;
+                    return "FAILED: Submitting organization is present in service binding" ;
                 }
-                
-                if (organization.getKey() == null)
+                if (!(registryService instanceof ServiceImpl))
                 {
-                    return "Organization key not populated" ;
+                    return "Binding service is not a ServiceImpl, need to change the test" ;
                 }
+                final ServiceImpl serviceImpl = (ServiceImpl)registryService ;
+                if (serviceImpl.getSubmittingOrganizationKey() == null)
+                {
+                    return "FAILED: Submitting organization key is not present in service binding" ;
+                }
                 
-                final InternationalString name = organization.getName();
-                if (name != null)
+                final Field field ;
+                try
                 {
-                    final Collection localizedStrings = name.getLocalizedStrings();
-                    if ((localizedStrings != null) && (localizedStrings.size() > 0))
+                    field = serviceImpl.getClass().getDeclaredField("org") ;
+                }
+                catch (final NoSuchFieldException nsfe)
+                {
+                    return "Could not locate org field" ;
+                }
+                field.setAccessible(true) ;
+                try
+                {
+                    try
                     {
-                        return "Organization returned from database rather than aspect" ;
+                        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" ;
+                    }
                 }
+                finally
+                {
+                    field.setAccessible(false) ;
+                }
                 
                 return null ;
             }



More information about the jboss-svn-commits mailing list