[jboss-svn-commits] JBL Code SVN: r23741 - in labs/jbossesb/branches/JBESB_4_2_1_GA_CP: product/install/conf and 18 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Nov 6 05:32:03 EST 2008


Author: kevin.conner at jboss.com
Date: 2008-11-06 05:32:03 -0500 (Thu, 06 Nov 2008)
New Revision: 23741

Added:
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/java/
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/java/org/
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/java/org/jboss/
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/java/org/jboss/internal/
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/java/org/jboss/internal/soa/
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/java/org/jboss/internal/soa/esb/
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry/
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry/aspect/
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry/aspect/ScoutAspect.java
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/resources/
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/resources/META-INF/
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/resources/META-INF/jboss-aop.xml
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/CachingRegistryInterceptor.java
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/services/registry/AbstractRegistryInterceptor.java
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/services/registry/RegistryInterceptor.java
Removed:
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/java/
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/java/org/
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/java/org/jboss/
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/java/org/jboss/internal/
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/java/org/jboss/internal/soa/
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/java/org/jboss/internal/soa/esb/
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry/
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry/aspect/
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry/aspect/ScoutAspect.java
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/resources/
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/resources/META-INF/
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/resources/META-INF/jboss-aop.xml
Modified:
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/build-distr.xml
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/install/conf/jbossesb-properties.xml
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/build.xml
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/common/Configuration.java
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/common/Environment.java
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/services/registry/RegistryFactory.java
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/MockRegistry.java
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/MockRegistryUnitTest.java
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/junit/resources/server/jbossesb-properties.xml
Log:
Merge of scout performance changes: JBESB-2155

Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/build-distr.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/build-distr.xml	2008-11-06 08:58:34 UTC (rev 23740)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/build-distr.xml	2008-11-06 10:32:03 UTC (rev 23741)
@@ -8,6 +8,7 @@
     <property file="${org.jboss.esb.properties}"/>
 
     <property name="build.dir" value="build"/>
+    <property name="aoplib.dir" value="build/aoplib"/>
     <property name="lib.ext.dir" value="lib/ext"/>
     <property name="services.dir" value="services"/>
     <property name="build.lib.dir" value="${build.dir}/jbossesb/lib"/>
@@ -82,6 +83,8 @@
             <fileset dir="${installation.files.dir}/jUDDI-registry">
                 <include name="juddi-ds.xml"/>
             </fileset>
+            <!-- We use AOP on scout to get around an issue -->
+            <fileset dir="${build.dir}" includes="rosetta.aop"/>
         </copy>
 
         <mkdir dir="${build.dir}/jbossesb.sar/juddi-sql"/>
@@ -95,8 +98,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.ext.dir}" includes="scout-1.0rc1.jar"/>
+            <fileset dir="${aoplib.dir}" includes="scout-*.jar"/>
             <!-- xbean for reading/marchalling xml for configuration, and scout -->
             <fileset dir="${lib.ext.dir}" includes="xbean.jar,stax-api-1.0.1.jar,xmlpublic.jar"/>
             <!-- jUDDI Registry, we're one -->

Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/install/conf/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/install/conf/jbossesb-properties.xml	2008-11-06 08:58:34 UTC (rev 23740)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/install/conf/jbossesb-properties.xml	2008-11-06 10:32:03 UTC (rev 23741)
@@ -45,19 +45,12 @@
     	<property name="org.jboss.soa.esb.registry.password" value="password"/>
     	<!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
     	<property name="org.jboss.soa.esb.scout.proxy.transportClass" value="org.apache.ws.scout.transport.LocalTransport"/>
-
-		<!-- specify the interceptors, in order -->
-		<property name="org.jboss.soa.esb.registry.interceptors" value="org.jboss.internal.soa.esb.services.registry.InVMRegistryInterceptor"/>
-
- 	 	<!-- Example of specifying multiple registry interceptors
-		<property name="org.jboss.soa.esb.registry.interceptors"
-			value="org.jboss.internal.soa.esb.services.registry.InVMRegistryInterceptor, org.jboss.internal.soa.esb.services.registry.CachingRegistryInterceptor"/>
-		-->
-
+        <!-- specify the interceptors, in order -->
+        <property name="org.jboss.soa.esb.registry.interceptors"
+                value="org.jboss.internal.soa.esb.services.registry.CachingRegistryInterceptor"/>
         <!-- The following properties modify the cache interceptor behaviour -->
         <property name="org.jboss.soa.esb.registry.cache.maxSize" value="100"/>
         <property name="org.jboss.soa.esb.registry.cache.validityPeriod" value="600000"/>
-
     </properties>
     <properties name="transports" depends="core">
     	<property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>

Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop (from rev 21337, labs/jbossesb/trunk/product/rosetta/aop)

Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/java (from rev 21337, labs/jbossesb/trunk/product/rosetta/aop/java)

Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/java/org (from rev 21337, labs/jbossesb/trunk/product/rosetta/aop/java/org)

Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/java/org/jboss (from rev 21337, labs/jbossesb/trunk/product/rosetta/aop/java/org/jboss)

Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/java/org/jboss/internal (from rev 21337, labs/jbossesb/trunk/product/rosetta/aop/java/org/jboss/internal)

Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/java/org/jboss/internal/soa (from rev 21337, labs/jbossesb/trunk/product/rosetta/aop/java/org/jboss/internal/soa)

Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/java/org/jboss/internal/soa/esb (from rev 21337, labs/jbossesb/trunk/product/rosetta/aop/java/org/jboss/internal/soa/esb)

Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/java/org/jboss/internal/soa/esb/services (from rev 21337, labs/jbossesb/trunk/product/rosetta/aop/java/org/jboss/internal/soa/esb/services)

Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry (from rev 21337, labs/jbossesb/trunk/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry)

Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry/aspect (from rev 21337, labs/jbossesb/trunk/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry/aspect)

Deleted: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry/aspect/ScoutAspect.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry/aspect/ScoutAspect.java	2008-08-04 11:55:23 UTC (rev 21337)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry/aspect/ScoutAspect.java	2008-11-06 10:32:03 UTC (rev 23741)
@@ -1,59 +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.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.
- * 
- * @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() ;
-        }
-    }
-}

Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry/aspect/ScoutAspect.java (from rev 21337, labs/jbossesb/trunk/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry/aspect/ScoutAspect.java)
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry/aspect/ScoutAspect.java	                        (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry/aspect/ScoutAspect.java	2008-11-06 10:32:03 UTC (rev 23741)
@@ -0,0 +1,59 @@
+/*
+ * 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.
+ * 
+ * @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() ;
+        }
+    }
+}

Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/resources (from rev 21337, labs/jbossesb/trunk/product/rosetta/aop/resources)

Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/resources/META-INF (from rev 21337, labs/jbossesb/trunk/product/rosetta/aop/resources/META-INF)

Deleted: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/resources/META-INF/jboss-aop.xml
===================================================================
--- labs/jbossesb/trunk/product/rosetta/aop/resources/META-INF/jboss-aop.xml	2008-08-04 11:55:23 UTC (rev 21337)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/resources/META-INF/jboss-aop.xml	2008-11-06 10:32:03 UTC (rev 23741)
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE aop PUBLIC
-   "-//JBoss//DTD JBOSS AOP 1.0//EN"
-   "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"/>
-   
-   <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>
-</aop>
-

Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/resources/META-INF/jboss-aop.xml (from rev 21337, labs/jbossesb/trunk/product/rosetta/aop/resources/META-INF/jboss-aop.xml)
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/resources/META-INF/jboss-aop.xml	                        (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/aop/resources/META-INF/jboss-aop.xml	2008-11-06 10:32:03 UTC (rev 23741)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE aop PUBLIC
+   "-//JBoss//DTD JBOSS AOP 1.0//EN"
+   "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"/>
+   
+   <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>
+</aop>
+

Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/build.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/build.xml	2008-11-06 08:58:34 UTC (rev 23740)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/build.xml	2008-11-06 10:32:03 UTC (rev 23741)
@@ -4,12 +4,15 @@
 	<property name="org.jboss.esb.rosetta.jar.name" value="jbossesb-rosetta"/>
 	<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.classes.dir" location="${org.jboss.esb.rosetta.classes.dir}-aopc"/>
     <property name="org.jboss.esb.rosetta.src.dir" location="src"/>
 	<property name="org.jboss.esb.root.dir" location="../"/>
 	<property name="gendir" location="${org.jboss.esb.internal.dest}/schema-model" />
     <property environment="env"/>
 
-
+    <property name="org.jboss.esb.lib.dir" location="${org.jboss.esb.internal.dest}/lib"/>
+    <property name="org.jboss.esb.aoplib.dir" location="${org.jboss.esb.internal.dest}/aoplib"/>
 	<property name="org.jboss.esb.ext.lib.dir" location="${org.jboss.esb.root.dir}/lib/ext"/>
 	
 	<path id="org.jboss.esb.rosetta.base.classpath">
@@ -28,6 +31,9 @@
         <mkdir dir="${org.jboss.esb.rosetta.classes.dir}"/>
         <mkdir dir="${org.jboss.esb.rosetta.distrib.dir}"/>
     	<mkdir dir="${org.jboss.esb.rosetta.distrib.dir}/lib"/>
+        <!-- aop dirs -->
+        <mkdir dir="${org.jboss.esb.rosetta.aop.classes.dir}"/>
+        <mkdir dir="${org.jboss.esb.aoplib.dir}"/>
     </target>
 
     <target name="clean" description="Remove classes directory">
@@ -35,7 +41,7 @@
     	<delete dir="${org.jboss.esb.rosetta.classes.dir}"/>
     </target>
 
-    <target name="org.jboss.esb.rosetta.compile" depends="generate-config-model, org.jboss.esb.rosetta.internal.compile">
+    <target name="org.jboss.esb.rosetta.compile" depends="generate-config-model, org.jboss.esb.rosetta.internal.compile, aop">
         <ant inheritAll="true" dir="tests" target="org.jboss.esb.rosetta.tests.compile"/>
     </target>
 
@@ -131,6 +137,39 @@
 
 	<property name="coverage.dir" location="${org.jboss.esb.internal.dest}/tests/coverage"/>
 
+    <path id="aop-classpath">
+        <fileset dir="${org.jboss.esb.ext.lib.dir}" includes="jboss-aop-*.jar, javassist.jar, jbossall-client.jar, xbean.jar"/>
+        <fileset dir="${org.jboss.esb.ext.lib.dir}" includes="trove.jar"/>
+    </path>
 
+    <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.classes.dir}" quiet="true"/>
+        <mkdir dir="${org.jboss.esb.rosetta.aopc.classes.dir}"/>
+
+        <unzip src="${org.jboss.esb.ext.lib.dir}/scout-1.0rc1.jar" dest="${org.jboss.esb.rosetta.aopc.classes.dir}"/>
+        <aopc compilerclasspathref="aop-classpath">
+            <classpath path="${org.jboss.esb.rosetta.aopc.classes.dir}"/>
+            <src path="${org.jboss.esb.rosetta.aopc.classes.dir}"/>
+            <include name="org/apache/ws/scout/registry/BusinessQueryManagerImpl.class"/>
+
+            <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.0rc1.aop.jar" basedir="${org.jboss.esb.rosetta.aopc.classes.dir}"/>
+    </target>
+
+    <target name="aop-jar" depends="aop-compile">
+        <jar destfile="${org.jboss.esb.internal.dest}/rosetta.aop">
+            <fileset dir="${org.jboss.esb.rosetta.aop.classes.dir}"/>
+            <fileset dir="aop/resources"/>
+        </jar>
+    </target>
+
+    <target name="aop-compile">
+        <javac srcdir="aop/java" destdir="${org.jboss.esb.rosetta.aop.classes.dir}"
+            debug="${org.jboss.esb.debug}" optimize="${org.jboss.esb.optimize}"
+            classpathref="org.jboss.esb.rosetta.base.classpath"/>
+    </target>
 </project>

Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/CachingRegistryInterceptor.java (from rev 21337, labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/CachingRegistryInterceptor.java)
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/CachingRegistryInterceptor.java	                        (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/CachingRegistryInterceptor.java	2008-11-06 10:32:03 UTC (rev 23741)
@@ -0,0 +1,265 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.internal.soa.esb.services.registry;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.commons.collections.map.LRUMap;
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.Service;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.common.Configuration;
+import org.jboss.soa.esb.services.registry.AbstractRegistryInterceptor;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.services.registry.ServiceNotFoundException;
+
+/**
+ * Caching registry interceptor.
+ *
+ * @author <a href='mailto:Kevin.Conner at jboss.com'>Kevin Conner</a>
+ */
+public class CachingRegistryInterceptor extends AbstractRegistryInterceptor
+{
+    /**
+     * The logger for the registry cache
+     */
+    private static final Logger LOGGER = Logger.getLogger(CachingRegistryInterceptor.class) ;
+    
+    /**
+     * The default service cache size.
+     */
+    private static final int DEFAULT_MAX_CACHE_SIZE = 100 ;
+    /**
+     * The default cache validity period.
+     */
+    private static final long DEFAULT_VALIDITY_PERIOD = (10*60*1000L) ;
+    
+    /**
+     * The maximum number of services stored in the cache.
+     */
+    private static final int MAX_CACHE_SIZE ;
+    /**
+     * The validity period of the entry.
+     */
+    private static final long VALIDITY_PERIOD ;
+    
+    /**
+     * The LRU map for the cached services.
+     */
+    private final LRUMap serviceInfoMap = new LRUMap(MAX_CACHE_SIZE) ;
+
+    public List<String> findAllServices() throws RegistryException
+    {
+        // Do not cache, go direct to the registry
+        return getRegistry().findAllServices() ;
+    }
+
+    public List<String> findServices(final String category)
+            throws RegistryException
+    {
+        // Do not cache, go direct to the registry
+        return getRegistry().findServices(category) ;
+    }
+
+    public EPR findEPR(final String category, final String name)
+            throws RegistryException, ServiceNotFoundException
+    {
+        final List<EPR> eprs = findEPRs(category, name) ;
+        return eprs.get(0) ;
+    }
+
+    public List<EPR> findEPRs(final String category, final String name)
+            throws RegistryException, ServiceNotFoundException
+    {
+        final Service service = new Service(category, name) ;
+        return Collections.unmodifiableList(getEPRs(service)) ;
+    }
+
+    public void registerEPR(final String category, final String name,
+            final String serviceDescription, final EPR epr, final String eprDescription)
+            throws RegistryException
+    {
+        final Service service = new Service(category, name) ;
+        synchronized(this)
+        {
+            getRegistry().registerEPR(category, name, serviceDescription, epr, eprDescription) ;
+            final List<EPR> eprs = getCurrentEPRs(service) ;
+            if (eprs != null)
+            {
+                eprs.add(epr) ;
+            }
+        }
+    }
+
+    public void unRegisterEPR(final String category, final String name,
+            final EPR epr) throws RegistryException, ServiceNotFoundException
+    {
+        final Service service = new Service(category, name) ;
+        synchronized(this)
+        {
+            final List<EPR> eprs = getCurrentEPRs(service) ;
+            if ((eprs != null) && eprs.remove(epr) && (eprs.size() == 0))
+            {
+                serviceInfoMap.remove(service) ;
+                if (LOGGER.isInfoEnabled())
+                {
+                    LOGGER.debug("Cache removing service " + service) ;
+                }
+            }
+            getRegistry().unRegisterEPR(category, name, epr) ;
+        }
+    }
+
+    public void unRegisterService(final String category, final String name)
+            throws RegistryException, ServiceNotFoundException
+    {
+        final Service service = new Service(category, name) ;
+        synchronized(this)
+        {
+            serviceInfoMap.remove(service) ;
+            if (LOGGER.isInfoEnabled())
+            {
+                LOGGER.debug("Cache removing service " + service) ;
+            }
+            getRegistry().unRegisterService(category, name) ;
+        }
+    }
+
+    private synchronized List<EPR> getEPRs(final Service service)
+        throws RegistryException, ServiceNotFoundException
+    {
+        final List<EPR> eprs = getCurrentEPRs(service) ;
+        if (eprs != null)
+        {
+            return eprs ;
+        }
+        else
+        {
+            final List<EPR> currentEPRs = getRegistry().findEPRs(service.getCategory(), service.getName()) ;
+            final List<EPR> copyEPRs = new ArrayList<EPR>(currentEPRs) ;
+            final ServiceInfo serviceInfo = new ServiceInfo(copyEPRs) ;
+            serviceInfoMap.put(service, serviceInfo) ;
+            if (LOGGER.isInfoEnabled())
+            {
+                LOGGER.debug("Cache reloaded for service " + service) ;
+            }
+            return copyEPRs ;
+        }
+    }
+    
+    private synchronized List<EPR> getCurrentEPRs(final Service service)
+    {
+        final ServiceInfo serviceInfo = (ServiceInfo)serviceInfoMap.get(service) ;
+        if (serviceInfo != null)
+        {
+            final boolean infoEnabled = LOGGER.isInfoEnabled() ;
+            if (serviceInfo.isValid())
+            {
+                if (infoEnabled)
+                {
+                    LOGGER.debug("Cache hit for service " + service) ;
+                }
+                return serviceInfo.getEPRs() ;
+            }
+            else
+            {
+                if (infoEnabled)
+                {
+                    LOGGER.debug("Cache expiry for service " + service) ;
+                }
+                serviceInfoMap.remove(service) ;
+            }
+        }
+        return null ;
+    }
+    
+    private static class ServiceInfo
+    {
+        private final long expiryTime ;
+        
+        private List<EPR> eprs ;
+        
+        private ServiceInfo(final List<EPR> eprs)
+        {
+            this.eprs = eprs ;
+            if (VALIDITY_PERIOD > 0)
+            {
+                expiryTime = System.currentTimeMillis() + VALIDITY_PERIOD ;
+            }
+            else
+            {
+                expiryTime = Long.MAX_VALUE ;
+            }
+        }
+        
+        boolean isValid()
+        {
+            return System.currentTimeMillis() < expiryTime ;
+        }
+        
+        List<EPR> getEPRs()
+        {
+            return eprs ;
+        }
+    }
+
+    static
+    {
+        final String maxCacheSizeVal = Configuration.getRegistryCacheMaxSize() ;
+        int maxCacheSize = DEFAULT_MAX_CACHE_SIZE ;
+        if (maxCacheSizeVal != null)
+        {
+            try
+            {
+                maxCacheSize = Integer.parseInt(maxCacheSizeVal) ;
+            }
+            catch (final NumberFormatException nfe)
+            {
+                // fallback to default
+                LOGGER.warn("Failed to parse maximum cache size, falling back to default", nfe) ;
+            }
+        }
+
+        final String validityPeriodVal = Configuration.getRegistryCacheValidityPeriod() ;
+        long validityPeriod = DEFAULT_VALIDITY_PERIOD ;
+        if (validityPeriodVal != null)
+        {
+            try
+            {
+                validityPeriod = Long.parseLong(validityPeriodVal) ;
+            }
+            catch (final NumberFormatException nfe)
+            {
+                // fallback to default
+                LOGGER.warn("Failed to parse validity period, falling back to default", nfe) ;
+            }
+        }
+        VALIDITY_PERIOD = validityPeriod ;
+        MAX_CACHE_SIZE = maxCacheSize ;
+        
+        if (LOGGER.isDebugEnabled())
+        {
+            LOGGER.debug("Registry cache validity period: " + VALIDITY_PERIOD) ;
+            LOGGER.debug("Registry cache maximum size: " + MAX_CACHE_SIZE) ;
+        }
+    }
+}

Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/common/Configuration.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/common/Configuration.java	2008-11-06 08:58:34 UTC (rev 23740)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/common/Configuration.java	2008-11-06 10:32:03 UTC (rev 23741)
@@ -73,7 +73,10 @@
 			new KeyValuePair(Environment.MSG_STORE_DB_POOL_TEST_TABLE,  getStorePoolTestTable()),
 			new KeyValuePair(Environment.MSG_STORE_DB_POOL_TIMEOUT_MILLIS,getStorePoolTimeoutMillis()),
 			new KeyValuePair(Environment.MSG_STORE_DB_CONN_MANAGER		,getStoreDBConnectionManager()),
-			new KeyValuePair(Environment.MSG_STORE_DB_DATASOURCE_NAME	,getStoreDBDatasourceName())
+			new KeyValuePair(Environment.MSG_STORE_DB_DATASOURCE_NAME	,getStoreDBDatasourceName()),
+			new KeyValuePair(Environment.REGISTRY_INTERCEPTORS			,getRegistryInterceptors()),
+			new KeyValuePair(Environment.REGISTRY_CACHE_MAX_SIZE		,getRegistryCacheMaxSize()),
+			new KeyValuePair(Environment.REGISTRY_CACHE_VALIDITY_PERIOD	,getRegistryCacheValidityPeriod())
 	};
 
 	public static String dump()
@@ -336,6 +339,33 @@
 		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_JCR_ROOT_NODE_PATH);
 	}
 	
+    /**
+     * Get the registry interceptor class names
+     * @return Registry interceptor Class names.
+     */
+    public static String getRegistryInterceptors()
+    {
+        return ModulePropertyManager.getPropertyManager(ModulePropertyManager.REGISTRY_MODULE).getProperty(Environment.REGISTRY_INTERCEPTORS);
+    }
+    
+    /**
+     * Get the maximum cache size for the caching registry.
+     * @return The maximum cache size.
+     */
+    public static String getRegistryCacheMaxSize()
+    {
+        return ModulePropertyManager.getPropertyManager(ModulePropertyManager.REGISTRY_MODULE).getProperty(Environment.REGISTRY_CACHE_MAX_SIZE) ;
+    }
+    
+    /**
+     * Get the validity period for the caching registry.
+     * @return The cache validity period.
+     */
+    public static String getRegistryCacheValidityPeriod()
+    {
+        return ModulePropertyManager.getPropertyManager(ModulePropertyManager.REGISTRY_MODULE).getProperty(Environment.REGISTRY_CACHE_VALIDITY_PERIOD) ;
+    }
+    
 	/**
 	 * Construct a naming context based on the connection details outlined
 	 * in the named configuration module/section.

Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/common/Environment.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/common/Environment.java	2008-11-06 08:58:34 UTC (rev 23740)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/common/Environment.java	2008-11-06 10:32:03 UTC (rev 23741)
@@ -114,6 +114,19 @@
      * Property that holds the max number of rows the UDDI should return on searches.
      */
     public static final String REGISTRY_UDDI_MAX_ROWS          = "org.jboss.soa.esb.registry.uddi.maxRows";
+    
+    /**
+     * The Registry interceptor class names.
+     */
+    public static final String REGISTRY_INTERCEPTORS = "org.jboss.soa.esb.registry.interceptors";
+    /**
+     * The maximum cache size for the registry.
+     */
+    public static final String REGISTRY_CACHE_MAX_SIZE = "org.jboss.soa.esb.registry.cache.maxSize";
+    /**
+     * The cache validity period.
+     */
+    public static final String REGISTRY_CACHE_VALIDITY_PERIOD = "org.jboss.soa.esb.registry.cache.validityPeriod";
 	/*
 	 * Some default values.
 	 */

Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/services/registry/AbstractRegistryInterceptor.java (from rev 21337, labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry/AbstractRegistryInterceptor.java)
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/services/registry/AbstractRegistryInterceptor.java	                        (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/services/registry/AbstractRegistryInterceptor.java	2008-11-06 10:32:03 UTC (rev 23741)
@@ -0,0 +1,59 @@
+/*
+* 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.soa.esb.services.registry;
+
+/**
+ * An abstract registry interceptor for managing the registry assignment.
+ * 
+ * @author <a href='mailto:Kevin.Conner at jboss.com'>Kevin Conner</a>
+ */
+public abstract class AbstractRegistryInterceptor implements RegistryInterceptor
+{
+    /**
+     * The next registry or interceptor in the chain.
+     */
+    private Registry registry ;
+    
+    /**
+     * Initialise the registry or interceptor that is next in the chain.
+     * @param registry The next entry in the chain or null if dismantling.
+     */
+    public synchronized void setRegistry(final Registry registry)
+    {
+        this.registry = registry ;
+    }
+    
+    /**
+     * Get the next registry or interceptor in the chain.
+     * @return The next registry or interceptor in the chain.
+     * @throws RegistryException If the chain has been dismantled.
+     */
+    protected synchronized Registry getRegistry()
+        throws RegistryException
+    {
+        if (registry == null)
+        {
+           throw new RegistryException("Registry has been reconfigured and is no longer valid") ;
+        }
+        return registry ;
+    }
+}

Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/services/registry/RegistryFactory.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/services/registry/RegistryFactory.java	2008-11-06 08:58:34 UTC (rev 23740)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/services/registry/RegistryFactory.java	2008-11-06 10:32:03 UTC (rev 23741)
@@ -21,8 +21,11 @@
  */
 package org.jboss.soa.esb.services.registry;
 
+import java.util.List;
+
 import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
+import org.jboss.soa.esb.addressing.EPR;
 import org.jboss.soa.esb.common.Configuration;
 import org.jboss.soa.esb.util.ClassUtil;
 
@@ -37,6 +40,14 @@
 	private static Logger logger = Logger.getLogger(RegistryFactory.class);
 
    private static Registry singleton;
+   /**
+    * The current registry implementation.
+    */
+   private static Registry currentRegistry ;
+   /**
+    * The interceptors applied to the registry.
+    */
+   private static RegistryInterceptor[] interceptors ;
 
    /**
     * Set the singleton. Any existing instance will be overwritten.
@@ -46,10 +57,11 @@
    
    public static synchronized void setRegistry(Registry registry)
    {
-      singleton = registry;
+      currentRegistry = registry;
+      singleton = configureInterceptors(registry) ;
    }
 
-   /**
+/**
     * Get the singleton.
     * 
     * @return the singleton or <code>null</code> if one has not been created.
@@ -71,8 +83,8 @@
         if (singleton != null) {
             return singleton;
         }
-
-        return createRegistry();
+        setRegistry(createRegistry());
+        return singleton ;
     }
 
     /**
@@ -85,8 +97,8 @@
     public static synchronized Registry createRegistry()
            throws RegistryException
    {
-        if (singleton != null)
-            return singleton;
+      if (currentRegistry != null)
+         return currentRegistry;
         
       Registry registry = null;
       String className = Configuration.getRegistryImplementationClass();
@@ -106,14 +118,142 @@
       }
       catch (Exception e)
       {
-         e.printStackTrace();
-
          throw new RegistryException("Invocation exception. "
                + e.getLocalizedMessage(), e);
       }
 
-      singleton = registry;
+      currentRegistry = registry;
       
       return registry;
    }
+   
+   /**
+    * Configure the interceptors around the registry
+    * @return The intercepted registry.
+    */
+   private static Registry configureInterceptors(final Registry registry)
+   {
+      if (interceptors != null)
+      {
+         final int numInterceptors = interceptors.length ;
+         for(int count = 0 ; count < numInterceptors ; count++)
+         {
+            interceptors[count].setRegistry(null) ;
+         }
+         interceptors = null ;
+      }
+      
+      if (registry == null)
+      {
+          return null ;
+      }
+      
+      final String registryInterceptorConfig = Configuration.getRegistryInterceptors() ;
+      final String[] registryInterceptorNames = (registryInterceptorConfig == null ? null : registryInterceptorConfig.split(",")) ;
+      final int numInterceptors = (registryInterceptorNames == null ? 0 : registryInterceptorNames.length) ;
+      final RegistryInterceptor[] registryInterceptors = new RegistryInterceptor[numInterceptors + 1] ;
+      
+      Registry current = registry ;
+      try
+      {
+          for(int count = numInterceptors ; count > 0 ; count--)
+          {
+              final Class interceptorClass ;
+              try
+              {
+                  interceptorClass = ClassUtil.forName(registryInterceptorNames[count-1].trim(), RegistryFactory.class) ;
+              }
+              catch (final ClassNotFoundException cnfe)
+              {
+                  throw new RegistryException("Failed to instantiate registry interceptor, disabling all interceptors", cnfe) ;
+              }
+              if (!RegistryInterceptor.class.isAssignableFrom(interceptorClass))
+              {
+                  throw new RegistryException("Registry interceptor does not implement RegistryInterceptor interface: " + interceptorClass.getName()) ;
+              }
+              final Object interceptor ;
+              try
+              {
+                  interceptor = interceptorClass.newInstance() ;
+              }
+              catch (final Throwable th)
+              {
+                  throw new RegistryException("Failed to instantiate registry interceptor", th) ;
+              }
+              final RegistryInterceptor registryInterceptor = (RegistryInterceptor)interceptor ;
+              registryInterceptor.setRegistry(current) ;
+              registryInterceptors[count] = registryInterceptor ;
+              current = registryInterceptor ;
+          }
+      }
+      catch (final RegistryException re)
+      {
+          for(int count = 1 ; count <= numInterceptors ; count++)
+          {
+              final RegistryInterceptor interceptor = registryInterceptors[count] ;
+              if (interceptor != null)
+              {
+                  interceptor.setRegistry(null) ;
+              }
+          }
+          logger.error("Failed to create registry interceptors, falling back to registry implementation", re) ;
+          return registry ;
+      }
+      final HeadRegistryInterceptor headInterceptor = new HeadRegistryInterceptor() ;
+      headInterceptor.setRegistry(current) ;
+      registryInterceptors[0] = headInterceptor ;
+      interceptors = registryInterceptors ;
+      return headInterceptor ;
+   }
+   
+   /**
+    * Registry Interceptor that throws an exception if a registry is used after it has been disabled.
+    * @author <a href='Kevin.Conner at jboss.com'>Kevin Conner</a>
+    */
+   private static final class HeadRegistryInterceptor extends AbstractRegistryInterceptor
+   {
+      public List<String> findAllServices() throws RegistryException
+      {
+         return getRegistry().findAllServices() ;
+      }
+
+      public EPR findEPR(final String serviceCategoryName, final String serviceName)
+         throws RegistryException, ServiceNotFoundException
+      {
+         return getRegistry().findEPR(serviceCategoryName, serviceName) ;
+      }
+
+      public List<EPR> findEPRs(final String serviceCategoryName, final String serviceName)
+         throws RegistryException, ServiceNotFoundException
+      {
+         return getRegistry().findEPRs(serviceCategoryName, serviceName) ;
+      }
+
+      public List<String> findServices(final String serviceCategoryName)
+         throws RegistryException
+      {
+         return getRegistry().findServices(serviceCategoryName) ;
+      }
+
+      public void registerEPR(final String serviceCategoryName, final String serviceName,
+         final String serviceDescription, final EPR epr, final String eprDescription)
+         throws RegistryException
+      {
+          getRegistry().registerEPR(serviceCategoryName, serviceName,
+            serviceDescription, epr, eprDescription) ;
+      }
+
+      public void unRegisterEPR(final String serviceCategoryName, final String serviceName,
+         final EPR epr)
+         throws RegistryException, ServiceNotFoundException
+      {
+          getRegistry().unRegisterEPR(serviceCategoryName, serviceName, epr) ;
+      }
+
+      public void unRegisterService(final String category, final String serviceName)
+         throws RegistryException, ServiceNotFoundException
+      {
+          getRegistry().unRegisterService(category, serviceName) ;
+      }
+   }
 }

Copied: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/services/registry/RegistryInterceptor.java (from rev 21337, labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry/RegistryInterceptor.java)
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/services/registry/RegistryInterceptor.java	                        (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/services/registry/RegistryInterceptor.java	2008-11-06 10:32:03 UTC (rev 23741)
@@ -0,0 +1,38 @@
+/*
+* 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.soa.esb.services.registry;
+
+/**
+ * Interface implemented by interceptors added to the underlying registry.
+ * 
+ * These interceptors will provide additional functionality such as caching, InVm etc.
+ *
+ * @author <a href='mailto:Kevin.Conner at jboss.com'>Kevin Conner</a>
+ */
+public interface RegistryInterceptor extends Registry 
+{
+    /**
+     * Initialise the registry or interceptor that is next in the chain.
+     * @param registry The next entry in the chain or null if dismantling.
+     */
+    public void setRegistry(final Registry registry) ;
+}

Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/MockRegistry.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/MockRegistry.java	2008-11-06 08:58:34 UTC (rev 23740)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/MockRegistry.java	2008-11-06 10:32:03 UTC (rev 23741)
@@ -33,6 +33,7 @@
 import org.jboss.soa.esb.common.ModulePropertyManager;
 import org.jboss.soa.esb.services.registry.Registry;
 import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.services.registry.ServiceNotFoundException;
 
 import com.arjuna.common.util.propertyservice.PropertyManager;
 
@@ -132,18 +133,18 @@
     /* (non-Javadoc)
       * @see org.jboss.soa.esb.services.registry.Registry#unRegisterService(java.lang.String, java.lang.String)
       */
-    public void unRegisterService(String category, String serviceName) throws RegistryException {
+    public void unRegisterService(String category, String serviceName) throws RegistryException, ServiceNotFoundException {
         unRegisterEPR(category, serviceName, null);
     }
 
     /* (non-Javadoc)
       * @see org.jboss.soa.esb.services.registry.Registry#unRegisterEPR(java.lang.String, java.lang.String, org.jboss.soa.esb.addressing.EPR)
       */
-    public void unRegisterEPR(String serviceCategoryName, String serviceName, EPR epr) throws RegistryException {
+    public void unRegisterEPR(String serviceCategoryName, String serviceName, EPR epr) throws RegistryException, ServiceNotFoundException {
         int indexOf = repository.indexOf(new RepositoryEntry(serviceCategoryName, serviceName, null, epr, null));
 
         if (indexOf == -1) {
-            throw new RegistryException("Registry entry [" + serviceCategoryName + "][" + serviceName + "] not found.");
+            throw new ServiceNotFoundException("Registry entry [" + serviceCategoryName + "][" + serviceName + "] not found.");
         }
         repository.remove(indexOf);
     }
@@ -191,13 +192,13 @@
       * @see org.jboss.soa.esb.services.registry.Registry#findEPR(java.lang.String, java.lang.String)
       */
     public EPR findEPR(String serviceCategoryName, String serviceName)
-            throws RegistryException {
+            throws RegistryException, ServiceNotFoundException {
         for (RepositoryEntry entry : repository) {
             if (serviceCategoryName.equals(entry.serviceCategoryName) && serviceName.equals(entry.serviceName)) {
                 return entry.epr;
             }
         }
-        return null;
+        throw new ServiceNotFoundException("Registry entry [" + serviceCategoryName + "][" + serviceName + "] not found.");
     }
 
     public static class RepositoryEntry {

Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/MockRegistryUnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/MockRegistryUnitTest.java	2008-11-06 08:58:34 UTC (rev 23740)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/MockRegistryUnitTest.java	2008-11-06 10:32:03 UTC (rev 23741)
@@ -28,9 +28,8 @@
 
 import org.jboss.soa.esb.addressing.EPR;
 import org.jboss.soa.esb.common.Environment;
-import org.jboss.soa.esb.services.registry.Registry;
 import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.soa.esb.services.registry.RegistryFactory;
+import org.jboss.soa.esb.services.registry.ServiceNotFoundException;
 
 /**
  * MockRegistry Unit Test.
@@ -43,14 +42,12 @@
 		
 		MockRegistry.install();
 		assertEquals(MockRegistry.class.getName(), MockRegistry.regPropManager.getProperty(Environment.REGISTRY_IMPEMENTATION_CLASS));
-		Registry registry = RegistryFactory.getRegistry();
-		assertTrue(registry instanceof MockRegistry);
 		
 		MockRegistry.uninstall();
 		assertNotSame(MockRegistry.class.getName(), MockRegistry.regPropManager.getProperty(Environment.REGISTRY_IMPEMENTATION_CLASS));
 	}
 
-	public void test_features() throws RegistryException {
+	public void test_features() throws RegistryException, ServiceNotFoundException {
 		MockRegistry registry = new MockRegistry();
 		EPR epr = new EPR();
 		List<String> services = new ArrayList<String>();
@@ -81,7 +78,7 @@
 		try {
 			registry.unRegisterService("cat2", "cat1-service2");
 			fail("Expected RegistryException for unknown service.");
-		} catch(RegistryException e) {
+		} catch(ServiceNotFoundException e) {
 			//OK
 		}
 		

Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/junit/resources/server/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/junit/resources/server/jbossesb-properties.xml	2008-11-06 08:58:34 UTC (rev 23740)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/junit/resources/server/jbossesb-properties.xml	2008-11-06 10:32:03 UTC (rev 23741)
@@ -51,6 +51,12 @@
     	<!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
     	<property name="org.jboss.soa.esb.scout.proxy.transportClass" 
     		value="org.apache.ws.scout.transport.RMITransport"/>
+        <!-- specify the interceptors, in order -->
+        <property name="org.jboss.soa.esb.registry.interceptors"
+                value="org.jboss.internal.soa.esb.services.registry.InVMRegistryInterceptor, org.jboss.internal.soa.esb.services.registry.CachingRegistryInterceptor"/>
+        <!-- The following properties modify the cache interceptor behaviour -->
+        <property name="org.jboss.soa.esb.registry.cache.maxSize" value="100"/>
+        <property name="org.jboss.soa.esb.registry.cache.validityPeriod" value="600000"/>
     </properties>
     <properties name="transports" depends="core">
     	<property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>




More information about the jboss-svn-commits mailing list