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/10/04 08:25:31 UTC
svn commit: r452755 [1/2] - in /hivemind/branches/branch-2-0-annot: ./
framework/src/java/org/apache/hivemind/definition/
framework/src/java/org/apache/hivemind/definition/construction/
framework/src/java/org/apache/hivemind/impl/ framework/src/java/or...
Author: ahuegen
Date: Tue Oct 3 23:25:27 2006
New Revision: 452755
URL: http://svn.apache.org/viewvc?view=rev&rev=452755
Log:
Refactored constructor signatures
Introduces ConstructionContext interfaces
Added:
hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/
hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ConfigurationConstructionContext.java
hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ConfigurationConstructor.java
- copied, changed from r451788, hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ConfigurationConstructor.java
hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ConstructionContext.java
hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ContributionConstructionContext.java
hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ContributionConstructor.java (contents, props changed)
- copied, changed from r451788, hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/Contribution.java
hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ImplementationConstructionContext.java
hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ImplementationConstructor.java (contents, props changed)
- copied, changed from r451788, 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/definition/construction/InterceptorConstructor.java
- copied, changed from r451788, 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/internal/AbstractConstructionContext.java
hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ConfigurationConstructionContextImpl.java
hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ImplementationConstructionContextImpl.java
hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/XmlContributionImpl.java (contents, props changed)
- copied, changed from r451788, hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/ContributionImpl.java
hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/impl/ServiceModelThreading.xml (contents, props changed)
- copied, changed from r451788, hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/ServiceModelThreading.xml
Removed:
hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ElementsInnerProxyList.java
hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ElementsProxyList.java
hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ElementsProxyMap.java
hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ConfigurationConstructor.java
hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/Contribution.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/internal/ServiceInterceptorConstructor.java
hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/ContributionImpl.java
hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/ServiceModelThreading.xml
Modified:
hivemind/branches/branch-2-0-annot/.classpath
hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ConfigurationPointDefinition.java
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/ModuleDefinitionHelper.java
hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/OrderedServiceInterceptorDefinition.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/impl/ConfigurationPointImpl.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/CreateClassConfigurationConstructor.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/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/AbstractServiceInterceptorConstructor.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/services/StringHolderModule.java
hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/TestEagerLoader.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/hivemind/test/services/TestStartup.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/ant/RegistrySerializer.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/SchemaProcessorImpl.java
hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/ServiceImplementationFactoryParametersImpl.java
hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/XmlConfigurationConstructor.java
hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/XmlImplMessages.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/impl/XmlModuleReader.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/InstanceBuilder.java
hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/parse/InvokeFactoryDescriptor.java
hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/schema/SchemaProcessor.java
hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/impl/TestInvokeFactoryServiceConstructor.java
hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/service/TestBuilderFactory.java
hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/service/TestBuilderFactoryServiceModel.java
hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/service/TestEventLinker.java
Modified: hivemind/branches/branch-2-0-annot/.classpath
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/.classpath?view=diff&rev=452755&r1=452754&r2=452755
==============================================================================
--- hivemind/branches/branch-2-0-annot/.classpath (original)
+++ hivemind/branches/branch-2-0-annot/.classpath Tue Oct 3 23:25:27 2006
@@ -13,6 +13,8 @@
<classpathentry output="examples/target/eclipse-classes" kind="src" path="examples/src/java"/>
<classpathentry output="examples/target/eclipse-test-classes" kind="src" path="examples/src/test"/>
<classpathentry kind="src" path="hivebuild/src/java"/>
+ <classpathentry kind="src" path="annotations/src/test"/>
+ <classpathentry kind="src" path="annotations/src/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="var" path="ANT_HOME/lib/xercesImpl.jar"/>
<classpathentry kind="var" path="ANT_HOME/lib/xml-apis.jar"/>
Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ConfigurationPointDefinition.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ConfigurationPointDefinition.java?view=diff&rev=452755&r1=452754&r2=452755
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ConfigurationPointDefinition.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ConfigurationPointDefinition.java Tue Oct 3 23:25:27 2006
@@ -5,7 +5,7 @@
import org.apache.hivemind.Location;
import org.apache.hivemind.Occurances;
-import org.apache.hivemind.internal.ConfigurationConstructor;
+import org.apache.hivemind.definition.construction.ConfigurationConstructor;
import org.apache.hivemind.internal.Visibility;
public class ConfigurationPointDefinition extends ExtensionPointDefinition
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?view=diff&rev=452755&r1=452754&r2=452755
==============================================================================
--- 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 Tue Oct 3 23:25:27 2006
@@ -1,11 +1,11 @@
package org.apache.hivemind.definition;
import org.apache.hivemind.Location;
-import org.apache.hivemind.internal.Contribution;
+import org.apache.hivemind.definition.construction.ContributionConstructor;
public class ContributionDefinition extends ExtensionDefinition
{
- private Contribution _contributionConstructor;
+ private ContributionConstructor _contributionConstructor;
public ContributionDefinition(ModuleDefinition module)
{
@@ -13,18 +13,18 @@
}
public ContributionDefinition(ModuleDefinition module, Location location,
- Contribution contributionConstructor)
+ ContributionConstructor contributionConstructor)
{
super(module, location);
_contributionConstructor = contributionConstructor;
}
- public Contribution getContributionConstructor()
+ public ContributionConstructor getContributionConstructor()
{
return _contributionConstructor;
}
- public void setContributionConstructor(Contribution contributionConstructor)
+ public void setContributionConstructor(ContributionConstructor contributionConstructor)
{
_contributionConstructor = contributionConstructor;
}
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?view=diff&rev=452755&r1=452754&r2=452755
==============================================================================
--- 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 Tue Oct 3 23:25:27 2006
@@ -1,10 +1,10 @@
package org.apache.hivemind.definition;
import org.apache.hivemind.Occurances;
+import org.apache.hivemind.definition.construction.ConfigurationConstructor;
+import org.apache.hivemind.definition.construction.ContributionConstructor;
+import org.apache.hivemind.definition.construction.ImplementationConstructor;
import org.apache.hivemind.impl.CreateClassServiceConstructor;
-import org.apache.hivemind.internal.ConfigurationConstructor;
-import org.apache.hivemind.internal.Contribution;
-import org.apache.hivemind.internal.ServiceImplementationConstructor;
import org.apache.hivemind.internal.ServiceModel;
import org.apache.hivemind.internal.Visibility;
@@ -36,7 +36,7 @@
public ServiceImplementationDefinition addServiceImplementation(
ServicePointDefinition servicePoint,
- ServiceImplementationConstructor constructor, String serviceModel
+ ImplementationConstructor constructor, String serviceModel
)
{
ServiceImplementationDefinition result = new ServiceImplementationDefinition(_module, _module
@@ -65,7 +65,7 @@
}
public ContributionDefinition addContributionDefinition(ConfigurationPointDefinition configurationPoint,
- Contribution contributionConstructor)
+ ContributionConstructor contributionConstructor)
{
ContributionDefinition result = new ContributionDefinition(_module, _module.getLocation(), contributionConstructor);
configurationPoint.addContribution(result);
@@ -73,7 +73,7 @@
}
public ContributionDefinition addContributionDefinition(String fullyQualifiedConfigurationPointId,
- Contribution contributionConstructor)
+ ContributionConstructor contributionConstructor)
{
ContributionDefinition result = new ContributionDefinition(_module, _module.getLocation(), contributionConstructor);
_module.addContribution(fullyQualifiedConfigurationPointId, result);
Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/OrderedServiceInterceptorDefinition.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/OrderedServiceInterceptorDefinition.java?view=diff&rev=452755&r1=452754&r2=452755
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/OrderedServiceInterceptorDefinition.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/OrderedServiceInterceptorDefinition.java Tue Oct 3 23:25:27 2006
@@ -5,7 +5,7 @@
import org.apache.hivemind.Location;
import org.apache.hivemind.Orderable;
-import org.apache.hivemind.internal.ServiceInterceptorConstructor;
+import org.apache.hivemind.definition.construction.InterceptorConstructor;
/**
* Specialization of {@link ServiceInterceptorDefinition} that implements the {@link Orderable}
@@ -17,7 +17,7 @@
private String _precedingInterceptorIds;
private String _followingInterceptorIds;
- public OrderedServiceInterceptorDefinition(ModuleDefinition module, String name, Location location, ServiceInterceptorConstructor interceptorConstructor,
+ public OrderedServiceInterceptorDefinition(ModuleDefinition module, String name, Location location, InterceptorConstructor interceptorConstructor,
String precedingInterceptorIds, String followingInterceptorIds)
{
super(module, name, location, interceptorConstructor);
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?view=diff&rev=452755&r1=452754&r2=452755
==============================================================================
--- 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 Tue Oct 3 23:25:27 2006
@@ -1,12 +1,12 @@
package org.apache.hivemind.definition;
import org.apache.hivemind.Location;
-import org.apache.hivemind.internal.ServiceImplementationConstructor;
+import org.apache.hivemind.definition.construction.ImplementationConstructor;
public class ServiceImplementationDefinition extends ExtensionDefinition
{
private String _serviceModel;
- private ServiceImplementationConstructor _serviceConstructor;
+ private ImplementationConstructor _serviceConstructor;
private boolean _isDefault;
public ServiceImplementationDefinition(ModuleDefinition module)
@@ -14,7 +14,7 @@
super(module);
}
- public ServiceImplementationDefinition(ModuleDefinition module, Location location, ServiceImplementationConstructor serviceConstructor, String serviceModel, boolean isDefault)
+ public ServiceImplementationDefinition(ModuleDefinition module, Location location, ImplementationConstructor serviceConstructor, String serviceModel, boolean isDefault)
{
super(module, location);
_serviceConstructor = serviceConstructor;
@@ -42,12 +42,12 @@
_isDefault = isDefault;
}
- public ServiceImplementationConstructor getServiceConstructor()
+ public ImplementationConstructor getServiceConstructor()
{
return _serviceConstructor;
}
- public void setServiceConstructor(ServiceImplementationConstructor serviceConstructor)
+ public void setServiceConstructor(ImplementationConstructor serviceConstructor)
{
_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?view=diff&rev=452755&r1=452754&r2=452755
==============================================================================
--- 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 Tue Oct 3 23:25:27 2006
@@ -1,7 +1,7 @@
package org.apache.hivemind.definition;
import org.apache.hivemind.Location;
-import org.apache.hivemind.internal.ServiceInterceptorConstructor;
+import org.apache.hivemind.definition.construction.InterceptorConstructor;
/**
* Implementations of this interface may additionally implement the {@link org.apache.hivemind.Orderable}
@@ -9,7 +9,7 @@
*/
public class ServiceInterceptorDefinition extends ExtensionDefinition
{
- private ServiceInterceptorConstructor _interceptorConstructor;
+ private InterceptorConstructor _interceptorConstructor;
private String _name;
public ServiceInterceptorDefinition(ModuleDefinition module)
@@ -18,19 +18,19 @@
}
public ServiceInterceptorDefinition(ModuleDefinition module, String name, Location location,
- ServiceInterceptorConstructor interceptorConstructor)
+ InterceptorConstructor interceptorConstructor)
{
super(module, location);
_name = name;
_interceptorConstructor = interceptorConstructor;
}
- public ServiceInterceptorConstructor getInterceptorConstructor()
+ public InterceptorConstructor getInterceptorConstructor()
{
return _interceptorConstructor;
}
- public void setInterceptorConstructor(ServiceInterceptorConstructor serviceConstructor)
+ public void setInterceptorConstructor(InterceptorConstructor serviceConstructor)
{
_interceptorConstructor = serviceConstructor;
}
Added: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ConfigurationConstructionContext.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ConfigurationConstructionContext.java?view=auto&rev=452755
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ConfigurationConstructionContext.java (added)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ConfigurationConstructionContext.java Tue Oct 3 23:25:27 2006
@@ -0,0 +1,11 @@
+package org.apache.hivemind.definition.construction;
+
+import org.apache.hivemind.internal.ConfigurationPoint;
+
+public interface ConfigurationConstructionContext extends ConstructionContext
+{
+ /**
+ * @return the configuration point that is currently constructed
+ */
+ public ConfigurationPoint getConfigurationPoint();
+}
Copied: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ConfigurationConstructor.java (from r451788, hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ConfigurationConstructor.java)
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ConfigurationConstructor.java?view=diff&rev=452755&p1=hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ConfigurationConstructor.java&r1=451788&p2=hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ConfigurationConstructor.java&r2=452755
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ConfigurationConstructor.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ConfigurationConstructor.java Tue Oct 3 23:25:27 2006
@@ -12,13 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-package org.apache.hivemind.internal;
+package org.apache.hivemind.definition.construction;
import org.apache.hivemind.Locatable;
/**
- * A contribution to a configuration point that is used to
- * create the configuration container object.
+ * Creates the container object that holds the data of
+ * a {@link org.apache.hivemind.definition.ConfigurationPointDefinition}.
*
* @author Achim Huegen
*/
@@ -27,5 +27,5 @@
/**
* Creates a new configuration container.
*/
- public Object constructConfigurationContainer(Module module);
+ public Object constructConfigurationContainer(ConfigurationConstructionContext context);
}
Added: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ConstructionContext.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ConstructionContext.java?view=auto&rev=452755
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ConstructionContext.java (added)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ConstructionContext.java Tue Oct 3 23:25:27 2006
@@ -0,0 +1,35 @@
+package org.apache.hivemind.definition.construction;
+
+import org.apache.hivemind.definition.ExtensionDefinition;
+import org.apache.hivemind.definition.ExtensionPointDefinition;
+import org.apache.hivemind.internal.Module;
+
+/**
+ * Interface that provides access to information and services needed
+ * during the construction of an {@link ExtensionDefinition extension}
+ * or {@link ExtensionPointDefinition extension point}.
+ *
+ * @author Achim Huegen
+ */
+public interface ConstructionContext
+{
+ /**
+ * @return the module that defined the constructor that is constructed now.
+ */
+ public Module getDefiningModule();
+
+ /**
+ * @see Module#getService(String, Class)
+ */
+ public Object getService(String serviceId, Class serviceInterface);
+
+ /**
+ * @see Module#getService(String)
+ */
+ public Object getService(Class serviceInterface);
+
+ /**
+ * @see Module#getConfiguration(String, Class)
+ */
+ public Object getConfiguration(String configurationId);
+}
Added: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ContributionConstructionContext.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ContributionConstructionContext.java?view=auto&rev=452755
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ContributionConstructionContext.java (added)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ContributionConstructionContext.java Tue Oct 3 23:25:27 2006
@@ -0,0 +1,11 @@
+package org.apache.hivemind.definition.construction;
+
+import org.apache.hivemind.internal.ConfigurationPoint;
+
+public interface ContributionConstructionContext extends ConstructionContext
+{
+ /**
+ * @return the configuration point that is currently constructed
+ */
+ public ConfigurationPoint getConfigurationPoint();
+}
Copied: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ContributionConstructor.java (from r451788, hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/Contribution.java)
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ContributionConstructor.java?view=diff&rev=452755&p1=hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/Contribution.java&r1=451788&p2=hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ContributionConstructor.java&r2=452755
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/Contribution.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ContributionConstructor.java Tue Oct 3 23:25:27 2006
@@ -12,19 +12,19 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-package org.apache.hivemind.internal;
+package org.apache.hivemind.definition.construction;
/**
- * An Contribution is a contribution to an {@link org.apache.hivemind.internal.ConfigurationPoint}.
+ * Contributes data to a {@link org.apache.hivemind.definition.ConfigurationPointDefinition}.
*
- * @author Howard Lewis Ship
+ * @author Achim Huegen
*/
-public interface Contribution
+public interface ContributionConstructor
{
/**
* Contributes to the Configuration. A container is handed in to which new
* entries can be added.
*/
- public void contribute(ConfigurationPoint configurationPoint, Object container);
+ public void contribute(ContributionConstructionContext context, Object container);
}
Propchange: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ContributionConstructor.java
------------------------------------------------------------------------------
cvs2svn:cvs-rev = 1.5
Propchange: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ContributionConstructor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ContributionConstructor.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ImplementationConstructionContext.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ImplementationConstructionContext.java?view=auto&rev=452755
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ImplementationConstructionContext.java (added)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ImplementationConstructionContext.java Tue Oct 3 23:25:27 2006
@@ -0,0 +1,12 @@
+package org.apache.hivemind.definition.construction;
+
+import org.apache.hivemind.internal.ServicePoint;
+
+public interface ImplementationConstructionContext extends ConstructionContext
+{
+ /**
+ * @return the service point that is currently constructed
+ */
+ public ServicePoint getServicePoint();
+
+}
Copied: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ImplementationConstructor.java (from r451788, 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/definition/construction/ImplementationConstructor.java?view=diff&rev=452755&p1=hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ServiceImplementationConstructor.java&r1=451788&p2=hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ImplementationConstructor.java&r2=452755
==============================================================================
--- 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/definition/construction/ImplementationConstructor.java Tue Oct 3 23:25:27 2006
@@ -12,21 +12,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-package org.apache.hivemind.internal;
+package org.apache.hivemind.definition.construction;
import org.apache.hivemind.Locatable;
/**
- * A contribution to a service extension point that is used to
- * create the core service instance (which may then be enhanced
- * with interceptors).
+ * Creates the core service instance of a
+ * {@link org.apache.hivemind.definition.ServicePointDefinition service point}
*
- * @author Howard Lewis Ship
+ * @author Achim Huegen
*/
-public interface ServiceImplementationConstructor extends Locatable
+public interface ImplementationConstructor extends Locatable
{
/**
* Creates a new core service implementation.
*/
- public Object constructCoreServiceImplementation(ServicePoint servicePoint, Module contributingModule);
+ public Object constructCoreServiceImplementation(ImplementationConstructionContext context);
}
Propchange: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ImplementationConstructor.java
------------------------------------------------------------------------------
cvs2svn:cvs-rev = 1.3
Propchange: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ImplementationConstructor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/ImplementationConstructor.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Copied: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/InterceptorConstructor.java (from r451788, 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/definition/construction/InterceptorConstructor.java?view=diff&rev=452755&p1=hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ServiceInterceptorConstructor.java&r1=451788&p2=hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/construction/InterceptorConstructor.java&r2=452755
==============================================================================
--- 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/definition/construction/InterceptorConstructor.java Tue Oct 3 23:25:27 2006
@@ -12,15 +12,19 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-package org.apache.hivemind.internal;
+package org.apache.hivemind.definition.construction;
import org.apache.hivemind.InterceptorStack;
import org.apache.hivemind.Locatable;
+import org.apache.hivemind.internal.Module;
/**
- * Creates an service interceptor
+ * Creates an service interceptor for a
+ * {@link org.apache.hivemind.definition.ServicePointDefinition service point}
+ *
+ * @author Achim Huegen
*/
-public interface ServiceInterceptorConstructor extends Locatable
+public interface InterceptorConstructor extends Locatable
{
/**
* Creates a new core service implementation.
Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ConfigurationPointImpl.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ConfigurationPointImpl.java?view=diff&rev=452755&r1=452754&r2=452755
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ConfigurationPointImpl.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ConfigurationPointImpl.java Tue Oct 3 23:25:27 2006
@@ -26,10 +26,13 @@
import org.apache.hivemind.ShutdownCoordinator;
import org.apache.hivemind.definition.ConfigurationPointDefinition;
import org.apache.hivemind.definition.ContributionDefinition;
+import org.apache.hivemind.definition.construction.ConfigurationConstructionContext;
+import org.apache.hivemind.definition.construction.ConfigurationConstructor;
+import org.apache.hivemind.definition.construction.ContributionConstructionContext;
+import org.apache.hivemind.definition.construction.ContributionConstructor;
import org.apache.hivemind.impl.servicemodel.SingletonInnerProxy;
-import org.apache.hivemind.internal.ConfigurationConstructor;
+import org.apache.hivemind.internal.ConfigurationConstructionContextImpl;
import org.apache.hivemind.internal.ConfigurationPoint;
-import org.apache.hivemind.internal.Contribution;
import org.apache.hivemind.internal.Module;
import org.apache.hivemind.service.BodyBuilder;
import org.apache.hivemind.service.ClassFab;
@@ -39,7 +42,7 @@
/**
* Implementation of the {@link org.apache.hivemind.internal.ConfigurationPoint} interface; a
- * container for {@link org.apache.hivemind.internal.Contribution}s.
+ * container for {@link org.apache.hivemind.definition.construction.ContributionConstructor}s.
*
* @author Howard Lewis Ship
*/
@@ -86,7 +89,7 @@
/**
* Returns the number of contributions; it is expected that each top-level
- * {@link org.apache.hivemind.Element} in each {@link Contribution} will convert to one element
+ * {@link org.apache.hivemind.Element} in each {@link ContributionConstructor} will convert to one element
* instance; the value returned is the total number of top-level elements in all contributed
* Extensions.
*/
@@ -193,7 +196,9 @@
for (int i = 0; i < count; i++)
{
ContributionDefinition cd = (ContributionDefinition) _contributions.get(i);
- cd.getContributionConstructor().contribute(this, _container);
+ Module definingModule = getModule().getModule(cd.getModuleId());
+ ContributionConstructionContext context = new ConfigurationConstructionContextImpl(definingModule, this);
+ cd.getContributionConstructor().contribute(context, _container);
}
}
catch (Exception ex)
@@ -218,7 +223,8 @@
private Object createContainerInstance()
{
- Object container = getConfigurationConstructor().constructConfigurationContainer(getModule());
+ ConfigurationConstructionContext context = new ConfigurationConstructionContextImpl(getModule(), this);
+ Object container = getConfigurationConstructor().constructConfigurationContainer(context);
if (container == null)
// TODO annotations: i18n message
throw new ApplicationRuntimeException("configuration container is null");
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?view=diff&rev=452755&r1=452754&r2=452755
==============================================================================
--- 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 Oct 3 23:25:27 2006
@@ -17,8 +17,8 @@
import java.util.List;
import org.apache.hivemind.definition.ServiceImplementationDefinition;
+import org.apache.hivemind.definition.construction.ImplementationConstructor;
import org.apache.hivemind.events.RegistryShutdownListener;
-import org.apache.hivemind.internal.ServiceImplementationConstructor;
import org.apache.hivemind.internal.ServicePoint;
/**
@@ -36,12 +36,12 @@
* comes from the <service-point> itself; other modules can override this default using an
* <implementation> element.
*/
- ServiceImplementationConstructor getServiceConstructor();
+ ImplementationConstructor getServiceConstructor();
ServiceImplementationDefinition getImplementationDefinition();
/**
- * Returns a list of {@link org.apache.hivemind.internal.ServiceInterceptorConstructor}s,
+ * Returns a list of {@link org.apache.hivemind.definition.construction.InterceptorConstructor}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
@@ -56,7 +56,7 @@
*
* The <code>before</code> value for the first interceptor contribution will be assigned to
* the contribution's
- * {@link org.apache.hivemind.internal.ServiceInterceptorConstructor#getFollowingNames() followingNames}
+ * {@link org.apache.hivemind.definition.construction.InterceptorConstructor#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?view=diff&rev=452755&r1=452754&r2=452755
==============================================================================
--- 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 Oct 3 23:25:27 2006
@@ -16,17 +16,16 @@
import org.apache.hivemind.definition.ModuleDefinitionHelper;
import org.apache.hivemind.definition.RegistryDefinition;
import org.apache.hivemind.definition.ServicePointDefinition;
+import org.apache.hivemind.definition.construction.ContributionConstructionContext;
+import org.apache.hivemind.definition.construction.ContributionConstructor;
+import org.apache.hivemind.definition.construction.ImplementationConstructionContext;
+import org.apache.hivemind.definition.construction.ImplementationConstructor;
import org.apache.hivemind.impl.servicemodel.PooledServiceModelFactory;
import org.apache.hivemind.impl.servicemodel.PrimitiveServiceModelFactory;
import org.apache.hivemind.impl.servicemodel.SingletonServiceModelFactory;
import org.apache.hivemind.impl.servicemodel.ThreadedServiceModelFactory;
import org.apache.hivemind.internal.AbstractServiceImplementationConstructor;
-import org.apache.hivemind.internal.ConfigurationPoint;
-import org.apache.hivemind.internal.Contribution;
-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.service.ClassFactory;
import org.apache.hivemind.service.InterfaceSynthesizer;
import org.apache.hivemind.service.ThreadEventNotifier;
@@ -105,20 +104,20 @@
new CreateClassConfigurationConstructor(md.getLocation(), ArrayList.class.getName()), List.class
.getName());
- helper.addContributionDefinition(cpd, new Contribution()
+ helper.addContributionDefinition(cpd, new ContributionConstructor()
{
- public void contribute(ConfigurationPoint configurationPoint, Object container)
+ public void contribute(ContributionConstructionContext context, Object container)
{
// Add the default symbol sources FactoryDefaults and
// ApplicationDefaults
- SymbolSource factoryDefaults = (SymbolSource) configurationPoint.getModule().getService(
+ SymbolSource factoryDefaults = (SymbolSource) context.getService(
"FactoryDefaultsSymbolSource", SymbolSource.class);
SymbolSourceContribution factoryDefaultsContrib = new SymbolSourceContribution(factoryDefaults,
"hivemind.FactoryDefaults", null, null);
((List) container).add(factoryDefaultsContrib);
- SymbolSource applicationDefaults = (SymbolSource) configurationPoint.getModule().getService(
+ SymbolSource applicationDefaults = (SymbolSource) context.getService(
"ApplicationDefaultsSymbolSource", SymbolSource.class);
SymbolSourceContribution applicationDefaultsContrib = new SymbolSourceContribution(applicationDefaults,
"hivemind.ApplicationDefaults", null, "hivemind.FactoryDefaults");
@@ -136,13 +135,12 @@
ServicePointDefinition spd = helper.addServicePoint(servicePointId, SymbolSource.class.getName());
// Define inline implementation constructor, that wires the corresponding configuration
- ServiceImplementationConstructor constructor = new AbstractServiceImplementationConstructor(md.getLocation())
+ ImplementationConstructor constructor = new AbstractServiceImplementationConstructor(md.getLocation())
{
- public Object constructCoreServiceImplementation(ServicePoint servicePoint,
- Module contributingModule)
+ public Object constructCoreServiceImplementation(ImplementationConstructionContext context)
{
DefaultsSymbolSource result = new DefaultsSymbolSource();
- result.setDefaults((List) contributingModule.getConfiguration(configurationId));
+ result.setDefaults((List) context.getConfiguration(configurationId));
result.initializeService();
return result;
}
@@ -203,14 +201,13 @@
ServicePointDefinition spd = helper.addServicePoint("ThreadLocale", ThreadLocale.class.getName());
// Define inline implementation constructor
- ServiceImplementationConstructor constructor = new AbstractServiceImplementationConstructor(md.getLocation())
+ ImplementationConstructor constructor = new AbstractServiceImplementationConstructor(md.getLocation())
{
- public Object constructCoreServiceImplementation(ServicePoint servicePoint,
- Module contributingModule)
+ public Object constructCoreServiceImplementation(ImplementationConstructionContext context)
{
// Get the Locale from the registry
- Locale defaultLocale = contributingModule.getLocale();
+ Locale defaultLocale = context.getDefiningModule().getLocale();
return new ThreadLocaleImpl(defaultLocale);
}
@@ -236,13 +233,12 @@
ServicePointDefinition spd = helper.addServicePoint("EagerLoad", Runnable.class.getName());
// Define inline implementation constructor, that wires the EagerLoad configuration
- ServiceImplementationConstructor constructor = new AbstractServiceImplementationConstructor(md.getLocation())
+ ImplementationConstructor constructor = new AbstractServiceImplementationConstructor(md.getLocation())
{
- public Object constructCoreServiceImplementation(ServicePoint servicePoint,
- Module contributingModule)
+ public Object constructCoreServiceImplementation(ImplementationConstructionContext context)
{
EagerLoader result = new EagerLoader();
- result.setServicePoints((List) contributingModule.getConfiguration("EagerLoad"));
+ result.setServicePoints((List) context.getConfiguration("EagerLoad"));
return result;
}
};
@@ -266,13 +262,12 @@
ServicePointDefinition spd = helper.addServicePoint("Startup", Runnable.class.getName());
// Define inline implementation constructor, that wires the Startup configuration
- ServiceImplementationConstructor constructor = new AbstractServiceImplementationConstructor(md.getLocation())
+ ImplementationConstructor constructor = new AbstractServiceImplementationConstructor(md.getLocation())
{
- public Object constructCoreServiceImplementation(ServicePoint servicePoint,
- Module contributingModule)
+ public Object constructCoreServiceImplementation(ImplementationConstructionContext context)
{
StartupImpl result = new StartupImpl();
- result.setRunnables((List) contributingModule.getConfiguration("Startup"));
+ result.setRunnables((List) context.getConfiguration("Startup"));
return result;
}
};
@@ -286,14 +281,14 @@
List.class.getName());
final List services = getDefaultStartupServices();
- helper.addContributionDefinition(cpd, new Contribution() {
+ helper.addContributionDefinition(cpd, new ContributionConstructor() {
- public void contribute(ConfigurationPoint configurationPoint, Object container)
+ public void contribute(ContributionConstructionContext context, Object container)
{
for (Iterator iterServices = services.iterator(); iterServices.hasNext();)
{
String serviceName = (String) iterServices.next();
- ((List) container).add(configurationPoint.getModule().getService(serviceName, Runnable.class));
+ ((List) container).add(context.getService(serviceName, Runnable.class));
}
}});
}
@@ -309,9 +304,9 @@
List.class.getName());
final List serviceModels = getDefaultServiceModels();
- helper.addContributionDefinition(cpd, new Contribution() {
+ helper.addContributionDefinition(cpd, new ContributionConstructor() {
- public void contribute(ConfigurationPoint configurationPoint, Object container)
+ public void contribute(ContributionConstructionContext context, Object container)
{
((List) container).addAll(serviceModels);
}});
@@ -348,14 +343,13 @@
ServicePointDefinition spd = helper.addServicePoint("InterfaceSynthesizer", InterfaceSynthesizer.class.getName());
// Define inline implementation constructor
- ServiceImplementationConstructor constructor = new AbstractServiceImplementationConstructor(md.getLocation())
+ ImplementationConstructor constructor = new AbstractServiceImplementationConstructor(md.getLocation())
{
- public Object constructCoreServiceImplementation(ServicePoint servicePoint,
- Module contributingModule)
+ public Object constructCoreServiceImplementation(ImplementationConstructionContext context)
{
InterfaceSynthesizerImpl result = new InterfaceSynthesizerImpl();
// Manual wiring of the class factory
- result.setClassFactory((ClassFactory) contributingModule.getService(ClassFactory.class));
+ result.setClassFactory((ClassFactory) context.getService(ClassFactory.class));
return result;
}
};
Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/CreateClassConfigurationConstructor.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/CreateClassConfigurationConstructor.java?view=diff&rev=452755&r1=452754&r2=452755
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/CreateClassConfigurationConstructor.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/CreateClassConfigurationConstructor.java Tue Oct 3 23:25:27 2006
@@ -15,8 +15,8 @@
package org.apache.hivemind.impl;
import org.apache.hivemind.Location;
-import org.apache.hivemind.internal.ConfigurationConstructor;
-import org.apache.hivemind.internal.Module;
+import org.apache.hivemind.definition.construction.ConfigurationConstructionContext;
+import org.apache.hivemind.definition.construction.ConfigurationConstructor;
import org.apache.hivemind.util.InstanceCreationUtils;
/**
@@ -44,10 +44,10 @@
_containerClassName = string;
}
- public Object constructConfigurationContainer(Module contributingModule)
+ public Object constructConfigurationContainer(ConfigurationConstructionContext context)
{
return InstanceCreationUtils.createInstance(
- contributingModule,
+ context.getDefiningModule(),
_containerClassName,
getLocation());
}
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?view=diff&rev=452755&r1=452754&r2=452755
==============================================================================
--- 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 Oct 3 23:25:27 2006
@@ -15,9 +15,8 @@
package org.apache.hivemind.impl;
import org.apache.hivemind.Location;
+import org.apache.hivemind.definition.construction.ImplementationConstructionContext;
import org.apache.hivemind.internal.AbstractServiceImplementationConstructor;
-import org.apache.hivemind.internal.Module;
-import org.apache.hivemind.internal.ServicePoint;
import org.apache.hivemind.util.InstanceCreationUtils;
/**
@@ -35,10 +34,10 @@
_instanceClassName = instanceClassName;
}
- public Object constructCoreServiceImplementation(ServicePoint servicePoint, Module contributingModule)
+ public Object constructCoreServiceImplementation(ImplementationConstructionContext context)
{
return InstanceCreationUtils.createInstance(
- contributingModule,
+ context.getDefiningModule(),
_instanceClassName,
getLocation());
}
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?view=diff&rev=452755&r1=452754&r2=452755
==============================================================================
--- 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 Tue Oct 3 23:25:27 2006
@@ -24,7 +24,6 @@
import org.apache.hivemind.definition.ServiceInterceptorDefinition;
import org.apache.hivemind.events.RegistryShutdownListener;
import org.apache.hivemind.internal.ConfigurationPoint;
-import org.apache.hivemind.internal.ExtensionPoint;
import org.apache.hivemind.internal.Module;
import org.apache.hivemind.internal.ServicePoint;
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?view=diff&rev=452755&r1=452754&r2=452755
==============================================================================
--- 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 Oct 3 23:25:27 2006
@@ -26,9 +26,9 @@
import org.apache.hivemind.definition.ServiceImplementationDefinition;
import org.apache.hivemind.definition.ServiceInterceptorDefinition;
import org.apache.hivemind.definition.ServicePointDefinition;
+import org.apache.hivemind.definition.construction.ImplementationConstructor;
import org.apache.hivemind.events.RegistryShutdownListener;
import org.apache.hivemind.internal.Module;
-import org.apache.hivemind.internal.ServiceImplementationConstructor;
import org.apache.hivemind.internal.ServiceModel;
import org.apache.hivemind.internal.ServiceModelFactory;
import org.apache.hivemind.order.Orderer;
@@ -293,7 +293,7 @@
* Returns the service constructor.
*/
- public ServiceImplementationConstructor getServiceConstructor()
+ public ImplementationConstructor getServiceConstructor()
{
// TODO: For toString tests. Remove?
if (getServicePointDefinition() == null)
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?view=diff&rev=452755&r1=452754&r2=452755
==============================================================================
--- 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 Tue Oct 3 23:25:27 2006
@@ -23,12 +23,14 @@
import org.apache.hivemind.ShutdownCoordinator;
import org.apache.hivemind.definition.ServiceImplementationDefinition;
import org.apache.hivemind.definition.ServiceInterceptorDefinition;
+import org.apache.hivemind.definition.construction.ImplementationConstructionContext;
+import org.apache.hivemind.definition.construction.ImplementationConstructor;
import org.apache.hivemind.events.RegistryShutdownListener;
import org.apache.hivemind.impl.ConstructableServicePoint;
import org.apache.hivemind.impl.InterceptorStackImpl;
import org.apache.hivemind.impl.ProxyBuilder;
+import org.apache.hivemind.internal.ImplementationConstructionContextImpl;
import org.apache.hivemind.internal.Module;
-import org.apache.hivemind.internal.ServiceImplementationConstructor;
import org.apache.hivemind.internal.ServiceModel;
import org.apache.hivemind.service.ClassFab;
import org.apache.hivemind.util.ConstructorUtils;
@@ -94,7 +96,7 @@
/**
* Constructs the core service implementation (by invoking the
- * {@link ServiceImplementationConstructor}), and checks that the result is non-null and
+ * {@link ImplementationConstructor}), and checks that the result is non-null and
* assignable to the service interface.
*/
protected Object constructCoreServiceImplementation()
@@ -107,12 +109,14 @@
Class declaredInterface = _servicePoint.getDeclaredInterface();
ServiceImplementationDefinition implementationDefinition = _servicePoint.getImplementationDefinition();
- ServiceImplementationConstructor constructor = implementationDefinition.getServiceConstructor();
+ ImplementationConstructor constructor = implementationDefinition.getServiceConstructor();
// Get a reference to the module that provided the implementation
- String contributingModuleId = implementationDefinition.getModuleId();
+ String definingModuleId = implementationDefinition.getModuleId();
// Is there a more elegant way to retrieve a module?
- Module contributingModule = _servicePoint.getModule().getModule(contributingModuleId);
- Object result = constructor.constructCoreServiceImplementation(_servicePoint, contributingModule);
+ Module definingModule = _servicePoint.getModule().getModule(definingModuleId);
+ ImplementationConstructionContext context = new ImplementationConstructionContextImpl(definingModule,
+ _servicePoint);
+ Object result = constructor.constructCoreServiceImplementation(context);
if (result == null)
throw new ApplicationRuntimeException(ServiceModelMessages
Added: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/AbstractConstructionContext.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/AbstractConstructionContext.java?view=auto&rev=452755
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/AbstractConstructionContext.java (added)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/AbstractConstructionContext.java Tue Oct 3 23:25:27 2006
@@ -0,0 +1,48 @@
+package org.apache.hivemind.internal;
+
+import org.apache.hivemind.definition.construction.ConstructionContext;
+
+/**
+ * Default Implementation of {@link ConstructionContext}.
+ *
+ * @author Achim Huegen
+ */
+public abstract class AbstractConstructionContext implements ConstructionContext
+{
+ private Module _definingModule;
+
+ public AbstractConstructionContext(Module definingModule)
+ {
+ _definingModule = definingModule;
+ }
+
+ public Object getConfiguration(String configurationId)
+ {
+ return _definingModule.getConfiguration(configurationId);
+ }
+
+ /**
+ * @see org.apache.hivemind.definition.construction.ConstructionContext#getDefiningModule()
+ */
+ public Module getDefiningModule()
+ {
+ return _definingModule;
+ }
+
+ /**
+ * @see org.apache.hivemind.definition.construction.ConstructionContext#getService(java.lang.String, java.lang.Class)
+ */
+ public Object getService(String serviceId, Class serviceInterface)
+ {
+ return _definingModule.getService(serviceId, serviceInterface);
+ }
+
+ /**
+ * @see org.apache.hivemind.definition.construction.ConstructionContext#getService(java.lang.Class)
+ */
+ public Object getService(Class serviceInterface)
+ {
+ return _definingModule.getService(serviceInterface);
+ }
+
+}
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?view=diff&rev=452755&r1=452754&r2=452755
==============================================================================
--- 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 Tue Oct 3 23:25:27 2006
@@ -1,22 +1,20 @@
package org.apache.hivemind.internal;
import org.apache.hivemind.Location;
+import org.apache.hivemind.definition.construction.ImplementationConstructor;
import org.apache.hivemind.impl.BaseLocatable;
/**
- * Ancestor for implementations of {@link ServiceImplementationConstructor}.
+ * Ancestor for implementations of {@link ImplementationConstructor}.
*
* @author Achim Huegen
*/
-public abstract class AbstractServiceImplementationConstructor extends BaseLocatable implements ServiceImplementationConstructor
+public abstract class AbstractServiceImplementationConstructor extends BaseLocatable implements ImplementationConstructor
{
public AbstractServiceImplementationConstructor(Location location)
{
super(location);
}
-
- public abstract Object constructCoreServiceImplementation(ServicePoint servicePoint,
- Module contributingModule);
}
Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/AbstractServiceInterceptorConstructor.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/AbstractServiceInterceptorConstructor.java?view=diff&rev=452755&r1=452754&r2=452755
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/AbstractServiceInterceptorConstructor.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/AbstractServiceInterceptorConstructor.java Tue Oct 3 23:25:27 2006
@@ -2,14 +2,15 @@
import org.apache.hivemind.InterceptorStack;
import org.apache.hivemind.Location;
+import org.apache.hivemind.definition.construction.InterceptorConstructor;
import org.apache.hivemind.impl.BaseLocatable;
/**
- * Ancestor for implementions of {@link ServiceInterceptorConstructor}.
+ * Ancestor for implementions of {@link InterceptorConstructor}.
*
* @author Achim Huegen
*/
-public abstract class AbstractServiceInterceptorConstructor extends BaseLocatable implements ServiceInterceptorConstructor
+public abstract class AbstractServiceInterceptorConstructor extends BaseLocatable implements InterceptorConstructor
{
public AbstractServiceInterceptorConstructor(Location location)
Added: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ConfigurationConstructionContextImpl.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ConfigurationConstructionContextImpl.java?view=auto&rev=452755
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ConfigurationConstructionContextImpl.java (added)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ConfigurationConstructionContextImpl.java Tue Oct 3 23:25:27 2006
@@ -0,0 +1,26 @@
+package org.apache.hivemind.internal;
+
+import org.apache.hivemind.definition.construction.ConfigurationConstructionContext;
+import org.apache.hivemind.definition.construction.ContributionConstructionContext;
+
+/**
+ * Implementation of {@link ConfigurationConstructionContext}.
+ *
+ * @author Achim Huegen
+ */
+public class ConfigurationConstructionContextImpl extends AbstractConstructionContext implements
+ ConfigurationConstructionContext, ContributionConstructionContext
+{
+ private ConfigurationPoint _configurationPoint;
+
+ public ConfigurationConstructionContextImpl(Module definingModule, ConfigurationPoint configurationPoint)
+ {
+ super(definingModule);
+ _configurationPoint = configurationPoint;
+ }
+
+ public ConfigurationPoint getConfigurationPoint()
+ {
+ return _configurationPoint;
+ }
+}
Added: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ImplementationConstructionContextImpl.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ImplementationConstructionContextImpl.java?view=auto&rev=452755
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ImplementationConstructionContextImpl.java (added)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ImplementationConstructionContextImpl.java Tue Oct 3 23:25:27 2006
@@ -0,0 +1,25 @@
+package org.apache.hivemind.internal;
+
+import org.apache.hivemind.definition.construction.ImplementationConstructionContext;
+
+/**
+ * Implementation of {@link ImplementationConstructionContext}.
+ *
+ * @author Achim Huegen
+ */
+public class ImplementationConstructionContextImpl extends AbstractConstructionContext implements
+ ImplementationConstructionContext
+{
+ private ServicePoint _servicePoint;
+
+ public ImplementationConstructionContextImpl(Module definingModule, ServicePoint servicePoint)
+ {
+ super(definingModule);
+ _servicePoint = servicePoint;
+ }
+
+ public ServicePoint getServicePoint()
+ {
+ return _servicePoint;
+ }
+}
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?view=diff&rev=452755&r1=452754&r2=452755
==============================================================================
--- 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 Oct 3 23:25:27 2006
@@ -18,10 +18,12 @@
import org.apache.hivemind.ApplicationRuntimeException;
import org.apache.hivemind.SymbolSource;
+import org.apache.hivemind.definition.construction.ImplementationConstructionContext;
import org.apache.hivemind.impl.CreateClassServiceConstructor;
import org.apache.hivemind.impl.ModuleImpl;
import org.apache.hivemind.impl.ServicePointImpl;
import org.apache.hivemind.impl.SystemPropertiesSymbolSource;
+import org.apache.hivemind.internal.ImplementationConstructionContextImpl;
import org.apache.hivemind.internal.Module;
import org.apache.hivemind.internal.ServicePoint;
@@ -82,8 +84,9 @@
CreateClassServiceConstructor c = new CreateClassServiceConstructor(newLocation(),
"java.util.HashMap");
- Object o1 = c.constructCoreServiceImplementation(sp, m);
- Object o2 = c.constructCoreServiceImplementation(sp, m);
+ ImplementationConstructionContext context = new ImplementationConstructionContextImpl(m, sp);
+ Object o1 = c.constructCoreServiceImplementation(context);
+ Object o2 = c.constructCoreServiceImplementation(context);
assertNotSame(o1, o2);
@@ -102,7 +105,8 @@
CreateClassServiceConstructor c = new CreateClassServiceConstructor(newLocation(),
SimpleBean.class.getName() + ",value=HiveMind");
- SimpleBean b = (SimpleBean) c.constructCoreServiceImplementation(sp, m);
+ ImplementationConstructionContext context = new ImplementationConstructionContextImpl(m, sp);
+ SimpleBean b = (SimpleBean) c.constructCoreServiceImplementation(context);
assertEquals("HiveMind", b.getValue());
}
@@ -118,7 +122,8 @@
try
{
- c.constructCoreServiceImplementation(sp, m);
+ ImplementationConstructionContext context = new ImplementationConstructionContextImpl(m, sp);
+ c.constructCoreServiceImplementation(context);
unreachable();
}
catch (Exception ex)
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?view=diff&rev=452755&r1=452754&r2=452755
==============================================================================
--- 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 Tue Oct 3 23:25:27 2006
@@ -9,10 +9,10 @@
import org.apache.hivemind.definition.ModuleDefinitionHelper;
import org.apache.hivemind.definition.ServiceInterceptorDefinition;
import org.apache.hivemind.definition.ServicePointDefinition;
+import org.apache.hivemind.definition.construction.InterceptorConstructor;
import org.apache.hivemind.impl.DefaultClassResolver;
import org.apache.hivemind.internal.AbstractServiceInterceptorConstructor;
import org.apache.hivemind.internal.Module;
-import org.apache.hivemind.internal.ServiceInterceptorConstructor;
import org.apache.hivemind.service.ClassFactory;
import org.apache.hivemind.service.impl.LoggingInterceptorFactory;
@@ -29,7 +29,7 @@
ServicePointDefinition sp = helper.addServicePoint("StringHolder", StringHolder.class.getName());
helper.addSimpleServiceImplementation(sp, StringHolderImpl.class.getName(), serviceModel);
- ServiceInterceptorConstructor constructor = new AbstractServiceInterceptorConstructor(getLocation()) {
+ InterceptorConstructor constructor = new AbstractServiceInterceptorConstructor(getLocation()) {
public void constructServiceInterceptor(InterceptorStack interceptorStack, Module contributingModule)
{
Modified: hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/TestEagerLoader.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/TestEagerLoader.java?view=diff&rev=452755&r1=452754&r2=452755
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/TestEagerLoader.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/TestEagerLoader.java Tue Oct 3 23:25:27 2006
@@ -24,8 +24,8 @@
import org.apache.hivemind.definition.ModuleDefinition;
import org.apache.hivemind.definition.ModuleDefinitionHelper;
import org.apache.hivemind.definition.ServicePointDefinition;
-import org.apache.hivemind.internal.ConfigurationPoint;
-import org.apache.hivemind.internal.Contribution;
+import org.apache.hivemind.definition.construction.ContributionConstructionContext;
+import org.apache.hivemind.definition.construction.ContributionConstructor;
import org.apache.hivemind.internal.ServiceModel;
import org.apache.hivemind.internal.ServicePoint;
import org.apache.hivemind.service.impl.EagerLoader;
@@ -106,11 +106,11 @@
helper.addSimpleServiceImplementation(sp1, LoudRunner.class.getName(), serviceModel);
// Add service point "Loud" to EagerLoad configuration point
- helper.addContributionDefinition("hivemind.EagerLoad", new Contribution()
+ helper.addContributionDefinition("hivemind.EagerLoad", new ContributionConstructor()
{
- public void contribute(ConfigurationPoint configurationPoint, Object container)
+ public void contribute(ContributionConstructionContext context, Object container)
{
- ((List) container).add(configurationPoint.getModule().getServicePoint("hivemind.test.services.Loud"));
+ ((List) container).add(context.getDefiningModule().getServicePoint("hivemind.test.services.Loud"));
}
});
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?view=diff&rev=452755&r1=452754&r2=452755
==============================================================================
--- 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 Tue Oct 3 23:25:27 2006
@@ -34,13 +34,13 @@
import org.apache.hivemind.definition.OrderedServiceInterceptorDefinition;
import org.apache.hivemind.definition.ServiceInterceptorDefinition;
import org.apache.hivemind.definition.ServicePointDefinition;
+import org.apache.hivemind.definition.construction.ImplementationConstructionContext;
+import org.apache.hivemind.definition.construction.ImplementationConstructor;
+import org.apache.hivemind.definition.construction.InterceptorConstructor;
import org.apache.hivemind.internal.AbstractServiceImplementationConstructor;
import org.apache.hivemind.internal.AbstractServiceInterceptorConstructor;
import org.apache.hivemind.internal.Module;
-import org.apache.hivemind.internal.ServiceImplementationConstructor;
-import org.apache.hivemind.internal.ServiceInterceptorConstructor;
import org.apache.hivemind.internal.ServiceModel;
-import org.apache.hivemind.internal.ServicePoint;
import org.apache.hivemind.service.ClassFactory;
import org.apache.hivemind.service.MethodContribution;
import org.apache.hivemind.service.impl.LoggingInterceptorFactory;
@@ -193,7 +193,7 @@
helper.addSimpleServiceImplementation(sp, implementationClass, ServiceModel.SINGLETON);
// Add logging interceptor
- ServiceInterceptorConstructor constructor = new AbstractServiceInterceptorConstructor(module.getLocation()) {
+ InterceptorConstructor constructor = new AbstractServiceInterceptorConstructor(module.getLocation()) {
public void constructServiceInterceptor(InterceptorStack interceptorStack, Module contributingModule)
{
@@ -289,14 +289,13 @@
ModuleDefinitionHelper helper = new ModuleDefinitionHelper(module);
ServicePointDefinition sp = helper.addServicePoint("Recursive", SimpleService.class.getName());
- ServiceImplementationConstructor constructor = new AbstractServiceImplementationConstructor(module.getLocation())
+ ImplementationConstructor constructor = new AbstractServiceImplementationConstructor(module.getLocation())
{
- public Object constructCoreServiceImplementation(ServicePoint servicePoint,
- Module contributingModule)
+ public Object constructCoreServiceImplementation(ImplementationConstructionContext context)
{
Object result = new SimpleServiceImpl();
// Here is the recursion
- contributingModule.getService("hivemind.test.services.Recursive", SimpleService.class);
+ context.getService("hivemind.test.services.Recursive", SimpleService.class);
return result;
}
};
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?view=diff&rev=452755&r1=452754&r2=452755
==============================================================================
--- 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 Tue Oct 3 23:25:27 2006
@@ -22,12 +22,11 @@
import org.apache.hivemind.definition.ModuleDefinition;
import org.apache.hivemind.definition.ServiceImplementationDefinition;
import org.apache.hivemind.definition.ServicePointDefinition;
+import org.apache.hivemind.definition.construction.ImplementationConstructionContext;
+import org.apache.hivemind.definition.construction.ImplementationConstructor;
import org.apache.hivemind.events.RegistryShutdownListener;
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;
/**
* Tests shutdown on the registry and on deferred and threaded services.
@@ -157,9 +156,9 @@
ServicePointDefinition sp1 = createServicePointDefinition(module, "Listener", Runnable.class);
- ServiceImplementationConstructor constructor = new AbstractServiceImplementationConstructor(newLocation()) {
+ ImplementationConstructor constructor = new AbstractServiceImplementationConstructor(newLocation()) {
- public Object constructCoreServiceImplementation(ServicePoint servicePoint, Module contributingModule)
+ public Object constructCoreServiceImplementation(ImplementationConstructionContext context)
{
RunnableImpl result = new RunnableImpl();
result.setType(serviceModel);
Modified: hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/TestStartup.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/TestStartup.java?view=diff&rev=452755&r1=452754&r2=452755
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/TestStartup.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/test/hivemind/test/services/TestStartup.java Tue Oct 3 23:25:27 2006
@@ -24,9 +24,9 @@
import org.apache.hivemind.definition.ModuleDefinition;
import org.apache.hivemind.definition.ModuleDefinitionHelper;
import org.apache.hivemind.definition.ServicePointDefinition;
+import org.apache.hivemind.definition.construction.ContributionConstructionContext;
+import org.apache.hivemind.definition.construction.ContributionConstructor;
import org.apache.hivemind.impl.StartupImpl;
-import org.apache.hivemind.internal.ConfigurationPoint;
-import org.apache.hivemind.internal.Contribution;
import org.apache.hivemind.internal.ServiceModel;
/**
@@ -77,11 +77,11 @@
helper.addSimpleServiceImplementation(sp1, StartupRunnableFixtureImpl.class.getName(), ServiceModel.SINGLETON);
// Add service point "StartupRunnableFixture" to Startup configuration point
- helper.addContributionDefinition("hivemind.Startup", new Contribution()
+ helper.addContributionDefinition("hivemind.Startup", new ContributionConstructor()
{
- public void contribute(ConfigurationPoint configurationPoint, Object container)
+ public void contribute(ContributionConstructionContext context, Object container)
{
- ((List) container).add(configurationPoint.getModule().getService(StartupRunnableFixture.class));
+ ((List) container).add(context.getService(StartupRunnableFixture.class));
}
});
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?view=diff&rev=452755&r1=452754&r2=452755
==============================================================================
--- 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 Tue Oct 3 23:25:27 2006
@@ -21,11 +21,10 @@
import org.apache.hivemind.definition.ModuleDefinition;
import org.apache.hivemind.definition.ModuleDefinitionHelper;
import org.apache.hivemind.definition.ServicePointDefinition;
+import org.apache.hivemind.definition.construction.ImplementationConstructionContext;
+import org.apache.hivemind.definition.construction.ImplementationConstructor;
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;
/**
* @author James Carman
@@ -102,14 +101,13 @@
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())
+ ImplementationConstructor constructor = new AbstractServiceImplementationConstructor(module.getLocation())
{
- public Object constructCoreServiceImplementation(ServicePoint servicePoint,
- Module contributingModule)
+ public Object constructCoreServiceImplementation(ImplementationConstructionContext context)
{
Object result;
if (manual) {
- ShutdownCoordinator coordinator = (ShutdownCoordinator) contributingModule.getService(ShutdownCoordinator.class);
+ ShutdownCoordinator coordinator = (ShutdownCoordinator) context.getService(ShutdownCoordinator.class);
result = new SimpleImpl(coordinator);
} else {
result = new SimpleImpl();
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?view=diff&rev=452755&r1=452754&r2=452755
==============================================================================
--- 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 Tue Oct 3 23:25:27 2006
@@ -16,17 +16,16 @@
import java.lang.reflect.Method;
-import org.apache.hivemind.Location;
-import org.apache.hivemind.internal.AbstractServiceImplementationConstructor;
-import org.apache.hivemind.internal.Module;
-import org.apache.hivemind.internal.ServicePoint;
-
import net.sf.cglib.proxy.Callback;
import net.sf.cglib.proxy.CallbackFilter;
import net.sf.cglib.proxy.Enhancer;
import net.sf.cglib.proxy.FixedValue;
import net.sf.cglib.proxy.NoOp;
+import org.apache.hivemind.Location;
+import org.apache.hivemind.definition.construction.ImplementationConstructionContext;
+import org.apache.hivemind.internal.AbstractServiceImplementationConstructor;
+
/**
*
* @author James Carman
@@ -39,7 +38,7 @@
super(location);
}
- public Object constructCoreServiceImplementation(ServicePoint servicePoint, Module contributingModule)
+ public Object constructCoreServiceImplementation(ImplementationConstructionContext context)
{
return createCglibBean();
}
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?view=diff&rev=452755&r1=452754&r2=452755
==============================================================================
--- 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 Tue Oct 3 23:25:27 2006
@@ -21,9 +21,8 @@
import org.apache.hivemind.ApplicationRuntimeException;
import org.apache.hivemind.Location;
+import org.apache.hivemind.definition.construction.ImplementationConstructionContext;
import org.apache.hivemind.internal.AbstractServiceImplementationConstructor;
-import org.apache.hivemind.internal.Module;
-import org.apache.hivemind.internal.ServicePoint;
import org.apache.hivemind.service.ClassFabUtils;
/**
@@ -37,7 +36,7 @@
super(location);
}
- public Object constructCoreServiceImplementation(ServicePoint servicePoint, Module contributingModule)
+ public Object constructCoreServiceImplementation(ImplementationConstructionContext context)
{
return createJavassistBean();
}