hivemind-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahue...@apache.org
Subject svn commit: r438412 - in /hivemind/branches/branch-2-0-annot: framework/src/java/org/apache/hivemind/ framework/src/java/org/apache/hivemind/definition/ framework/src/java/org/apache/hivemind/impl/ framework/src/java/org/apache/hivemind/impl/servicemod...
Date Wed, 30 Aug 2006 07:49:03 GMT
Author: ahuegen
Date: Wed Aug 30 00:48:57 2006
New Revision: 438412

URL: http://svn.apache.org/viewvc?rev=438412&view=rev
Log:
ServicePointImpl keeps a reference to ServicePointDefinition

Modified:
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/HiveMindMessages.java
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/HiveMindStrings.properties
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ContributionDefinition.java
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ExtensionDefinition.java
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ModuleDefinitionHelper.java
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ServiceImplementationDefinition.java
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ServiceInterceptorDefinition.java
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ServicePointDefinition.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/ImplMessages.java
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/RegistryInfrastructureConstructor.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/servicemodel/AbstractServiceModelImpl.java
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/AbstractServiceImplementationConstructor.java
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ServiceImplementationConstructor.java
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/util/Defense.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/hivemind/test/TestServicesByInterface.java
    hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/StringHolderModule.java
    hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/TestServices.java
    hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/TestShutdown.java
    hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestInterceptors.java
    hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestRegistryInfrastructure.java
    hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestServicePoint.java
    hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/servicemodel/TestRegistryShutdownListenerServices.java
    hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/service/impl/CglibBeanInterfaceFactory.java
    hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/service/impl/JavassistBeanInterfaceFactory.java
    hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/service/impl/JdkBeanInterfaceFactory.java
    hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/service/impl/TestLoggingInterceptorFactory.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/test/org/apache/hivemind/impl/TestInvokeFactoryServiceConstructor.java

Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/HiveMindMessages.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/HiveMindMessages.java?rev=438412&r1=438411&r2=438412&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/HiveMindMessages.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/HiveMindMessages.java Wed Aug 30 00:48:57 2006
@@ -46,6 +46,11 @@
     {
         return _formatter.format("param-not-null", parameterName);
     }
+    
+    public static String fieldNotNull(String fieldName)
+    {
+        return _formatter.format("field-not-null", fieldName);
+    }
 
     /** @since 1.1 */
     public static String paramWrongType(String parameterName, Object parameter, Class expectedType)

Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/HiveMindStrings.properties
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/HiveMindStrings.properties?rev=438412&r1=438411&r2=438412&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/HiveMindStrings.properties (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/HiveMindStrings.properties Wed Aug 30 00:48:57 2006
@@ -16,6 +16,7 @@
 unimplemented-method=Class {0} must provide an overridden implementation of method {1}().
 registry-shutdown=The HiveMind Registry has been shutdown.
 param-not-null=Parameter {0} must not be null.
+field-not-null=Field {0} has not been assigned.
 param-wrong-type=Parameter {0} is of type {1} which is not compatible with {2}.
 
 

Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ContributionDefinition.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ContributionDefinition.java?rev=438412&r1=438411&r2=438412&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ContributionDefinition.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ContributionDefinition.java Wed Aug 30 00:48:57 2006
@@ -7,14 +7,15 @@
 {
     private Contribution _contributionConstructor;
 
-    public ContributionDefinition()
+    public ContributionDefinition(ModuleDefinition module)
     {
+        super(module);
     }
 
-    public ContributionDefinition(Location location,
+    public ContributionDefinition(ModuleDefinition module, Location location,
             Contribution contributionConstructor)
     {
-        super(location);
+        super(module, location);
         _contributionConstructor = contributionConstructor;
     }
 

Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ExtensionDefinition.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ExtensionDefinition.java?rev=438412&r1=438411&r2=438412&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ExtensionDefinition.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ExtensionDefinition.java Wed Aug 30 00:48:57 2006
@@ -4,22 +4,42 @@
 import java.util.Map;
 
 import org.apache.hivemind.Location;
+import org.apache.hivemind.util.Defense;
 
 public class ExtensionDefinition
 {
     private Location _location;
-
+    private ModuleDefinition _module;
     private Map _natures = new HashMap();
 
-    public ExtensionDefinition()
+    public ExtensionDefinition(ModuleDefinition module)
     {
+        _module = module;
     }
 
-    public ExtensionDefinition(Location location)
+    public ExtensionDefinition(ModuleDefinition module, Location location)
     {
+        _module = module;
         _location = location;
     }
 
+    /**
+     * @return the id of the module that contributed this extension
+     */
+    public String getModuleId()
+    {
+        Defense.fieldNotNull(_module, "module");
+        return _module.getId();
+    }
+
+    /**
+     * @return  the module that contributed this extension
+     */
+    public ModuleDefinition getModule()
+    {
+        return _module;
+    }
+
     public Location getLocation()
     {
         return _location;
@@ -39,5 +59,5 @@
     {
         _natures.put(natureClass, nature);
     }
-
+    
 }

Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ModuleDefinitionHelper.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ModuleDefinitionHelper.java?rev=438412&r1=438411&r2=438412&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ModuleDefinitionHelper.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ModuleDefinitionHelper.java Wed Aug 30 00:48:57 2006
@@ -39,7 +39,7 @@
             ServiceImplementationConstructor constructor, String serviceModel
             )
     {
-        ServiceImplementationDefinition result = new ServiceImplementationDefinition(_module
+        ServiceImplementationDefinition result = new ServiceImplementationDefinition(_module, _module
                 .getLocation(), constructor, serviceModel, true);
         servicePoint.addImplementation(result);
         return result;
@@ -50,7 +50,7 @@
             String serviceImplementationClass, String serviceModel)
     {
         return addServiceImplementation(servicePoint, 
-                new CreateClassServiceConstructor(_module.getLocation(), _module.getId(), serviceImplementationClass), 
+                new CreateClassServiceConstructor(_module.getLocation(), serviceImplementationClass), 
                 serviceModel);
     }
     
@@ -67,7 +67,7 @@
     public ContributionDefinition addContributionDefinition(ConfigurationPointDefinition configurationPoint,
             Contribution contributionConstructor)
     {
-        ContributionDefinition result = new ContributionDefinition(_module.getLocation(), contributionConstructor);
+        ContributionDefinition result = new ContributionDefinition(_module, _module.getLocation(), contributionConstructor);
         configurationPoint.addContribution(result);
         return result;
     }
@@ -75,7 +75,7 @@
     public ContributionDefinition addContributionDefinition(String fullyQualifiedConfigurationPointId, 
             Contribution contributionConstructor)
     {
-        ContributionDefinition result = new ContributionDefinition(_module.getLocation(), contributionConstructor);
+        ContributionDefinition result = new ContributionDefinition(_module, _module.getLocation(), contributionConstructor);
         _module.addContribution(fullyQualifiedConfigurationPointId, result);
         return result;
     }

Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ServiceImplementationDefinition.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ServiceImplementationDefinition.java?rev=438412&r1=438411&r2=438412&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ServiceImplementationDefinition.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ServiceImplementationDefinition.java Wed Aug 30 00:48:57 2006
@@ -9,13 +9,14 @@
     private ServiceImplementationConstructor _serviceConstructor;
     private boolean _isDefault;
     
-    public ServiceImplementationDefinition()
+    public ServiceImplementationDefinition(ModuleDefinition module)
     {
+        super(module);
     }
 
-    public ServiceImplementationDefinition(Location location, ServiceImplementationConstructor serviceConstructor, String serviceModel, boolean isDefault)
+    public ServiceImplementationDefinition(ModuleDefinition module, Location location, ServiceImplementationConstructor serviceConstructor, String serviceModel, boolean isDefault)
     {
-        super(location);
+        super(module, location);
         _serviceConstructor = serviceConstructor;
         _serviceModel = serviceModel;
         _isDefault = isDefault;
@@ -50,4 +51,5 @@
     {
         _serviceConstructor = serviceConstructor;
     }
+
 }

Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ServiceInterceptorDefinition.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ServiceInterceptorDefinition.java?rev=438412&r1=438411&r2=438412&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ServiceInterceptorDefinition.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ServiceInterceptorDefinition.java Wed Aug 30 00:48:57 2006
@@ -7,14 +7,15 @@
 {
     private ServiceInterceptorConstructor _interceptorConstructor;
 
-    public ServiceInterceptorDefinition()
+    public ServiceInterceptorDefinition(ModuleDefinition module)
     {
+        super(module);
     }
 
-    public ServiceInterceptorDefinition(Location location,
+    public ServiceInterceptorDefinition(ModuleDefinition module, Location location,
             ServiceInterceptorConstructor interceptorConstructor)
     {
-        super(location);
+        super(module, location);
         _interceptorConstructor = interceptorConstructor;
     }
 

Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ServicePointDefinition.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ServicePointDefinition.java?rev=438412&r1=438411&r2=438412&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ServicePointDefinition.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ServicePointDefinition.java Wed Aug 30 00:48:57 2006
@@ -25,7 +25,7 @@
         _interfaceClassName = interfaceClassName;
     }
 
-   public String getInterfaceClassName()
+    public String getInterfaceClassName()
     {
         return _interfaceClassName;
     }

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=438412&r1=438411&r2=438412&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 Wed Aug 30 00:48:57 2006
@@ -16,6 +16,7 @@
 
 import java.util.List;
 
+import org.apache.hivemind.definition.ServiceImplementationDefinition;
 import org.apache.hivemind.events.RegistryShutdownListener;
 import org.apache.hivemind.internal.ServiceImplementationConstructor;
 import org.apache.hivemind.internal.ServicePoint;
@@ -37,6 +38,8 @@
      */
     ServiceImplementationConstructor getServiceConstructor();
 
+    ServiceImplementationDefinition getImplementationDefinition();
+    
     /**
      * Returns a list of {@link org.apache.hivemind.internal.ServiceInterceptorConstructor}s,
      * ordered according to their dependencies. May return null or an empty list.

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=438412&r1=438411&r2=438412&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 Wed Aug 30 00:48:57 2006
@@ -132,8 +132,7 @@
         ServicePointDefinition spd = helper.addServicePoint("ThreadLocale", ThreadLocale.class.getName());
 
         // Define inline implementation constructor 
-        ServiceImplementationConstructor constructor = new AbstractServiceImplementationConstructor(md.getLocation(),
-                md.getId())
+        ServiceImplementationConstructor constructor = new AbstractServiceImplementationConstructor(md.getLocation())
         {
 
             public Object constructCoreServiceImplementation(ServicePoint servicePoint,
@@ -166,8 +165,7 @@
         ServicePointDefinition spd = helper.addServicePoint("EagerLoad", Runnable.class.getName());
 
         // Define inline implementation constructor, that wires the EagerLoad configuration
-        ServiceImplementationConstructor constructor = new AbstractServiceImplementationConstructor(md.getLocation(),
-                md.getId())
+        ServiceImplementationConstructor constructor = new AbstractServiceImplementationConstructor(md.getLocation())
         {
             public Object constructCoreServiceImplementation(ServicePoint servicePoint,
                     Module contributingModule)
@@ -197,8 +195,7 @@
         ServicePointDefinition spd = helper.addServicePoint("Startup", Runnable.class.getName());
 
         // Define inline implementation constructor, that wires the Startup configuration
-        ServiceImplementationConstructor constructor = new AbstractServiceImplementationConstructor(md.getLocation(),
-                helper.getModule().getId())
+        ServiceImplementationConstructor constructor = new AbstractServiceImplementationConstructor(md.getLocation())
         {
             public Object constructCoreServiceImplementation(ServicePoint servicePoint,
                     Module contributingModule)
@@ -280,8 +277,7 @@
         ServicePointDefinition spd = helper.addServicePoint("InterfaceSynthesizer", InterfaceSynthesizer.class.getName());
 
         // Define inline implementation constructor 
-        ServiceImplementationConstructor constructor = new AbstractServiceImplementationConstructor(md.getLocation(),
-                md.getId())
+        ServiceImplementationConstructor constructor = new AbstractServiceImplementationConstructor(md.getLocation())
         {
             public Object constructCoreServiceImplementation(ServicePoint servicePoint,
                     Module contributingModule)

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=438412&r1=438411&r2=438412&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 Wed Aug 30 00:48:57 2006
@@ -29,9 +29,9 @@
 {
     private String _instanceClassName;
 
-    public CreateClassServiceConstructor(Location location, String contributingModuleId, String instanceClassName)
+    public CreateClassServiceConstructor(Location location, String instanceClassName)
     {
-        super(location, contributingModuleId);
+        super(location);
         _instanceClassName = instanceClassName;
     }
     

Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ImplMessages.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ImplMessages.java?rev=438412&r1=438411&r2=438412&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ImplMessages.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ImplMessages.java Wed Aug 30 00:48:57 2006
@@ -133,7 +133,7 @@
             ServicePointImpl existing)
     {
         return _formatter.format("duplicate-factory", sourceModule.getModuleId(), pointId, existing
-                .getServiceConstructor().getContributingModuleId());
+                .getImplementationDefinition().getModuleId());
     }
 
     static String noSuchConfiguration(String pointId)

Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/RegistryInfrastructureConstructor.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/RegistryInfrastructureConstructor.java?rev=438412&r1=438411&r2=438412&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/RegistryInfrastructureConstructor.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/RegistryInfrastructureConstructor.java Wed Aug 30 00:48:57 2006
@@ -160,11 +160,9 @@
 
             ServicePointImpl point = new ServicePointImpl();
 
+            point.setDefinition(sd);
             point.setExtensionPointId(pointId);
-            point.setLocation(sd.getLocation());
             point.setModule(module);
-            point.setServiceInterfaceName(sd.getInterfaceClassName());
-            point.setVisibility(sd.getVisibility());
 
             // Copy natures from definition to point
             for (Iterator natures = sd.getNatures().entrySet().iterator(); natures.hasNext();)
@@ -241,8 +239,7 @@
                 return;
             }
     
-            point.setServiceModel(impl.getServiceModel());
-            point.setServiceConstructor(impl.getServiceConstructor(), true);
+            point.setDefinition(sd);
         }
     }
     

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=438412&r1=438411&r2=438412&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 Wed Aug 30 00:48:57 2006
@@ -24,6 +24,8 @@
 import org.apache.hivemind.HiveMind;
 import org.apache.hivemind.Orderable;
 import org.apache.hivemind.ShutdownCoordinator;
+import org.apache.hivemind.definition.ServiceImplementationDefinition;
+import org.apache.hivemind.definition.ServicePointDefinition;
 import org.apache.hivemind.events.RegistryShutdownListener;
 import org.apache.hivemind.internal.ServiceImplementationConstructor;
 import org.apache.hivemind.internal.ServiceInterceptorConstructor;
@@ -47,21 +49,18 @@
 
     private boolean _building;
 
-    private String _serviceInterfaceName;
-
     private Class _serviceInterface;
 
     private Class _declaredInterface;
 
-    private ServiceImplementationConstructor _defaultServiceConstructor;
-
-    private ServiceImplementationConstructor _serviceConstructor;
-
     private List _interceptorConstructors;
 
     private boolean _interceptorsOrdered;
 
-    private String _serviceModel;
+    /**
+     * The service point definition that describes this service point
+     */
+    private ServicePointDefinition _definition;
 
     private ShutdownCoordinator _shutdownCoordinator;
 
@@ -72,11 +71,10 @@
         if (_service != null)
             builder.append("service", _service);
 
-        builder.append("serviceInterfaceName", _serviceInterfaceName);
-        builder.append("defaultServiceConstructor", _defaultServiceConstructor);
-        builder.append("serviceConstructor", _serviceConstructor);
+        builder.append("serviceInterfaceName", getServiceInterfaceClassName());
+        builder.append("serviceConstructor", getServiceConstructor());
         builder.append("interceptorConstructors", _interceptorConstructors);
-        builder.append("serviceModel", _serviceModel);
+        builder.append("serviceModel", getServiceModel());
 
         if (_building)
             builder.append("building", _building);
@@ -110,7 +108,7 @@
 
     public String getServiceInterfaceClassName()
     {
-        return _serviceInterfaceName;
+        return _definition.getInterfaceClassName();
     }
 
     private Class lookupDeclaredInterface()
@@ -119,12 +117,12 @@
 
         try
         {
-            result = getModule().resolveType(_serviceInterfaceName);
+            result = getModule().resolveType(getServiceInterfaceClassName());
         }
         catch (Exception ex)
         {
             throw new ApplicationRuntimeException(ImplMessages.badInterface(
-                    _serviceInterfaceName,
+                    getServiceInterfaceClassName(),
                     getExtensionPointId()), getLocation(), ex);
         }
 
@@ -147,25 +145,6 @@
         return is.synthesizeInterface(declaredInterface);
     }
 
-    public void setServiceConstructor(ServiceImplementationConstructor contribution,
-            boolean defaultConstructor)
-    {
-        if (defaultConstructor)
-            _defaultServiceConstructor = contribution;
-        else
-            _serviceConstructor = contribution;
-    }
-
-    public void setServiceInterfaceName(String string)
-    {
-        _serviceInterfaceName = string;
-    }
-
-    public ServiceImplementationConstructor getServiceConstructor(boolean defaultConstructor)
-    {
-        return defaultConstructor ? _defaultServiceConstructor : _serviceConstructor;
-    }
-
     /**
      * Invoked by {@link #getService(Class)} to get a service implementation from the
      * {@link ServiceModel}.
@@ -217,17 +196,11 @@
 
     public String getServiceModel()
     {
-        return _serviceModel;
-    }
-
-    public void setServiceModel(String model)
-    {
-        _serviceModel = model;
+        return getImplementationDefinition().getServiceModel();
     }
 
     public void clearConstructorInformation()
     {
-        _serviceConstructor = null;
         _interceptorConstructors = null;
     }
 
@@ -302,13 +275,35 @@
     }
 
     /**
-     * Returns the service constructor, if defined, or the default service constructor. The default
-     * service constructor comes from the <service-point> itself; other modules can override
-     * this default using an <implementation> element.
+     * Returns the service constructor.
      */
 
     public ServiceImplementationConstructor getServiceConstructor()
     {
-        return _serviceConstructor == null ? _defaultServiceConstructor : _serviceConstructor;
+        return getImplementationDefinition().getServiceConstructor();
+    }
+
+    public ServiceImplementationDefinition getImplementationDefinition()
+    {
+        return _definition.getDefaultImplementation();
+    }
+    
+    /**
+     * @return  the service point definition that describes this service point
+     */
+    public ServicePointDefinition getDefinition()
+    {
+        return _definition;
+    }
+
+    /**
+     * Sets the service point definition that describes this service point
+     * @param definition
+     */
+    public void setDefinition(ServicePointDefinition definition)
+    {
+        _definition = definition;
+        setLocation(_definition.getLocation());
+        setVisibility(_definition.getVisibility());
     }
 }

Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/servicemodel/AbstractServiceModelImpl.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/servicemodel/AbstractServiceModelImpl.java?rev=438412&r1=438411&r2=438412&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/servicemodel/AbstractServiceModelImpl.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/servicemodel/AbstractServiceModelImpl.java Wed Aug 30 00:48:57 2006
@@ -21,6 +21,7 @@
 import org.apache.hivemind.ApplicationRuntimeException;
 import org.apache.hivemind.HiveMind;
 import org.apache.hivemind.ShutdownCoordinator;
+import org.apache.hivemind.definition.ServiceImplementationDefinition;
 import org.apache.hivemind.events.RegistryShutdownListener;
 import org.apache.hivemind.impl.ConstructableServicePoint;
 import org.apache.hivemind.impl.InterceptorStackImpl;
@@ -105,8 +106,10 @@
         Class serviceInterface = _servicePoint.getServiceInterface();
         Class declaredInterface = _servicePoint.getDeclaredInterface();
 
-        ServiceImplementationConstructor constructor = _servicePoint.getServiceConstructor();
-        String contributingModuleId = constructor.getContributingModuleId();
+        ServiceImplementationDefinition implementationDefinition = _servicePoint.getImplementationDefinition();
+        ServiceImplementationConstructor constructor = implementationDefinition.getServiceConstructor();
+        // Get a reference to the module that provided the implementation 
+        String contributingModuleId = implementationDefinition.getModuleId();
         // Is there a more elegant way to retrieve a module?
         Module contributingModule = _servicePoint.getModule().getModule(contributingModuleId);
         Object result = constructor.constructCoreServiceImplementation(_servicePoint, contributingModule);

Modified: 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=438412&r1=438411&r2=438412&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/AbstractServiceImplementationConstructor.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/AbstractServiceImplementationConstructor.java Wed Aug 30 00:48:57 2006
@@ -4,32 +4,19 @@
 import org.apache.hivemind.impl.BaseLocatable;
 
 /**
- * Ancestor for implementions of {@link ServiceImplementationConstructor}.
- * Reduces the number of methods to implement to one.
+ * Ancestor for implementations of {@link ServiceImplementationConstructor}.
  * 
  * @author Achim Huegen
  */
 public abstract class AbstractServiceImplementationConstructor extends BaseLocatable implements ServiceImplementationConstructor
 {
-    private String _contributingModuleId;
 
-
-    public AbstractServiceImplementationConstructor(Location location, String contributingModuleId)
+    public AbstractServiceImplementationConstructor(Location location)
     {
         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/ServiceImplementationConstructor.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ServiceImplementationConstructor.java?rev=438412&r1=438411&r2=438412&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ServiceImplementationConstructor.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ServiceImplementationConstructor.java Wed Aug 30 00:48:57 2006
@@ -26,11 +26,6 @@
 public interface ServiceImplementationConstructor extends Locatable
 {
     /**
-     * Returns the module which created the contribution. 
-     */
-    public String getContributingModuleId();
-
-    /**
      * Creates a new core service implementation.
      */
     public Object constructCoreServiceImplementation(ServicePoint servicePoint, Module contributingModule);

Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/util/Defense.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/util/Defense.java?rev=438412&r1=438411&r2=438412&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/util/Defense.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/util/Defense.java Wed Aug 30 00:48:57 2006
@@ -40,6 +40,18 @@
         if (parameter == null)
             throw new NullPointerException(HiveMindMessages.paramNotNull(parameterName));
     }
+    
+    /**
+     * Check for null field value when not allowed.
+     * 
+     * @throws NullPointerException
+     *             if field is null (the message indicates the name of the field).
+     */
+   public static void fieldNotNull(Object value, String fieldName)
+    {
+        if (value == null)
+            throw new NullPointerException(HiveMindMessages.fieldNotNull(fieldName));
+    }
 
     /**
      * Check that a parameter is not null, and assignable to a particular type.

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=438412&r1=438411&r2=438412&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 Wed Aug 30 00:48:57 2006
@@ -83,10 +83,10 @@
     /**
      * Convenience method for creating a {@link ServiceImplementationDefinition}.
      */
-    protected ServiceImplementationDefinition createServiceImplementationDefinition(Class serviceImplementationClass)
+    protected ServiceImplementationDefinition createServiceImplementationDefinition(ModuleDefinition module, Class serviceImplementationClass)
     {
-        ServiceImplementationDefinition result = new ServiceImplementationDefinition(newLocation(),
-                new CreateClassServiceConstructor(newLocation(), "module", serviceImplementationClass.getName()), 
+        ServiceImplementationDefinition result = new ServiceImplementationDefinition(module, newLocation(),
+                new CreateClassServiceConstructor(newLocation(), 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=438412&r1=438411&r2=438412&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 Wed Aug 30 00:48:57 2006
@@ -59,15 +59,11 @@
 
     public void testCreateClassServiceConstructorAccessors()
     {
-        String moduleId = "module";
-
         replayControls();
 
-        CreateClassServiceConstructor c = new CreateClassServiceConstructor(newLocation(), moduleId,
+        CreateClassServiceConstructor c = new CreateClassServiceConstructor(newLocation(), 
                 "java.util.HashMap");
 
-        assertSame(moduleId, c.getContributingModuleId());
-
         c.setInstanceClassName("java.util.HashMap");
 
         assertEquals("java.util.HashMap", c.getInstanceClassName());
@@ -77,15 +73,13 @@
 
     public void testCreateClassServiceConstructorTwice()
     {
-        String moduleId = "module";
-        
         ServicePoint sp = new ServicePointImpl();
         
         Module m = newModule();
 
         replayControls();
 
-        CreateClassServiceConstructor c = new CreateClassServiceConstructor(newLocation(), moduleId,
+        CreateClassServiceConstructor c = new CreateClassServiceConstructor(newLocation(), 
                 "java.util.HashMap");
 
         Object o1 = c.constructCoreServiceImplementation(sp, m);
@@ -101,13 +95,11 @@
 
     public void testCreateInstanceWithInitializer()
     {
-        String moduleId = "module";
-        
         Module m = newModule();
         
         ServicePoint sp = new ServicePointImpl();
         
-        CreateClassServiceConstructor c = new CreateClassServiceConstructor(newLocation(), moduleId,
+        CreateClassServiceConstructor c = new CreateClassServiceConstructor(newLocation(), 
                 SimpleBean.class.getName() + ",value=HiveMind");
 
         SimpleBean b = (SimpleBean) c.constructCoreServiceImplementation(sp, m);
@@ -117,13 +109,11 @@
 
     public void testCreateClassServiceConstructorFailure()
     {
-        String moduleId = "module";
-
         Module m = newModule();
         
         ServicePoint sp = new ServicePointImpl();
 
-        CreateClassServiceConstructor c = new CreateClassServiceConstructor(newLocation(), moduleId,
+        CreateClassServiceConstructor c = new CreateClassServiceConstructor(newLocation(), 
                 PrivateBean.class.getName());
 
         try

Modified: hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/TestServicesByInterface.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/TestServicesByInterface.java?rev=438412&r1=438411&r2=438412&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/TestServicesByInterface.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/TestServicesByInterface.java Wed Aug 30 00:48:57 2006
@@ -36,13 +36,13 @@
         ModuleDefinition module = createModuleDefinition("hivemind.tests.serviceByInterface");
 
         ServicePointDefinition sp1 = createServicePointDefinition("uniqueService", IUniqueService.class);
-        ServiceImplementationDefinition impl1 = createServiceImplementationDefinition(UniqueServiceImpl.class);
+        ServiceImplementationDefinition impl1 = createServiceImplementationDefinition(module, UniqueServiceImpl.class);
         sp1.addImplementation(impl1);
 
         module.addServicePoint(sp1);
 
         ServicePointDefinition sp2 = createServicePointDefinition("multipleServiceOne", IMultipleService.class);
-        ServiceImplementationDefinition impl2 = createServiceImplementationDefinition(MultipleServiceImpl.class);
+        ServiceImplementationDefinition impl2 = createServiceImplementationDefinition(module, MultipleServiceImpl.class);
         sp2.addImplementation(impl2);
 
         module.addServicePoint(sp2);

Modified: hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/StringHolderModule.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/StringHolderModule.java?rev=438412&r1=438411&r2=438412&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/StringHolderModule.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/StringHolderModule.java Wed Aug 30 00:48:57 2006
@@ -38,7 +38,7 @@
                 factory.setFactory((ClassFactory) contributingModule.getService(ClassFactory.class));
                 factory.createInterceptor(interceptorStack, contributingModule, Collections.emptyList());
             }};
-        ServiceInterceptorDefinition interceptor = new ServiceInterceptorDefinition(getLocation(), constructor);
+        ServiceInterceptorDefinition interceptor = new ServiceInterceptorDefinition(helper.getModule(), getLocation(), constructor);
         sp.addInterceptor(interceptor);
     }
 }

Modified: hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/TestServices.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/TestServices.java?rev=438412&r1=438411&r2=438412&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/TestServices.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/TestServices.java Wed Aug 30 00:48:57 2006
@@ -92,9 +92,9 @@
         ModuleDefinition module = new SimpleModule();
         ServicePointDefinition servicePoint = module.getServicePoint("Simple");
         
-        servicePoint.addInterceptor(new ServiceInterceptorDefinition(newLocation(), new TrackerServiceInterceptorConstructor("Fred", null, "Barney")));
-        servicePoint.addInterceptor(new ServiceInterceptorDefinition(newLocation(), new TrackerServiceInterceptorConstructor("Barney", null, null)));
-        servicePoint.addInterceptor(new ServiceInterceptorDefinition(newLocation(), new TrackerServiceInterceptorConstructor("Wilma", "Barney", null)));
+        servicePoint.addInterceptor(new ServiceInterceptorDefinition(module, newLocation(), new TrackerServiceInterceptorConstructor("Fred", null, "Barney")));
+        servicePoint.addInterceptor(new ServiceInterceptorDefinition(module, newLocation(), new TrackerServiceInterceptorConstructor("Barney", null, null)));
+        servicePoint.addInterceptor(new ServiceInterceptorDefinition(module, newLocation(), new TrackerServiceInterceptorConstructor("Wilma", "Barney", null)));
         
         Registry r =
             buildFrameworkRegistry(module);
@@ -211,7 +211,7 @@
                 factory.setFactory((ClassFactory) contributingModule.getService(ClassFactory.class));
                 factory.createInterceptor(interceptorStack, contributingModule, interceptedMethods);
             }};
-        ServiceInterceptorDefinition interceptor = new ServiceInterceptorDefinition(module.getLocation(), constructor);
+        ServiceInterceptorDefinition interceptor = new ServiceInterceptorDefinition(module, module.getLocation(), constructor);
         sp.addInterceptor(interceptor);
         return buildFrameworkRegistry(module);
     }
@@ -299,8 +299,7 @@
         ModuleDefinitionHelper helper = new ModuleDefinitionHelper(module);
         ServicePointDefinition sp = helper.addServicePoint("Recursive", SimpleService.class.getName());
 
-        ServiceImplementationConstructor constructor = new AbstractServiceImplementationConstructor(module.getLocation(),
-                module.getId())
+        ServiceImplementationConstructor constructor = new AbstractServiceImplementationConstructor(module.getLocation())
         {
             public Object constructCoreServiceImplementation(ServicePoint servicePoint,
                     Module contributingModule)

Modified: hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/TestShutdown.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/TestShutdown.java?rev=438412&r1=438411&r2=438412&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/TestShutdown.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/TestShutdown.java Wed Aug 30 00:48:57 2006
@@ -157,7 +157,7 @@
         
         ServicePointDefinition sp1 = createServicePointDefinition("Listener", Runnable.class);
         
-        ServiceImplementationConstructor constructor = new AbstractServiceImplementationConstructor(newLocation(), module.getId()) {
+        ServiceImplementationConstructor constructor = new AbstractServiceImplementationConstructor(newLocation()) {
 
             public Object constructCoreServiceImplementation(ServicePoint servicePoint, Module contributingModule)
             {
@@ -166,7 +166,7 @@
                 return result;
             }};
         
-        ServiceImplementationDefinition impl = new ServiceImplementationDefinition(newLocation(),
+        ServiceImplementationDefinition impl = new ServiceImplementationDefinition(module, newLocation(),
                 constructor, serviceModel, true);
         sp1.addImplementation(impl);
         module.addServicePoint(sp1);

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=438412&r1=438411&r2=438412&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 Wed Aug 30 00:48:57 2006
@@ -22,8 +22,10 @@
 import org.apache.hivemind.InterceptorStack;
 import org.apache.hivemind.Location;
 import org.apache.hivemind.Orderable;
+import org.apache.hivemind.definition.ServicePointDefinition;
 import org.apache.hivemind.internal.AbstractServiceInterceptorConstructor;
 import org.apache.hivemind.internal.Module;
+import org.apache.hivemind.internal.Visibility;
 
 /**
  * Test for interceptors.
@@ -47,10 +49,10 @@
     private ServicePointImpl newServicePoint(Location l, Module module)
     {
         ServicePointImpl sp = new ServicePointImpl();
+        ServicePointDefinition definition = new ServicePointDefinition("zip.zap", l, Visibility.PUBLIC, "foo.bar.Baz");
+        sp.setDefinition(definition);
         sp.setModule(module);
-        sp.setServiceInterfaceName("foo.bar.Baz");
         sp.setExtensionPointId("zip.zap");
-        sp.setLocation(l);
         return sp;
     }
    

Modified: hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestRegistryInfrastructure.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestRegistryInfrastructure.java?rev=438412&r1=438411&r2=438412&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestRegistryInfrastructure.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestRegistryInfrastructure.java Wed Aug 30 00:48:57 2006
@@ -14,6 +14,7 @@
 package org.apache.hivemind.impl;
 
 import org.apache.hivemind.ApplicationRuntimeException;
+import org.apache.hivemind.definition.ServicePointDefinition;
 import org.apache.hivemind.internal.ConfigurationPoint;
 import org.apache.hivemind.internal.RegistryInfrastructure;
 import org.apache.hivemind.internal.ServicePoint;
@@ -120,20 +121,20 @@
     private ServicePointImpl createServicePoint( final ModuleImpl module, String id, Class serviceInterface, Visibility visibility )
     {
         final ServicePointImpl servicePoint2 = new ServicePointImpl();
+        ServicePointDefinition definition = new ServicePointDefinition(id, newLocation(), visibility, serviceInterface.getName());
+        servicePoint2.setDefinition(definition);
         servicePoint2.setModule( module );
         servicePoint2.setExtensionPointId( id );
-        servicePoint2.setVisibility( visibility );
-        servicePoint2.setServiceInterfaceName( serviceInterface.getName() );
         return servicePoint2;
     }
 
     private ServicePointImpl createServicePoint( final ModuleImpl module, String id, String serviceInterfaceName, Visibility visibility )
     {
         final ServicePointImpl servicePoint2 = new ServicePointImpl();
+        ServicePointDefinition definition = new ServicePointDefinition(id, newLocation(), visibility, serviceInterfaceName);
+        servicePoint2.setDefinition(definition);
         servicePoint2.setModule( module );
         servicePoint2.setExtensionPointId( id );
-        servicePoint2.setVisibility( visibility );
-        servicePoint2.setServiceInterfaceName( serviceInterfaceName );
         return servicePoint2;
     }
 

Modified: hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestServicePoint.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestServicePoint.java?rev=438412&r1=438411&r2=438412&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestServicePoint.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/TestServicePoint.java Wed Aug 30 00:48:57 2006
@@ -14,6 +14,8 @@
 
 package org.apache.hivemind.impl;
 
+import hivemind.test.FrameworkTestCase;
+
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Locale;
@@ -21,9 +23,13 @@
 
 import org.apache.hivemind.ApplicationRuntimeException;
 import org.apache.hivemind.Location;
+import org.apache.hivemind.definition.ModuleDefinition;
+import org.apache.hivemind.definition.ServiceImplementationDefinition;
+import org.apache.hivemind.definition.ServicePointDefinition;
 import org.apache.hivemind.internal.Module;
 import org.apache.hivemind.internal.ServiceModel;
 import org.apache.hivemind.internal.ServiceModelFactory;
+import org.apache.hivemind.internal.Visibility;
 import org.apache.hivemind.test.HiveMindTestCase;
 import org.easymock.MockControl;
 
@@ -34,7 +40,7 @@
  * @author Howard M. Lewis Ship
  * @since 1.1
  */
-public class TestServicePoint extends HiveMindTestCase
+public class TestServicePoint extends FrameworkTestCase
 {
     private Module newModule()
     {
@@ -55,10 +61,10 @@
         replayControls();
 
         ServicePointImpl sp = new ServicePointImpl();
+        ServicePointDefinition definition = new ServicePointDefinition("zip.zap", l, Visibility.PUBLIC, "foo.bar.Baz");
+        sp.setDefinition(definition);
         sp.setModule(module);
-        sp.setServiceInterfaceName("foo.bar.Baz");
         sp.setExtensionPointId("zip.zap");
-        sp.setLocation(l);
 
         try
         {
@@ -106,10 +112,12 @@
         replayControls();
 
         sp.setExtensionPointId("foo.bar");
-        sp.setServiceInterfaceName("java.util.List");
-        sp.setLocation(l);
         sp.setModule(module);
-        sp.setServiceModel("fred");
+        
+        ModuleDefinition moduleDef = createModuleDefinition("foo");
+        ServicePointDefinition definition = new ServicePointDefinition("bar", l, Visibility.PUBLIC, "java.util.List");
+        definition.addImplementation(new ServiceImplementationDefinition(moduleDef, l, null, "fred", true));
+        sp.setDefinition(definition);
 
         try
         {

Modified: hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/servicemodel/TestRegistryShutdownListenerServices.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/servicemodel/TestRegistryShutdownListenerServices.java?rev=438412&r1=438411&r2=438412&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/servicemodel/TestRegistryShutdownListenerServices.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/impl/servicemodel/TestRegistryShutdownListenerServices.java Wed Aug 30 00:48:57 2006
@@ -102,8 +102,7 @@
         ServicePointDefinition sp1 = helper.addServicePoint("Simple", Simple.class.getName());
 
         // Define inline implementation constructor, that passes the ShutdownCoordinator service if manual is true 
-        ServiceImplementationConstructor constructor = new AbstractServiceImplementationConstructor(module.getLocation(),
-                module.getId())
+        ServiceImplementationConstructor constructor = new AbstractServiceImplementationConstructor(module.getLocation())
         {
             public Object constructCoreServiceImplementation(ServicePoint servicePoint,
                     Module contributingModule)

Modified: hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/service/impl/CglibBeanInterfaceFactory.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/service/impl/CglibBeanInterfaceFactory.java?rev=438412&r1=438411&r2=438412&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/service/impl/CglibBeanInterfaceFactory.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/service/impl/CglibBeanInterfaceFactory.java Wed Aug 30 00:48:57 2006
@@ -36,7 +36,7 @@
 
     public CglibBeanInterfaceFactory(Location location, String contributingModuleId)
     {
-        super(location, contributingModuleId);
+        super(location);
     }
 
     public Object constructCoreServiceImplementation(ServicePoint servicePoint, Module contributingModule)

Modified: hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/service/impl/JavassistBeanInterfaceFactory.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/service/impl/JavassistBeanInterfaceFactory.java?rev=438412&r1=438411&r2=438412&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/service/impl/JavassistBeanInterfaceFactory.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/service/impl/JavassistBeanInterfaceFactory.java Wed Aug 30 00:48:57 2006
@@ -34,7 +34,7 @@
 
     public JavassistBeanInterfaceFactory(Location location, String contributingModuleId)
     {
-        super(location, contributingModuleId);
+        super(location);
     }
 
     public Object constructCoreServiceImplementation(ServicePoint servicePoint, Module contributingModule)

Modified: hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/service/impl/JdkBeanInterfaceFactory.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/service/impl/JdkBeanInterfaceFactory.java?rev=438412&r1=438411&r2=438412&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/service/impl/JdkBeanInterfaceFactory.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/service/impl/JdkBeanInterfaceFactory.java Wed Aug 30 00:48:57 2006
@@ -33,7 +33,7 @@
 
     public JdkBeanInterfaceFactory(Location location, String contributingModuleId)
     {
-        super(location, contributingModuleId);
+        super(location);
     }
 
     public Object constructCoreServiceImplementation(ServicePoint servicePoint, Module contributingModule)

Modified: hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/service/impl/TestLoggingInterceptorFactory.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/service/impl/TestLoggingInterceptorFactory.java?rev=438412&r1=438411&r2=438412&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/service/impl/TestLoggingInterceptorFactory.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/test/org/apache/hivemind/service/impl/TestLoggingInterceptorFactory.java Wed Aug 30 00:48:57 2006
@@ -128,7 +128,7 @@
         definition.addModule(module);
         
         ServicePointDefinition sp1 = createServicePointDefinition("BeanInterface", BeanInterface.class);
-        ServiceImplementationDefinition impl = new ServiceImplementationDefinition(newLocation(),
+        ServiceImplementationDefinition impl = new ServiceImplementationDefinition(module, newLocation(),
                 constructor, ServiceModel.SINGLETON, true);
         sp1.addImplementation(impl);
         module.addServicePoint(sp1);

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=438412&r1=438411&r2=438412&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 Wed Aug 30 00:48:57 2006
@@ -27,7 +27,6 @@
 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;
 import org.apache.hivemind.schema.Schema;
 import org.apache.hivemind.util.Defense;
@@ -54,7 +53,7 @@
     
     public InvokeFactoryServiceConstructor(Location location, String contributingModuleId)
     {
-        super(location, contributingModuleId);
+        super(location);
     }
 
     public Object constructCoreServiceImplementation(ServicePoint servicePoint, Module contributingModule)

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=438412&r1=438411&r2=438412&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 Wed Aug 30 00:48:57 2006
@@ -193,7 +193,7 @@
 
         if (builder != null) {
             ServiceImplementationDefinition implementation = new ServiceImplementationDefinition(
-                    builder.getLocation(), builder.createConstructor(sourceModule.getId()),
+                    sourceModule, builder.getLocation(), builder.createConstructor(sourceModule.getId()),
                     builder.getServiceModel(), false);
             sourceModule.addServiceImplementation(qualifiedPointId, implementation); 
         }
@@ -223,7 +223,7 @@
 
         if (builder != null) {
             ServiceImplementationDefinition implementation = new ServiceImplementationDefinition(
-                    builder.getLocation(), builder.createConstructor(module.getId()),
+                    module, builder.getLocation(), builder.createConstructor(module.getId()),
                     builder.getServiceModel(), false);
             point.addImplementation(implementation);
         }
@@ -287,7 +287,7 @@
             String pointId = cd.getConfigurationId();
             String qualifiedId = IdUtils.qualify(moduleId, pointId);
             
-            ContributionDefinition contribution = new ContributionDefinition(cd.getLocation(),
+            ContributionDefinition contribution = new ContributionDefinition(module, cd.getLocation(),
                     new ContributionImpl(moduleId, cd.getElements())); 
             module.addContribution(qualifiedId, contribution);
 
@@ -307,7 +307,7 @@
         constructor.setPrecedingInterceptorIds(id.getAfter());
         constructor.setFollowingInterceptorIds(id.getBefore());
         ServiceInterceptorDefinition interceptor = new ServiceInterceptorDefinition(
-                id.getLocation(), constructor);
+                module, id.getLocation(), constructor);
         module.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=438412&r1=438411&r2=438412&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 Wed Aug 30 00:48:57 2006
@@ -44,7 +44,7 @@
         String contributingModuleId)
     {
         CreateClassServiceConstructor result = new CreateClassServiceConstructor(
-                getLocation(), contributingModuleId, _instanceClassName);
+                getLocation(), _instanceClassName);
 
         return result;
     }

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=438412&r1=438411&r2=438412&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 Wed Aug 30 00:48:57 2006
@@ -124,7 +124,6 @@
 
         c.setParameters(p);
 
-        assertSame(moduleId, c.getContributingModuleId());
         assertSame(p, c.getParameters());
     }
     



Mime
View raw message