jcarman     2005/03/27 15:13:52

  Modified:    library/src/test/org/apache/hivemind/lib/impl
                        TestMethodInterceptorFactory.java
               .        status.xml
               framework/src/java/org/apache/hivemind/impl
                        RegistryInfrastructureConstructor.java
  Added:       library/src/test/org/apache/hivemind/lib/impl
                        MultipleMethodInterceptors.xml
  Log:
  Interceptors with different names for same interceptor factory not allowed
  PR: HIVEMIND-102
  
  Revision  Changes    Path
  1.3       +8 -0      
jakarta-hivemind/library/src/test/org/apache/hivemind/lib/impl/TestMethodInterceptorFactory.java
  
  Index: TestMethodInterceptorFactory.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-hivemind/library/src/test/org/apache/hivemind/lib/impl/TestMethodInterceptorFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestMethodInterceptorFactory.java 22 Mar 2005 14:07:21 -0000      1.2
  +++ TestMethodInterceptorFactory.java 27 Mar 2005 23:13:52 -0000      1.3
  @@ -41,6 +41,14 @@
           assertEquals( FortuneCookieImpl.FORTUNE + 
SuffixMethodInterceptor.SUFFIX, cookie.generateFortune());
       }
       
  +    public void testWithMultipleMethodInterceptors() throws Exception
  +    {
  +        Registry registry = 
buildFrameworkRegistry("MultipleMethodInterceptors.xml");
  +        final FortuneCookie cookie = (FortuneCookie) 
registry.getService(FortuneCookie.class);
  +        final String fortune = cookie.generateFortune();
  +        System.out.println( "The value of fortune is " + fortune );
  +        assertEquals( FortuneCookieImpl.FORTUNE + 
SuffixMethodInterceptor.SUFFIX + SuffixMethodInterceptor.SUFFIX, fortune);
  +    }
       public void testWithNonMethodInterceptor() throws Exception
       {
           Registry registry = 
buildFrameworkRegistry("NonMethodInterceptor.xml");
  
  
  
  1.1                  
jakarta-hivemind/library/src/test/org/apache/hivemind/lib/impl/MultipleMethodInterceptors.xml
  
  Index: MultipleMethodInterceptors.xml
  ===================================================================
  <?xml version="1.0"?>
  <!-- 
     Copyright 2004, 2005 The Apache Software Foundation
  
     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at
  
         http://www.apache.org/licenses/LICENSE-2.0
  
     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
  -->
  
  <module id="hivemind.lib.test" version="1.0.0">
    
    <service-point id="FortuneCookie" 
interface="org.apache.hivemind.lib.impl.FortuneCookie">
      <create-instance class="org.apache.hivemind.lib.impl.FortuneCookieImpl"/>
      <interceptor service-id="hivemind.lib.MethodInterceptorFactory" 
name="first">
        <impl 
object="instance:org.apache.hivemind.lib.impl.SuffixMethodInterceptor" />
      </interceptor>
      <interceptor service-id="hivemind.lib.MethodInterceptorFactory" 
name="second">
        <impl 
object="instance:org.apache.hivemind.lib.impl.SuffixMethodInterceptor" />
      </interceptor>
    </service-point>
    
  </module>
  
  
  1.113     +4 -0      jakarta-hivemind/status.xml
  
  Index: status.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/status.xml,v
  retrieving revision 1.112
  retrieving revision 1.113
  diff -u -r1.112 -r1.113
  --- status.xml        22 Mar 2005 14:06:24 -0000      1.112
  +++ status.xml        27 Mar 2005 23:13:52 -0000      1.113
  @@ -30,6 +30,10 @@
       </actions>
     </todo>
     <changes>
  +    <release version="1.1-alpha-4?" date="unreleased">
  +      <action type="fix" dev="JC" fixes-bug="HIVEMIND-102" >Multiple 
interceptors with different names for the same interceptor factory id were 
treated as duplicates.</action>
  +
  +    </release>
       <release version="1.1-alpha-3" date="Mar 22 2005">
         <action type="fix" dev="JC" fixes-bug="HIVEMIND-96" >Interceptors can 
now be ordered by name rather than interceptor factory id.</action>
         <action type="fix" dev="JC" fixes-bug="HIVEMIND-45" >Created a 
ServiceInterceptorFactory supporting AOP Alliance MethodInterceptors.</action>
  
  
  
  1.11      +2 -2      
jakarta-hivemind/framework/src/java/org/apache/hivemind/impl/RegistryInfrastructureConstructor.java
  
  Index: RegistryInfrastructureConstructor.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-hivemind/framework/src/java/org/apache/hivemind/impl/RegistryInfrastructureConstructor.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- RegistryInfrastructureConstructor.java    10 Feb 2005 01:04:33 -0000      
1.10
  +++ RegistryInfrastructureConstructor.java    27 Mar 2005 23:13:52 -0000      
1.11
  @@ -629,10 +629,10 @@
   
           sic.setFactoryServiceId(IdUtils.qualify(sourceModuleId, 
id.getFactoryServiceId()));
           sic.setLocation(id.getLocation());
  -
  +        
           sic.setFollowingInterceptorIds(IdUtils.qualifyList(sourceModuleId, 
id.getBefore()));
           sic.setPrecedingInterceptorIds(IdUtils.qualifyList(sourceModuleId, 
id.getAfter()));
  -
  +        sic.setName( id.getName() != null ? IdUtils.qualify( sourceModuleId, 
id.getName() ) : null );
           sic.setContributingModule(sourceModule);
           sic.setParameters(id.getParameters());
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to