You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hivemind.apache.org by ah...@apache.org on 2006/08/01 18:23:45 UTC

svn commit: r427637 - in /hivemind/branches/branch-2-0-annot: framework/src/java/org/apache/hivemind/ framework/src/java/org/apache/hivemind/impl/ framework/src/java/org/apache/hivemind/internal/ framework/src/java/org/apache/hivemind/service/impl/ fra...

Author: ahuegen
Date: Tue Aug  1 09:23:42 2006
New Revision: 427637

URL: http://svn.apache.org/viewvc?rev=427637&view=rev
Log:
Fixed and restructured some more unit tests.
Overhaul of interceptor ordering
Moved core services to CoreServicesProvider

Added:
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/ServiceInterceptorFactory.java   (contents, props changed)
      - copied, changed from r419477, hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/ServiceInterceptorFactory.java
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/AbstractServiceImplementationConstructor.java
Removed:
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/service/impl/ThreadLocaleFactory.java
    hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestServiceInterceptorContributionImpl.java
    hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/ServiceInterceptorFactory.java
    hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/ServiceInterceptorContributionImpl.java
Modified:
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/BaseLocatable.java
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ConstructableServicePoint.java
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/CoreServicesProvider.java
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/CreateClassServiceConstructor.java
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/RegistryInfrastructureImpl.java
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ServicePointImpl.java
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ShutdownCoordinatorImpl.java
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ServiceInterceptorConstructor.java
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/service/impl/LoggingInterceptorFactory.java
    hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/FrameworkTestCase.java
    hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/TestMisc.java
    hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestInterceptors.java
    hivemind/branches/branch-2-0-annot/library/src/java/org/apache/hivemind/lib/impl/MethodInterceptorFactory.java
    hivemind/branches/branch-2-0-annot/xml/src/descriptor/META-INF/hivemodule.xml
    hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/ServiceImplementationFactory.java
    hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/InvokeFactoryInterceptorConstructor.java
    hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/InvokeFactoryServiceConstructor.java
    hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/XmlModuleDescriptorProcessor.java
    hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/parse/CreateInstanceDescriptor.java
    hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/parse/InvokeFactoryDescriptor.java
    hivemind/branches/branch-2-0-annot/xml/src/test/hivemind/test/parse/TestToString.java
    hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/impl/TestInvokeFactoryServiceConstructor.java

Copied: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/ServiceInterceptorFactory.java (from r419477, hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/ServiceInterceptorFactory.java)
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/ServiceInterceptorFactory.java?p2=hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/ServiceInterceptorFactory.java&p1=hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/ServiceInterceptorFactory.java&r1=419477&r2=427637&rev=427637&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/ServiceInterceptorFactory.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/ServiceInterceptorFactory.java Tue Aug  1 09:23:42 2006
@@ -34,6 +34,8 @@
 {
     /**
       * Creates an interceptor and pushes it onto the interceptor stack.
+      * @param parameters  factory specific parameters. The implementatation class
+      *                    should document which type is expected here. 
       */
     public void createInterceptor(InterceptorStack stack, Module invokingModule, Object parameters);
 }

Propchange: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/ServiceInterceptorFactory.java
------------------------------------------------------------------------------
    cvs2svn:cvs-rev = 1.5

Propchange: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/ServiceInterceptorFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/ServiceInterceptorFactory.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/BaseLocatable.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/BaseLocatable.java?rev=427637&r1=427636&r2=427637&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/BaseLocatable.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/BaseLocatable.java Tue Aug  1 09:23:42 2006
@@ -29,6 +29,15 @@
 {
     private Location _location;
 
+    public BaseLocatable()
+    {
+    }
+    
+    public BaseLocatable(Location location)
+    {
+        _location = location;
+    }
+
     public void setLocation(Location location)
     {
         _location = location;

Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ConstructableServicePoint.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ConstructableServicePoint.java?rev=427637&r1=427636&r2=427637&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ConstructableServicePoint.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ConstructableServicePoint.java Tue Aug  1 09:23:42 2006
@@ -38,7 +38,7 @@
     ServiceImplementationConstructor getServiceConstructor();
 
     /**
-     * Returns a list of {@link org.apache.hivemind.internal.ServiceInterceptorContribution}s,
+     * Returns a list of {@link org.apache.hivemind.internal.ServiceInterceptorConstructor}s,
      * ordered according to their dependencies. May return null or an empty list.
      * <p>
      * Note that the order is tricky! To keep any error messages while ordering the interceptors
@@ -53,7 +53,7 @@
      * 
      * The <code>before</code> value for the first interceptor contribution will be assigned to
      * the contribution's
-     * {@link org.apache.hivemind.internal.ServiceInterceptorContribution#getFollowingInterceptorIds() followingInterceptorIds}
+     * {@link org.apache.hivemind.internal.ServiceInterceptorConstructor#getFollowingNames() followingNames}
      * property, because all other interceptors (including the security interceptor) should have
      * their behavior follow the logging interceptor.
      * <p>

Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/CoreServicesProvider.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/CoreServicesProvider.java?rev=427637&r1=427636&r2=427637&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/CoreServicesProvider.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/CoreServicesProvider.java Tue Aug  1 09:23:42 2006
@@ -1,19 +1,28 @@
 package org.apache.hivemind.impl;
 
+import java.util.Locale;
+
 import org.apache.hivemind.ErrorHandler;
 import org.apache.hivemind.HiveMind;
+import org.apache.hivemind.ShutdownCoordinator;
 import org.apache.hivemind.definition.ModuleDefinition;
 import org.apache.hivemind.definition.RegistryDefinition;
 import org.apache.hivemind.definition.ServiceImplementationDefinition;
 import org.apache.hivemind.definition.ServicePointDefinition;
+import org.apache.hivemind.internal.AbstractServiceImplementationConstructor;
+import org.apache.hivemind.internal.Module;
+import org.apache.hivemind.internal.ServiceImplementationConstructor;
 import org.apache.hivemind.internal.ServiceModel;
+import org.apache.hivemind.internal.ServicePoint;
 import org.apache.hivemind.internal.Visibility;
 import org.apache.hivemind.service.ClassFactory;
 import org.apache.hivemind.service.ThreadEventNotifier;
 import org.apache.hivemind.service.ThreadLocalStorage;
+import org.apache.hivemind.service.ThreadLocale;
 import org.apache.hivemind.service.impl.ClassFactoryImpl;
 import org.apache.hivemind.service.impl.ThreadEventNotifierImpl;
 import org.apache.hivemind.service.impl.ThreadLocalStorageImpl;
+import org.apache.hivemind.service.impl.ThreadLocaleImpl;
 
 /**
  * Loads the core HiveMind services into a registry definition.
@@ -45,6 +54,9 @@
 
         addThreadLocalStorage(md);
 
+        addThreadLocale(md);
+        
+        addShutdownCoordinator(md);
     }
 
     /**
@@ -53,7 +65,7 @@
     private void addClassFactory(ModuleDefinition md)
     {
         ServicePointDefinition spd = addServicePoint(md, "ClassFactory", ClassFactory.class);
-        addServiceImplementation(md, spd, ClassFactoryImpl.class, ServiceModel.PRITIMIVE);
+        addSimpleServiceImplementation(md, spd, ClassFactoryImpl.class, ServiceModel.PRITIMIVE);
     }
 
     /**
@@ -66,7 +78,11 @@
                 md,
                 "ThreadEventNotifier",
                 ThreadEventNotifier.class);
-        addServiceImplementation(md, spd, ThreadEventNotifierImpl.class, ServiceModel.SINGLETON);
+        addSimpleServiceImplementation(
+                md,
+                spd,
+                ThreadEventNotifierImpl.class,
+                ServiceModel.SINGLETON);
     }
 
     /**
@@ -81,25 +97,47 @@
                 md,
                 "ThreadLocalStorage",
                 ThreadLocalStorage.class);
-        addServiceImplementation(md, spd, ThreadLocalStorageImpl.class, ServiceModel.THREADED);
+        addSimpleServiceImplementation(md, spd, ThreadLocalStorageImpl.class, ServiceModel.THREADED);
     }
 
     /**
      * Stores the locale for the current thread. The default is determined when the Registry is
      * first constructed. This locale is used for any messages.
      */
-    // private void addThreadLocale(ModuleDefinition md)
-    // {
-    // ServicePointDefinition spd = addServicePoint(
-    // md,
-    // "ThreadLocale",
-    // ThreadLocale.class);
-    //        
-    // ServiceImplementationDefinition sid = new ServiceImplementationDefinition(null,
-    // new CreateClassServiceConstructor(module.getId(), serviceImplementationClass
-    // .getName()), serviceModel, true);
-    // servicePoint.addImplementation(result);
-    // }
+    private void addThreadLocale(ModuleDefinition md)
+    {
+        ServicePointDefinition spd = addServicePoint(md, "ThreadLocale", ThreadLocale.class);
+
+        // Define inline implementation constructor 
+        ServiceImplementationConstructor constructor = new AbstractServiceImplementationConstructor(md.getLocation(),
+                md.getId())
+        {
+
+            public Object constructCoreServiceImplementation(ServicePoint servicePoint,
+                    Module contributingModule)
+            {
+                // Get the Locale from the registry
+                Locale defaultLocale = contributingModule.getLocale();
+                return new ThreadLocaleImpl(defaultLocale);
+            }
+
+        };
+
+        ServiceImplementationDefinition sid = new ServiceImplementationDefinition(md.getLocation(),
+                constructor, ServiceModel.THREADED, true);
+        spd.addImplementation(sid);
+    }
+    
+    /**
+     * A source of event notifications for when the Registry is shutdown.
+     */
+    private void addShutdownCoordinator(ModuleDefinition md)
+    {
+        ServicePointDefinition spd = addServicePoint(md, "ShutdownCoordinator", ShutdownCoordinator.class);
+        addSimpleServiceImplementation(md, spd, ShutdownCoordinatorImpl.class, ServiceModel.SINGLETON);
+    }
+    
+
     public static ServicePointDefinition addServicePoint(ModuleDefinition module,
             String servicePointId, Class serviceInterface)
     {
@@ -110,12 +148,12 @@
         return result;
     }
 
-    public static ServiceImplementationDefinition addServiceImplementation(ModuleDefinition module,
-            ServicePointDefinition servicePoint, Class serviceImplementationClass,
-            String serviceModel)
+    public static ServiceImplementationDefinition addSimpleServiceImplementation(
+            ModuleDefinition module, ServicePointDefinition servicePoint,
+            Class serviceImplementationClass, String serviceModel)
     {
         ServiceImplementationDefinition result = new ServiceImplementationDefinition(module
-                .getLocation(), new CreateClassServiceConstructor(module.getId(),
+                .getLocation(), new CreateClassServiceConstructor(module.getLocation(), module.getId(),
                 serviceImplementationClass.getName()), serviceModel, true);
         servicePoint.addImplementation(result);
         return result;

Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/CreateClassServiceConstructor.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/CreateClassServiceConstructor.java?rev=427637&r1=427636&r2=427637&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/CreateClassServiceConstructor.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/CreateClassServiceConstructor.java Tue Aug  1 09:23:42 2006
@@ -14,8 +14,9 @@
 
 package org.apache.hivemind.impl;
 
+import org.apache.hivemind.Location;
+import org.apache.hivemind.internal.AbstractServiceImplementationConstructor;
 import org.apache.hivemind.internal.Module;
-import org.apache.hivemind.internal.ServiceImplementationConstructor;
 import org.apache.hivemind.internal.ServicePoint;
 import org.apache.hivemind.util.InstanceCreationUtils;
 
@@ -24,20 +25,13 @@
  * 
  * @author Howard Lewis Ship
  */
-public final class CreateClassServiceConstructor extends BaseLocatable implements
-        ServiceImplementationConstructor
+public final class CreateClassServiceConstructor extends AbstractServiceImplementationConstructor
 {
-    private String _contributingModuleId;
-
     private String _instanceClassName;
 
-    public CreateClassServiceConstructor()
+    public CreateClassServiceConstructor(Location location, String contributingModuleId, String instanceClassName)
     {
-    }
-    
-    public CreateClassServiceConstructor(String contributingModuleId, String instanceClassName)
-    {
-        _contributingModuleId = contributingModuleId;
+        super(location, contributingModuleId);
         _instanceClassName = instanceClassName;
     }
     
@@ -49,19 +43,9 @@
                 getLocation());
     }
 
-    public String getContributingModuleId()
-    {
-        return _contributingModuleId;
-    }
-
     public String getInstanceClassName()
     {
         return _instanceClassName;
-    }
-
-    public void setContributingModuleId(String moduleId)
-    {
-        _contributingModuleId = moduleId;
     }
 
     public void setInstanceClassName(String string)

Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/RegistryInfrastructureImpl.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/RegistryInfrastructureImpl.java?rev=427637&r1=427636&r2=427637&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/RegistryInfrastructureImpl.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/RegistryInfrastructureImpl.java Tue Aug  1 09:23:42 2006
@@ -160,6 +160,9 @@
         _configurationPoints.put(point.getExtensionPointId(), point);
     }
 
+    /**
+     * @see org.apache.hivemind.internal.RegistryInfrastructure#getServicePoint(java.lang.String, org.apache.hivemind.internal.Module)
+     */
     public ServicePoint getServicePoint(String serviceId, Module module)
     {
         checkShutdown();

Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ServicePointImpl.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ServicePointImpl.java?rev=427637&r1=427636&r2=427637&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ServicePointImpl.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ServicePointImpl.java Tue Aug  1 09:23:42 2006
@@ -22,11 +22,11 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.hivemind.ApplicationRuntimeException;
 import org.apache.hivemind.HiveMind;
+import org.apache.hivemind.Orderable;
 import org.apache.hivemind.ShutdownCoordinator;
 import org.apache.hivemind.events.RegistryShutdownListener;
 import org.apache.hivemind.internal.ServiceImplementationConstructor;
 import org.apache.hivemind.internal.ServiceInterceptorConstructor;
-import org.apache.hivemind.internal.ServiceInterceptorContribution;
 import org.apache.hivemind.internal.ServiceModel;
 import org.apache.hivemind.internal.ServiceModelFactory;
 import org.apache.hivemind.order.Orderer;
@@ -237,8 +237,7 @@
     {
         if (!_interceptorsOrdered)
         {
-            // TODO annotations: Order interceptors
-//            _interceptorConstructors = orderInterceptors();
+            _interceptorConstructors = orderInterceptors();
             _interceptorsOrdered = true;
         }
 
@@ -261,14 +260,22 @@
         Iterator i = _interceptorConstructors.iterator();
         while (i.hasNext())
         {
-            ServiceInterceptorContribution sic = (ServiceInterceptorContribution) i.next();
+            ServiceInterceptorConstructor sic = (ServiceInterceptorConstructor) i.next();
 
             // Sort them into runtime excecution order. When we build
             // the interceptor stack we'll apply them in reverse order,
             // building outward from the core service implementation.
 
-            orderer.add(sic, sic.getName(), sic.getPrecedingInterceptorIds(), sic
-                    .getFollowingInterceptorIds());
+            String precedingNames = null;
+            String followingNames = null;
+            // Check if info about ordering is available
+            if (sic instanceof Orderable) {
+                Orderable orderable = (Orderable) sic;
+                precedingNames = orderable.getPrecedingNames();
+                followingNames = orderable.getFollowingNames();
+            }
+            
+            orderer.add(sic, sic.getName(), precedingNames, followingNames);
         }
 
         return orderer.getOrderedObjects();

Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ShutdownCoordinatorImpl.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ShutdownCoordinatorImpl.java?rev=427637&r1=427636&r2=427637&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ShutdownCoordinatorImpl.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ShutdownCoordinatorImpl.java Tue Aug  1 09:23:42 2006
@@ -38,12 +38,7 @@
 
     public ShutdownCoordinatorImpl()
     {
-        this(LogFactory.getLog(ShutdownCoordinatorImpl.class));
-    }
-
-    public ShutdownCoordinatorImpl(Log log)
-    {
-        _log = log;        
+        _log = LogFactory.getLog(ShutdownCoordinator.class);
     }
 
     private EventListenerList _listenerList;

Added: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/AbstractServiceImplementationConstructor.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/AbstractServiceImplementationConstructor.java?rev=427637&view=auto
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/AbstractServiceImplementationConstructor.java (added)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/AbstractServiceImplementationConstructor.java Tue Aug  1 09:23:42 2006
@@ -0,0 +1,35 @@
+package org.apache.hivemind.internal;
+
+import org.apache.hivemind.Location;
+import org.apache.hivemind.impl.BaseLocatable;
+
+/**
+ * Ancestor for implementions of {@link ServiceImplementationConstructor}.
+ * Reduces the number of methods to implement to one.
+ * 
+ * @author Achim Huegen
+ */
+public abstract class AbstractServiceImplementationConstructor extends BaseLocatable implements ServiceImplementationConstructor
+{
+    private String _contributingModuleId;
+
+
+    public AbstractServiceImplementationConstructor(Location location, String contributingModuleId)
+    {
+        super(location);
+        _contributingModuleId = contributingModuleId;
+    }
+
+    public abstract Object constructCoreServiceImplementation(ServicePoint servicePoint,
+            Module contributingModule);
+
+    public String getContributingModuleId()
+    {
+        return _contributingModuleId;
+    }
+
+    public void setContributingModuleId(String moduleId)
+    {
+        _contributingModuleId = moduleId;
+    }
+}

Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ServiceInterceptorConstructor.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ServiceInterceptorConstructor.java?rev=427637&r1=427636&r2=427637&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ServiceInterceptorConstructor.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ServiceInterceptorConstructor.java Tue Aug  1 09:23:42 2006
@@ -18,6 +18,8 @@
 import org.apache.hivemind.Locatable;
 
 /**
+ * Implementations of this interface may additionally implement the {@link org.apache.hivemind.Orderable}
+ * interface if a certain interceptor order is required.
  */
 public interface ServiceInterceptorConstructor extends Locatable
 {

Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/service/impl/LoggingInterceptorFactory.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/service/impl/LoggingInterceptorFactory.java?rev=427637&r1=427636&r2=427637&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/service/impl/LoggingInterceptorFactory.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/service/impl/LoggingInterceptorFactory.java Tue Aug  1 09:23:42 2006
@@ -237,17 +237,29 @@
     }
 
     /**
+     * Untyped version of {@link #createInterceptor(InterceptorStack, Module, List)}.
+     */
+    public void createInterceptor(
+        InterceptorStack stack,
+        Module contributingModule,
+        Object parameters)
+    {
+        createInterceptor(stack, contributingModule, (List) parameters);
+    }
+
+    /**
      * Creates the interceptor.
      * The class that is created is cached; if an interceptor is requested
      * for the same extension point, then the previously constructed class
      * is reused (this can happen with the threaded service model, for example,
      * when a thread-local service implementation is created for different threads).
+     * @param parameters  list with instances of {@link MethodContribution}
      */
     public void createInterceptor(
-        InterceptorStack stack,
-        Module contributingModule,
-        Object parameters)
-    {
+            InterceptorStack stack,
+            Module contributingModule,
+            List parameters)
+        {
         Class interceptorClass = constructInterceptorClass(stack, (List) parameters);
 
         try
@@ -266,9 +278,7 @@
                     ex),
                 ex);
         }
-    }
-
-
+        }
 
     private boolean includeMethod(MethodMatcher matcher, MethodSignature sig)
     {

Modified: hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/FrameworkTestCase.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/FrameworkTestCase.java?rev=427637&r1=427636&r2=427637&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/FrameworkTestCase.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/FrameworkTestCase.java Tue Aug  1 09:23:42 2006
@@ -86,7 +86,7 @@
     protected ServiceImplementationDefinition createServiceImplementationDefinition(Class serviceImplementationClass)
     {
         ServiceImplementationDefinition result = new ServiceImplementationDefinition(newLocation(),
-                new CreateClassServiceConstructor("module", serviceImplementationClass.getName()), 
+                new CreateClassServiceConstructor(newLocation(), "module", serviceImplementationClass.getName()), 
                 "singleton", true);
 
         return result;

Modified: hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/TestMisc.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/TestMisc.java?rev=427637&r1=427636&r2=427637&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/TestMisc.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/TestMisc.java Tue Aug  1 09:23:42 2006
@@ -64,9 +64,8 @@
     {
         String moduleId = "module";
         List p = new ArrayList();
-        InvokeFactoryServiceConstructor c = new InvokeFactoryServiceConstructor();
+        InvokeFactoryServiceConstructor c = new InvokeFactoryServiceConstructor(newLocation(), moduleId);
 
-        c.setContributingModuleId(moduleId);
         c.setParameters(p);
 
         assertSame(moduleId, c.getContributingModuleId());
@@ -79,9 +78,8 @@
 
         replayControls();
 
-        CreateClassServiceConstructor c = new CreateClassServiceConstructor();
-
-        c.setContributingModuleId(moduleId);
+        CreateClassServiceConstructor c = new CreateClassServiceConstructor(newLocation(), moduleId,
+                "java.util.HashMap");
 
         assertSame(moduleId, c.getContributingModuleId());
 
@@ -102,11 +100,8 @@
 
         replayControls();
 
-        CreateClassServiceConstructor c = new CreateClassServiceConstructor();
-
-        c.setContributingModuleId(moduleId);
-
-        c.setInstanceClassName("java.util.HashMap");
+        CreateClassServiceConstructor c = new CreateClassServiceConstructor(newLocation(), moduleId,
+                "java.util.HashMap");
 
         Object o1 = c.constructCoreServiceImplementation(sp, m);
         Object o2 = c.constructCoreServiceImplementation(sp, m);
@@ -127,11 +122,8 @@
         
         ServicePoint sp = new ServicePointImpl();
         
-        CreateClassServiceConstructor c = new CreateClassServiceConstructor();
-
-        c.setContributingModuleId(moduleId);
-
-        c.setInstanceClassName(SimpleBean.class.getName() + ",value=HiveMind");
+        CreateClassServiceConstructor c = new CreateClassServiceConstructor(newLocation(), moduleId,
+                SimpleBean.class.getName() + ",value=HiveMind");
 
         SimpleBean b = (SimpleBean) c.constructCoreServiceImplementation(sp, m);
 
@@ -146,11 +138,8 @@
         
         ServicePoint sp = new ServicePointImpl();
 
-        CreateClassServiceConstructor c = new CreateClassServiceConstructor();
-
-        c.setContributingModuleId(moduleId);
-
-        c.setInstanceClassName(PrivateBean.class.getName());
+        CreateClassServiceConstructor c = new CreateClassServiceConstructor(newLocation(), moduleId,
+                PrivateBean.class.getName());
 
         try
         {

Modified: hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestInterceptors.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestInterceptors.java?rev=427637&r1=427636&r2=427637&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestInterceptors.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestInterceptors.java Tue Aug  1 09:23:42 2006
@@ -14,18 +14,16 @@
 
 package org.apache.hivemind.impl;
 
-import java.util.ArrayList;
+import hivemind.test.FrameworkTestCase;
+
 import java.util.List;
 import java.util.Locale;
-import java.util.Map;
 
-import org.apache.hivemind.ApplicationRuntimeException;
+import org.apache.hivemind.InterceptorStack;
 import org.apache.hivemind.Location;
+import org.apache.hivemind.Orderable;
 import org.apache.hivemind.internal.Module;
-import org.apache.hivemind.internal.ServiceModel;
-import org.apache.hivemind.internal.ServiceModelFactory;
-import org.apache.hivemind.test.HiveMindTestCase;
-import org.easymock.MockControl;
+import org.apache.hivemind.internal.ServiceInterceptorConstructor;
 
 /**
  * Test for interceptors.
@@ -33,83 +31,68 @@
  * @author Howard M. Lewis Ship
  * @since 1.1
  */
-public class TestInterceptors extends HiveMindTestCase
+public class TestInterceptors extends FrameworkTestCase
 {
-    public void testDefaultInterceptorOrdering()
+    private Module newModule()
     {
-        Location l = newLocation();
-        Module module = newModule();
+        ModuleImpl result = new ModuleImpl();
 
-        replayControls();
+        result.setClassResolver(getClassResolver());
+        result.setPackageName("");
+        result.setRegistry(new RegistryInfrastructureImpl(new StrictErrorHandler(), Locale
+                .getDefault()));
+        return result;
+    }
 
+    private ServicePointImpl newServicePoint(Location l, Module module)
+    {
         ServicePointImpl sp = new ServicePointImpl();
         sp.setModule(module);
         sp.setServiceInterfaceName("foo.bar.Baz");
         sp.setExtensionPointId("zip.zap");
         sp.setLocation(l);
-        final ServiceInterceptorContributionImpl interceptor1 = new ServiceInterceptorContributionImpl();
-        interceptor1.setFactoryServiceId("SomeFactory1");
-        sp.addInterceptorContribution(interceptor1);
-        final ServiceInterceptorContributionImpl interceptor2 = new ServiceInterceptorContributionImpl();
-        interceptor2.setFactoryServiceId("SomeFactory2");
-        sp.addInterceptorContribution(interceptor2);
-        sp.setExtensionPointId("ExtensionPointId");
-        final List ordered = sp.getOrderedInterceptorContributions();
-        assertNotNull(ordered);
-        assertEquals(2, ordered.size());
-        assertEquals(interceptor1, ordered.get(0));
-        assertEquals(interceptor2, ordered.get(1));
-        verifyControls();
+        return sp;
     }
-
-    public void testCustomInterceptorOrdering()
+   
+    public void testDefaultInterceptorOrdering()
     {
         Location l = newLocation();
         Module module = newModule();
 
         replayControls();
 
-        ServicePointImpl sp = new ServicePointImpl();
-        sp.setModule(module);
-        sp.setServiceInterfaceName("foo.bar.Baz");
-        sp.setExtensionPointId("zip.zap");
-        sp.setLocation(l);
-        final ServiceInterceptorContributionImpl interceptor1 = new ServiceInterceptorContributionImpl();
-        interceptor1.setFactoryServiceId("SomeFactory1");
-        sp.addInterceptorContribution(interceptor1);
-        final ServiceInterceptorContributionImpl interceptor2 = new ServiceInterceptorContributionImpl();
-        interceptor2.setFactoryServiceId("SomeFactory2");
-        interceptor2.setFollowingInterceptorIds("SomeFactory1");
-        sp.addInterceptorContribution(interceptor2);
+        ServicePointImpl sp = newServicePoint(l, module);
+        
+        final DummyServiceInterceptorConstructor interceptor1 = new DummyServiceInterceptorConstructor(
+                module.getModuleId(), "Interceptor1", null, null);
+        sp.addInterceptor(interceptor1);
+        final DummyServiceInterceptorConstructor interceptor2 = new DummyServiceInterceptorConstructor(
+                module.getModuleId(), "Interceptor2", null, null);
+        sp.addInterceptor(interceptor2);
         sp.setExtensionPointId("ExtensionPointId");
         final List ordered = sp.getOrderedInterceptorContributions();
         assertNotNull(ordered);
         assertEquals(2, ordered.size());
-        assertEquals(interceptor2, ordered.get(0));
-        assertEquals(interceptor1, ordered.get(1));
+        assertEquals(interceptor1, ordered.get(0));
+        assertEquals(interceptor2, ordered.get(1));
         verifyControls();
     }
 
-    public void testInterceptorOrderingByName()
+    public void testCustomInterceptorOrdering()
     {
         Location l = newLocation();
         Module module = newModule();
 
         replayControls();
 
-        ServicePointImpl sp = new ServicePointImpl();
-        sp.setModule(module);
-        sp.setServiceInterfaceName("foo.bar.Baz");
-        sp.setExtensionPointId("zip.zap");
-        sp.setLocation(l);
-        final ServiceInterceptorContributionImpl interceptor1 = new ServiceInterceptorContributionImpl();
-        interceptor1.setFactoryServiceId("SomeFactory1");
-        interceptor1.setName("Interceptor1");
-        sp.addInterceptorContribution(interceptor1);
-        final ServiceInterceptorContributionImpl interceptor2 = new ServiceInterceptorContributionImpl();
-        interceptor2.setFactoryServiceId("SomeFactory2");
-        interceptor2.setFollowingInterceptorIds("Interceptor1");
-        sp.addInterceptorContribution(interceptor2);
+        ServicePointImpl sp = newServicePoint(l, module);
+        
+        final DummyServiceInterceptorConstructor interceptor1 = new DummyServiceInterceptorConstructor(
+                module.getModuleId(), "Interceptor1", null, null);
+        sp.addInterceptor(interceptor1);
+        final DummyServiceInterceptorConstructor interceptor2 = new DummyServiceInterceptorConstructor(
+                module.getModuleId(), "Interceptor2", null, "Interceptor1");
+        sp.addInterceptor(interceptor2);
         sp.setExtensionPointId("ExtensionPointId");
         final List ordered = sp.getOrderedInterceptorContributions();
         assertNotNull(ordered);
@@ -117,5 +100,46 @@
         assertEquals(interceptor2, ordered.get(0));
         assertEquals(interceptor1, ordered.get(1));
         verifyControls();
+    }
+
+    class DummyServiceInterceptorConstructor extends BaseLocatable implements ServiceInterceptorConstructor, Orderable
+    {
+        private String _contributingModuleId;
+        private String _name;
+        private String _precedingInterceptorIds;
+        private String _followingInterceptorIds;
+
+        public DummyServiceInterceptorConstructor(String contributingModuleId, String name, String precedingInterceptorIds, String followingInterceptorIds)
+        {
+            _contributingModuleId = contributingModuleId;
+            _name = name;
+            _precedingInterceptorIds = precedingInterceptorIds;
+            _followingInterceptorIds = followingInterceptorIds;
+        }
+
+        public void constructServiceInterceptor(InterceptorStack interceptorStack, Module contributingModule)
+        {
+        }
+
+        public String getContributingModuleId()
+        {
+            return _contributingModuleId;
+        }
+
+        public String getName()
+        {
+            return _name;
+        }
+
+        public String getFollowingNames()
+        {
+            return _followingInterceptorIds;
+        }
+
+        public String getPrecedingNames()
+        {
+            return _precedingInterceptorIds;
+        }
+
     }
 }

Modified: hivemind/branches/branch-2-0-annot/library/src/java/org/apache/hivemind/lib/impl/MethodInterceptorFactory.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/library/src/java/org/apache/hivemind/lib/impl/MethodInterceptorFactory.java?rev=427637&r1=427636&r2=427637&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/library/src/java/org/apache/hivemind/lib/impl/MethodInterceptorFactory.java (original)
+++ hivemind/branches/branch-2-0-annot/library/src/java/org/apache/hivemind/lib/impl/MethodInterceptorFactory.java Tue Aug  1 09:23:42 2006
@@ -39,16 +39,23 @@
 {
 
     /**
-     * 
      * @see org.apache.hivemind.ServiceInterceptorFactory#createInterceptor(org.apache.hivemind.InterceptorStack, org.apache.hivemind.internal.Module, java.util.List)
      */
     public void createInterceptor(InterceptorStack stack, Module invokingModule, Object parameters)
     {
-        final Class[] interfaces = new Class[]{stack.getServiceInterface()};
-        final ClassLoader classLoader = invokingModule.getClassResolver().getClassLoader();
         final Object parameter = ((List) parameters).get( 0 ); 
         Defense.isAssignable( parameter, MethodInterceptor.class, "Implementation Object" );
         MethodInterceptor methodInterceptor = ( MethodInterceptor )parameter;
+        createInterceptor(stack, invokingModule, methodInterceptor);
+    }
+ 
+    /**
+     * @see org.apache.hivemind.ServiceInterceptorFactory#createInterceptor(org.apache.hivemind.InterceptorStack, org.apache.hivemind.internal.Module, java.util.List)
+     */
+    public void createInterceptor(InterceptorStack stack, Module invokingModule, MethodInterceptor methodInterceptor)
+    {
+        final Class[] interfaces = new Class[]{stack.getServiceInterface()};
+        final ClassLoader classLoader = invokingModule.getClassResolver().getClassLoader();
         final InvocationHandler invocationHandler = new MethodInterceptorInvocationHandler( methodInterceptor, stack );
         stack.push( Proxy.newProxyInstance( classLoader, interfaces, invocationHandler ) );
     }

Modified: hivemind/branches/branch-2-0-annot/xml/src/descriptor/META-INF/hivemodule.xml
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/xml/src/descriptor/META-INF/hivemodule.xml?rev=427637&r1=427636&r2=427637&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/xml/src/descriptor/META-INF/hivemodule.xml (original)
+++ hivemind/branches/branch-2-0-annot/xml/src/descriptor/META-INF/hivemodule.xml Tue Aug  1 09:23:42 2006
@@ -527,17 +527,6 @@
     <translator class="schema.rules.NullTranslator" name="null"/>
   </contribution>
   
-  <service-point id="ShutdownCoordinator">
-    
-    A source of event notifications for when the Registry is shutdown.
-      
-    <invoke-factory>
-      <construct class="impl.ShutdownCoordinatorImpl">
-        <log/>
-      </construct>
-    </invoke-factory>
-  </service-point>
-  
   <configuration-point id="Startup">
     
     A configuration to which startup objects may be contributed (as objects or services). 
@@ -680,23 +669,6 @@
     <provider prefix="service-property" service-id="ServicePropertyObjectProvider"/>
     <provider prefix="class" service-id="ClassObjectProvider"/>
   </contribution>
-  
-  <service-point id="ThreadLocale" interface="org.apache.hivemind.service.ThreadLocale">
-    
-    Stores the locale for the current thread. The default is determined when the Registry is first
-    constructed.  This locale is used for any messages.
-    
-    <invoke-factory service-id="ThreadLocaleFactory" model="threaded"/>
-    
-  </service-point>
-  
-  <service-point id="ThreadLocaleFactory" interface="ServiceImplementationFactory" parameters-occurs="none" visibility="private">
-    
-    Special service implementation factory for the ThreadLocale service.
-    
-    <create-instance class="service.impl.ThreadLocaleFactory"/>
-    
-  </service-point>
   
   <service-point id="InterfaceSynthesizer" interface="org.apache.hivemind.service.InterfaceSynthesizer">
     

Modified: hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/ServiceImplementationFactory.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/ServiceImplementationFactory.java?rev=427637&r1=427636&r2=427637&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/ServiceImplementationFactory.java (original)
+++ hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/ServiceImplementationFactory.java Tue Aug  1 09:23:42 2006
@@ -16,6 +16,8 @@
 
 /**
  * Interface for an object that can create a service's core implementation.
+ * Mainly used in the xml module for parameterized consruction of services
+ * over a standardized interface.
  * 
  * @author Howard Lewis Ship
  */

Modified: hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/InvokeFactoryInterceptorConstructor.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/InvokeFactoryInterceptorConstructor.java?rev=427637&r1=427636&r2=427637&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/InvokeFactoryInterceptorConstructor.java (original)
+++ hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/InvokeFactoryInterceptorConstructor.java Tue Aug  1 09:23:42 2006
@@ -18,6 +18,7 @@
 
 import org.apache.hivemind.ApplicationRuntimeException;
 import org.apache.hivemind.InterceptorStack;
+import org.apache.hivemind.Orderable;
 import org.apache.hivemind.ServiceInterceptorFactory;
 import org.apache.hivemind.TranslatorManager;
 import org.apache.hivemind.impl.natures.XmlRegistryNature;
@@ -34,7 +35,7 @@
  * {@link org.apache.hivemind.ServiceInterceptorFactory} interface.
  */
 public final class InvokeFactoryInterceptorConstructor extends BaseLocatable implements
-        ServiceInterceptorConstructor
+        ServiceInterceptorConstructor, Orderable
 {
     private String _factoryServiceId;
     
@@ -47,10 +48,28 @@
 
     /** The parameters converted to objects as per the factory's parameter schema. */
     private Object _convertedParameters;
+
+    private String _name;
+
+    private String _precedingInterceptorIds;
+
+    private String _followingInterceptorIds;
     
+    /**
+     * @return Returns the name.
+     */
     public String getName()
     {
-        return _factoryServiceId;
+        if( _name == null )
+        {
+            return _factoryServiceId;
+        }
+        return _name;
+    }
+    
+    public void setName( String name )
+    {
+        _name = name;
     }
 
     public void constructServiceInterceptor(InterceptorStack stack, Module contributingModule)
@@ -126,5 +145,25 @@
                 definingModule,
                 containerClassName,
                 getLocation());
+    }
+
+    public void setFollowingInterceptorIds(String ids)
+    {
+        _followingInterceptorIds = ids;
+    }
+
+    public void setPrecedingInterceptorIds(String ids)
+    {
+        _precedingInterceptorIds = ids;
+    }
+
+    public String getFollowingNames()
+    {
+        return _followingInterceptorIds;
+    }
+
+    public String getPrecedingNames()
+    {
+        return _precedingInterceptorIds;
     }
 }

Modified: hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/InvokeFactoryServiceConstructor.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/InvokeFactoryServiceConstructor.java?rev=427637&r1=427636&r2=427637&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/InvokeFactoryServiceConstructor.java (original)
+++ hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/InvokeFactoryServiceConstructor.java Tue Aug  1 09:23:42 2006
@@ -18,12 +18,14 @@
 
 import org.apache.hivemind.ApplicationRuntimeException;
 import org.apache.hivemind.ErrorLog;
+import org.apache.hivemind.Location;
 import org.apache.hivemind.Occurances;
 import org.apache.hivemind.ServiceImplementationFactory;
 import org.apache.hivemind.ServiceImplementationFactoryParameters;
 import org.apache.hivemind.TranslatorManager;
 import org.apache.hivemind.impl.natures.XmlRegistryNature;
 import org.apache.hivemind.impl.natures.XmlServicePointNature;
+import org.apache.hivemind.internal.AbstractServiceImplementationConstructor;
 import org.apache.hivemind.internal.Module;
 import org.apache.hivemind.internal.ServiceImplementationConstructor;
 import org.apache.hivemind.internal.ServicePoint;
@@ -37,13 +39,10 @@
  * 
  * @author Howard Lewis Ship
  */
-public final class InvokeFactoryServiceConstructor extends BaseLocatable implements
-        ServiceImplementationConstructor
+public final class InvokeFactoryServiceConstructor extends AbstractServiceImplementationConstructor
 {
     private String _factoryServiceId;
 
-    private String _contributingModuleId;
-
     /** List of {@link org.apache.hivemind.Element}, the raw XML parameters. */
     private List _parameters;
 
@@ -52,6 +51,11 @@
 
     /** The parameters converted to objects as per the factory's parameter schema. */
     private Object _convertedParameters;
+    
+    public InvokeFactoryServiceConstructor(Location location, String contributingModuleId)
+    {
+        super(location, contributingModuleId);
+    }
 
     public Object constructCoreServiceImplementation(ServicePoint servicePoint, Module contributingModule)
     {
@@ -105,16 +109,6 @@
                 processor.process(_convertedParameters, _parameters, contributingModule, translatorManager);
             }
         }
-    }
-
-    public String getContributingModuleId()
-    {
-        return _contributingModuleId;
-    }
-
-    public void setContributingModuleId(String moduleId)
-    {
-        _contributingModuleId = moduleId;
     }
 
     public List getParameters()

Modified: hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/XmlModuleDescriptorProcessor.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/XmlModuleDescriptorProcessor.java?rev=427637&r1=427636&r2=427637&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/XmlModuleDescriptorProcessor.java (original)
+++ hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/XmlModuleDescriptorProcessor.java Tue Aug  1 09:23:42 2006
@@ -303,6 +303,9 @@
         constructor.setFactoryServiceId(id.getFactoryServiceId());
         constructor.setParameters(id.getParameters());
         constructor.setContributingModuleId(contributingModuleId);
+        constructor.setName(id.getName());
+        constructor.setPrecedingInterceptorIds(id.getBefore());
+        constructor.setFollowingInterceptorIds(id.getAfter());
         ServiceInterceptorDefinition interceptor = new ServiceInterceptorDefinition(
                 id.getLocation(), constructor);
         _registryDefinition.addServiceInterceptor(qualifiedPointId, interceptor);

Modified: hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/parse/CreateInstanceDescriptor.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/parse/CreateInstanceDescriptor.java?rev=427637&r1=427636&r2=427637&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/parse/CreateInstanceDescriptor.java (original)
+++ hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/parse/CreateInstanceDescriptor.java Tue Aug  1 09:23:42 2006
@@ -43,11 +43,8 @@
     public ServiceImplementationConstructor createConstructor(
         String contributingModuleId)
     {
-        CreateClassServiceConstructor result = new CreateClassServiceConstructor();
-
-        result.setLocation(getLocation());
-        result.setContributingModuleId(contributingModuleId);
-        result.setInstanceClassName(_instanceClassName);
+        CreateClassServiceConstructor result = new CreateClassServiceConstructor(
+                getLocation(), contributingModuleId, _instanceClassName);
 
         return result;
     }

Modified: hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/parse/InvokeFactoryDescriptor.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/parse/InvokeFactoryDescriptor.java?rev=427637&r1=427636&r2=427637&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/parse/InvokeFactoryDescriptor.java (original)
+++ hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/parse/InvokeFactoryDescriptor.java Tue Aug  1 09:23:42 2006
@@ -32,10 +32,9 @@
     public ServiceImplementationConstructor createConstructor(
         String contributingModuleId)
     {
-        InvokeFactoryServiceConstructor result = new InvokeFactoryServiceConstructor();
+        InvokeFactoryServiceConstructor result = new InvokeFactoryServiceConstructor(getLocation(),
+                contributingModuleId);
 
-        result.setLocation(getLocation());
-        result.setContributingModuleId(contributingModuleId);
         result.setParameters(getParameters());
         result.setFactoryServiceId(getFactoryServiceId());
 

Modified: hivemind/branches/branch-2-0-annot/xml/src/test/hivemind/test/parse/TestToString.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/xml/src/test/hivemind/test/parse/TestToString.java?rev=427637&r1=427636&r2=427637&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/xml/src/test/hivemind/test/parse/TestToString.java (original)
+++ hivemind/branches/branch-2-0-annot/xml/src/test/hivemind/test/parse/TestToString.java Tue Aug  1 09:23:42 2006
@@ -20,13 +20,11 @@
 
 import org.apache.hivemind.impl.AttributeImpl;
 import org.apache.hivemind.impl.ConfigurationPointImpl;
-import org.apache.hivemind.impl.ContributionImpl;
 import org.apache.hivemind.impl.DefaultErrorHandler;
 import org.apache.hivemind.impl.ElementImpl;
 import org.apache.hivemind.impl.InterceptorStackImpl;
 import org.apache.hivemind.impl.ModuleImpl;
 import org.apache.hivemind.impl.RegistryInfrastructureImpl;
-import org.apache.hivemind.impl.ServiceInterceptorContributionImpl;
 import org.apache.hivemind.impl.ServicePointImpl;
 import org.apache.hivemind.internal.ServicePoint;
 import org.apache.hivemind.parse.ConfigurationPointDescriptor;
@@ -71,7 +69,6 @@
         new ConfigurationPointImpl().toString();
         new ElementImpl().toString();
         new AttributeImpl("foo", "bar").toString();
-        new ServiceInterceptorContributionImpl().toString();
         new ServicePointImpl().toString();
         new InterceptorStackImpl(null, mockServicePoint, null).toString();
     }

Modified: hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/impl/TestInvokeFactoryServiceConstructor.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/impl/TestInvokeFactoryServiceConstructor.java?rev=427637&r1=427636&r2=427637&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/impl/TestInvokeFactoryServiceConstructor.java (original)
+++ hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/impl/TestInvokeFactoryServiceConstructor.java Tue Aug  1 09:23:42 2006
@@ -60,7 +60,7 @@
         MockControl xmlRegistryNatureControl = newControl(XmlRegistryNature.class);
         XmlRegistryNature xmlRegistryNature = (XmlRegistryNature) xmlRegistryNatureControl.getMock();
 
-        InvokeFactoryServiceConstructor c = new InvokeFactoryServiceConstructor();
+        InvokeFactoryServiceConstructor c = new InvokeFactoryServiceConstructor(newLocation(), "module");
 
         ErrorLog log = (ErrorLog) newMock(ErrorLog.class);
 
@@ -101,7 +101,6 @@
 
         replayControls();
 
-        c.setContributingModuleId("module");
         c.setFactoryServiceId("foo.bar.Baz");
         c.setParameters(Collections.EMPTY_LIST);