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 2007/02/07 08:43:12 UTC
svn commit: r504455 - in /hivemind/hivemind2/trunk:
annotations/src/java/org/apache/hivemind/annotations/internal/
framework/src/java/org/apache/hivemind/definition/
framework/src/java/org/apache/hivemind/definition/impl/
framework/src/java/org/apache/...
Author: ahuegen
Date: Tue Feb 6 23:43:11 2007
New Revision: 504455
URL: http://svn.apache.org/viewvc?view=rev&rev=504455
Log:
add methods moved from ModuleDefinition to ModuleDefinitionImpl
Modified:
hivemind/hivemind2/trunk/annotations/src/java/org/apache/hivemind/annotations/internal/AnnotatedModuleProcessor.java
hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/definition/ModuleDefinition.java
hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/definition/ModuleDefinitionHelper.java
hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/definition/impl/ModuleDefinitionImpl.java
hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/impl/CoreServicesProvider.java
hivemind/hivemind2/trunk/framework/src/test/hivemind/test/FrameworkTestCase.java
hivemind/hivemind2/trunk/framework/src/test/hivemind/test/TestDependency.java
hivemind/hivemind2/trunk/framework/src/test/hivemind/test/TestRegistryBuilder.java
hivemind/hivemind2/trunk/framework/src/test/hivemind/test/TestServicesByInterface.java
hivemind/hivemind2/trunk/framework/src/test/hivemind/test/services/TestEagerLoader.java
hivemind/hivemind2/trunk/framework/src/test/hivemind/test/services/TestServices.java
hivemind/hivemind2/trunk/framework/src/test/hivemind/test/services/TestShutdown.java
hivemind/hivemind2/trunk/framework/src/test/hivemind/test/services/TestStartup.java
hivemind/hivemind2/trunk/framework/src/test/hivemind/test/services/TestThreadedModel.java
hivemind/hivemind2/trunk/framework/src/test/org/apache/hivemind/TestBeanService.java
hivemind/hivemind2/trunk/framework/src/test/org/apache/hivemind/impl/TestRegistryInfrastructureConstructor.java
hivemind/hivemind2/trunk/framework/src/test/org/apache/hivemind/impl/servicemodel/TestRegistryShutdownListenerServices.java
hivemind/hivemind2/trunk/framework/src/test/org/apache/hivemind/service/impl/TestLoggingInterceptorFactory.java
hivemind/hivemind2/trunk/xml/src/java/org/apache/hivemind/impl/XmlCoreServicesProvider.java
hivemind/hivemind2/trunk/xml/src/java/org/apache/hivemind/impl/XmlModuleDescriptorProcessor.java
Modified: hivemind/hivemind2/trunk/annotations/src/java/org/apache/hivemind/annotations/internal/AnnotatedModuleProcessor.java
URL: http://svn.apache.org/viewvc/hivemind/hivemind2/trunk/annotations/src/java/org/apache/hivemind/annotations/internal/AnnotatedModuleProcessor.java?view=diff&rev=504455&r1=504454&r2=504455
==============================================================================
--- hivemind/hivemind2/trunk/annotations/src/java/org/apache/hivemind/annotations/internal/AnnotatedModuleProcessor.java (original)
+++ hivemind/hivemind2/trunk/annotations/src/java/org/apache/hivemind/annotations/internal/AnnotatedModuleProcessor.java Tue Feb 6 23:43:11 2007
@@ -14,10 +14,9 @@
import org.apache.hivemind.annotations.Service;
import org.apache.hivemind.definition.Contribution;
import org.apache.hivemind.definition.ImplementationConstructor;
-import org.apache.hivemind.definition.ModuleDefinition;
+import org.apache.hivemind.definition.ImplementationDefinition;
import org.apache.hivemind.definition.Occurances;
import org.apache.hivemind.definition.RegistryDefinition;
-import org.apache.hivemind.definition.ImplementationDefinition;
import org.apache.hivemind.definition.Visibility;
import org.apache.hivemind.definition.impl.ConfigurationPointDefinitionImpl;
import org.apache.hivemind.definition.impl.ContributionDefinitionImpl;
@@ -59,7 +58,7 @@
*/
public void processModule(Class moduleClass)
{
- ModuleDefinition module = new ModuleDefinitionImpl(determineModuleId(moduleClass),
+ ModuleDefinitionImpl module = new ModuleDefinitionImpl(determineModuleId(moduleClass),
createModuleLocation(moduleClass), _classResolver, moduleClass.getPackage().getName());
// processServices(moduleClass);
@@ -75,7 +74,7 @@
}
- public void processModuleMethods(Class moduleClass, ModuleDefinition module,
+ public void processModuleMethods(Class moduleClass, ModuleDefinitionImpl module,
ModuleInstanceProvider instanceProvider)
{
Method[] methods = moduleClass.getMethods();
@@ -86,7 +85,7 @@
}
}
- public void processMethod(Method method, ModuleDefinition module,
+ public void processMethod(Method method, ModuleDefinitionImpl module,
ModuleInstanceProvider instanceProvider)
{
if (_log.isDebugEnabled())
@@ -128,7 +127,7 @@
}
private void processAnnotatedServiceMethod(Method method, Service service,
- ModuleDefinition module, ModuleInstanceProvider instanceProvider)
+ ModuleDefinitionImpl module, ModuleInstanceProvider instanceProvider)
{
if (_log.isDebugEnabled())
{
@@ -152,7 +151,7 @@
}
- private void processAnnotatedConfigurationMethod(Method method, Configuration configuration, ModuleDefinition module, ModuleInstanceProvider instanceProvider)
+ private void processAnnotatedConfigurationMethod(Method method, Configuration configuration, ModuleDefinitionImpl module, ModuleInstanceProvider instanceProvider)
{
if (_log.isDebugEnabled())
{
@@ -173,7 +172,7 @@
cpd.addContribution(cd);
}
- private void processAnnotatedContributionMethod(Method method, org.apache.hivemind.annotations.Contribution contribution, ModuleDefinition module, ModuleInstanceProvider instanceProvider)
+ private void processAnnotatedContributionMethod(Method method, org.apache.hivemind.annotations.Contribution contribution, ModuleDefinitionImpl module, ModuleInstanceProvider instanceProvider)
{
if (_log.isDebugEnabled())
{
Modified: hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/definition/ModuleDefinition.java
URL: http://svn.apache.org/viewvc/hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/definition/ModuleDefinition.java?view=diff&rev=504455&r1=504454&r2=504455
==============================================================================
--- hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/definition/ModuleDefinition.java (original)
+++ hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/definition/ModuleDefinition.java Tue Feb 6 23:43:11 2007
@@ -2,7 +2,6 @@
import java.util.Collection;
-import org.apache.hivemind.ApplicationRuntimeException;
import org.apache.hivemind.ClassResolver;
import org.apache.hivemind.Location;
@@ -39,14 +38,6 @@
public String getPackageName();
/**
- * Adds a service point definition to the module.
- * @param servicePoint the service point
- * @throws ApplicationRuntimeException if another service point with the same id has already been defined
- */
- public void addServicePoint(ServicePointDefinition servicePoint)
- throws ApplicationRuntimeException;
-
- /**
* Returns a service point that is identified by its id.
* @param id the service point id (unqualified, without module id)
* @return the service point definition
@@ -59,14 +50,6 @@
public Collection getServicePoints();
/**
- * Adds a configuration point definition to the module.
- * @param configurationPoint the configuration point
- * @throws ApplicationRuntimeException if another configuration point with the same id has already been defined
- */
- public void addConfigurationPoint(ConfigurationPointDefinition configurationPoint)
- throws ApplicationRuntimeException;
-
- /**
* Returns a configuration point that is identified by its id.
* @param id the configuration point id (unqualified, without module id)
* @return the configuration point definition
@@ -79,76 +62,28 @@
public Collection getConfigurationPoints();
/**
- * Defines a dependency on another module. The presence of that module
- * is checked during registry construction.
- *
- * @param dependsOnModuleId the id of the module this module depends on
- */
- public void addDependency(String dependsOnModuleId);
-
- /**
* @return the ids of all modules this module depends on
*/
public Collection getDependencies();
/**
- * Adds a implementation for a service point which can be defined in this
- * module or another module.
- *
- * @param qualifiedServicePointId the fully qualified service point id
- * @param implementation the implementation definition
- */
- public void addImplementation(String qualifiedServicePointId,
- ImplementationDefinition implementation);
-
- /**
* @return all {@link ImplementationDefinition implementations} defined in this module
* by a call to {@link #addServiceImplementation}.
*/
public Collection getImplementations();
/**
- * Adds a interceptor for a service point which can be defined in this
- * module or another module.
- *
- * @param qualifiedServicePointId the fully qualified service point id
- * @param interceptor the interceptor definition
- */
- public void addInterceptor(String qualifiedServicePointId,
- InterceptorDefinition interceptor);
-
- /**
* @return all {@link InterceptorDefinition interceptors} defined in this module
* by a call to {@link #addServiceInterceptor}.
*/
public Collection getInterceptors();
/**
- * Adds a contribution for a configuration point which can be defined in this
- * module or another module.
- *
- * @param qualifiedServicePointId the fully qualified configuration point id
- * @param contribution the contribution definition
- */
- public void addContribution(String qualifiedConfigurationPointId,
- ContributionDefinition contribution);
-
- /**
* @return all {@link ContributionDefinition contributions} defined in this module
* by a call to {@link #addContribution}.
*/
public Collection getContributions();
- /**
- * Adds a configuration parser for a configuration point which can be defined in this
- * module or another module.
- *
- * @param qualifiedServicePointId the fully qualified configuration point id
- * @param parser the parser definition
- */
- public void addConfigurationParser(String qualifiedConfigurationPointId,
- ConfigurationParserDefinition parser);
-
/**
* @return all {@link ConfigurationParserDefinition parsers} defined in this module
* by a call to {@link #addConfigurationParser}.
Modified: hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/definition/ModuleDefinitionHelper.java
URL: http://svn.apache.org/viewvc/hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/definition/ModuleDefinitionHelper.java?view=diff&rev=504455&r1=504454&r2=504455
==============================================================================
--- hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/definition/ModuleDefinitionHelper.java (original)
+++ hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/definition/ModuleDefinitionHelper.java Tue Feb 6 23:43:11 2007
@@ -2,6 +2,7 @@
import org.apache.hivemind.definition.impl.ConfigurationPointDefinitionImpl;
import org.apache.hivemind.definition.impl.ContributionDefinitionImpl;
+import org.apache.hivemind.definition.impl.ModuleDefinitionImpl;
import org.apache.hivemind.definition.impl.ServiceImplementationDefinitionImpl;
import org.apache.hivemind.definition.impl.ServicePointDefinitionImpl;
import org.apache.hivemind.impl.CreateClassServiceConstructor;
@@ -17,9 +18,9 @@
*/
public class ModuleDefinitionHelper
{
- private ModuleDefinition _module;
+ private ModuleDefinitionImpl _module;
- public ModuleDefinitionHelper(ModuleDefinition module)
+ public ModuleDefinitionHelper(ModuleDefinitionImpl module)
{
_module = module;
}
Modified: hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/definition/impl/ModuleDefinitionImpl.java
URL: http://svn.apache.org/viewvc/hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/definition/impl/ModuleDefinitionImpl.java?view=diff&rev=504455&r1=504454&r2=504455
==============================================================================
--- hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/definition/impl/ModuleDefinitionImpl.java (original)
+++ hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/definition/impl/ModuleDefinitionImpl.java Tue Feb 6 23:43:11 2007
@@ -128,7 +128,9 @@
}
/**
- * @see org.apache.hivemind.definition.ModuleDefinition#addServicePoint(org.apache.hivemind.definition.ServicePointDefinition)
+ * Adds a service point definition to the module.
+ * @param servicePoint the service point
+ * @throws ApplicationRuntimeException if another service point with the same id has already been defined
*/
public void addServicePoint(ServicePointDefinition servicePoint)
{
@@ -156,7 +158,9 @@
}
/**
- * @see org.apache.hivemind.definition.ModuleDefinition#addConfigurationPoint(org.apache.hivemind.definition.ConfigurationPointDefinition)
+ * Adds a configuration point definition to the module.
+ * @param configurationPoint the configuration point
+ * @throws ApplicationRuntimeException if another configuration point with the same id has already been defined
*/
public void addConfigurationPoint(ConfigurationPointDefinition configurationPoint)
{
@@ -192,7 +196,10 @@
}
/**
- * @see org.apache.hivemind.definition.ModuleDefinition#addDependency(java.lang.String)
+ * Defines a dependency on another module. The presence of that module
+ * is checked during registry construction.
+ *
+ * @param dependsOnModuleId the id of the module this module depends on
*/
public void addDependency(String dependsOnModuleId)
{
@@ -200,7 +207,11 @@
}
/**
- * @see org.apache.hivemind.definition.ModuleDefinition#addImplementation(java.lang.String, org.apache.hivemind.definition.ImplementationDefinition)
+ * Adds a implementation for a service point which can be defined in this
+ * module or another module.
+ *
+ * @param qualifiedServicePointId the fully qualified service point id
+ * @param implementation the implementation definition
*/
public void addImplementation(String qualifiedServicePointId,
ImplementationDefinition implementation)
@@ -211,7 +222,11 @@
}
/**
- * @see org.apache.hivemind.definition.ModuleDefinition#addInterceptor(java.lang.String, org.apache.hivemind.definition.InterceptorDefinition)
+ * Adds a interceptor for a service point which can be defined in this
+ * module or another module.
+ *
+ * @param qualifiedServicePointId the fully qualified service point id
+ * @param interceptor the interceptor definition
*/
public void addInterceptor(String qualifiedServicePointId,
InterceptorDefinition interceptor)
@@ -222,7 +237,11 @@
}
/**
- * @see org.apache.hivemind.definition.ModuleDefinition#addContribution(java.lang.String, org.apache.hivemind.definition.ContributionDefinition)
+ * Adds a contribution for a configuration point which can be defined in this
+ * module or another module.
+ *
+ * @param qualifiedServicePointId the fully qualified configuration point id
+ * @param contribution the contribution definition
*/
public void addContribution(String qualifiedConfigurationPointId,
ContributionDefinition contribution)
@@ -233,7 +252,11 @@
}
/**
- * @see org.apache.hivemind.definition.ModuleDefinition#addConfigurationParser(java.lang.String, org.apache.hivemind.definition.ConfigurationParserDefinition)
+ * Adds a configuration parser for a configuration point which can be defined in this
+ * module or another module.
+ *
+ * @param qualifiedServicePointId the fully qualified configuration point id
+ * @param parser the parser definition
*/
public void addConfigurationParser(String qualifiedConfigurationPointId, ConfigurationParserDefinition parser)
{
Modified: hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/impl/CoreServicesProvider.java
URL: http://svn.apache.org/viewvc/hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/impl/CoreServicesProvider.java?view=diff&rev=504455&r1=504454&r2=504455
==============================================================================
--- hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/impl/CoreServicesProvider.java (original)
+++ hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/impl/CoreServicesProvider.java Tue Feb 6 23:43:11 2007
@@ -71,7 +71,8 @@
registryDefinition.addModule(md);
}
- helper = new ModuleDefinitionHelper(md);
+ // The cast to ModuleDefinitionImpl is save, since we exactly now the origin
+ helper = new ModuleDefinitionHelper((ModuleDefinitionImpl) md);
addClassFactory(md);
Modified: hivemind/hivemind2/trunk/framework/src/test/hivemind/test/FrameworkTestCase.java
URL: http://svn.apache.org/viewvc/hivemind/hivemind2/trunk/framework/src/test/hivemind/test/FrameworkTestCase.java?view=diff&rev=504455&r1=504454&r2=504455
==============================================================================
--- hivemind/hivemind2/trunk/framework/src/test/hivemind/test/FrameworkTestCase.java (original)
+++ hivemind/hivemind2/trunk/framework/src/test/hivemind/test/FrameworkTestCase.java Tue Feb 6 23:43:11 2007
@@ -61,12 +61,11 @@
}
/**
- * Convenience method for creating a
- * {@link ModuleDefinitionImpl}.
+ * Convenience method for creating a {@link ModuleDefinitionImpl}.
*/
- protected ModuleDefinition createModuleDefinition(String moduleId)
+ protected ModuleDefinitionImpl createModuleDefinition(String moduleId)
{
- ModuleDefinition result = new ModuleDefinitionImpl(moduleId, newLocation(),
+ ModuleDefinitionImpl result = new ModuleDefinitionImpl(moduleId, newLocation(),
getClassResolver(), "");
return result;
Modified: hivemind/hivemind2/trunk/framework/src/test/hivemind/test/TestDependency.java
URL: http://svn.apache.org/viewvc/hivemind/hivemind2/trunk/framework/src/test/hivemind/test/TestDependency.java?view=diff&rev=504455&r1=504454&r2=504455
==============================================================================
--- hivemind/hivemind2/trunk/framework/src/test/hivemind/test/TestDependency.java (original)
+++ hivemind/hivemind2/trunk/framework/src/test/hivemind/test/TestDependency.java Tue Feb 6 23:43:11 2007
@@ -15,6 +15,7 @@
package hivemind.test;
import org.apache.hivemind.definition.ModuleDefinition;
+import org.apache.hivemind.definition.impl.ModuleDefinitionImpl;
/**
* Tests the module dependencies (specified using <dependency.>).
@@ -26,7 +27,7 @@
public void testMissingRequiredModule() throws Exception
{
- ModuleDefinition dependingModule = createModuleDefinition(
+ ModuleDefinitionImpl dependingModule = createModuleDefinition(
"dependency.declaring.module");
dependingModule.addDependency("required.module");
@@ -40,7 +41,7 @@
public void testDependency() throws Exception
{
- ModuleDefinition dependingModule = createModuleDefinition(
+ ModuleDefinitionImpl dependingModule = createModuleDefinition(
"dependency.declaring.module");
ModuleDefinition requiredModule = createModuleDefinition("required.module");
Modified: hivemind/hivemind2/trunk/framework/src/test/hivemind/test/TestRegistryBuilder.java
URL: http://svn.apache.org/viewvc/hivemind/hivemind2/trunk/framework/src/test/hivemind/test/TestRegistryBuilder.java?view=diff&rev=504455&r1=504454&r2=504455
==============================================================================
--- hivemind/hivemind2/trunk/framework/src/test/hivemind/test/TestRegistryBuilder.java (original)
+++ hivemind/hivemind2/trunk/framework/src/test/hivemind/test/TestRegistryBuilder.java Tue Feb 6 23:43:11 2007
@@ -16,8 +16,8 @@
import org.apache.hivemind.ApplicationRuntimeException;
import org.apache.hivemind.Registry;
-import org.apache.hivemind.definition.ModuleDefinition;
import org.apache.hivemind.definition.RegistryDefinition;
+import org.apache.hivemind.definition.impl.ModuleDefinitionImpl;
import org.apache.hivemind.definition.impl.RegistryDefinitionImpl;
import org.apache.hivemind.impl.RegistryBuilder;
import org.apache.hivemind.service.ClassFactory;
@@ -59,7 +59,7 @@
public void testDuplicateExtensionPoints() throws Exception
{
- ModuleDefinition testModule = createModuleDefinition("hivemind.test");
+ ModuleDefinitionImpl testModule = createModuleDefinition("hivemind.test");
testModule.addServicePoint(createServicePointDefinition(testModule, "MyService", Comparable.class));
try
Modified: hivemind/hivemind2/trunk/framework/src/test/hivemind/test/TestServicesByInterface.java
URL: http://svn.apache.org/viewvc/hivemind/hivemind2/trunk/framework/src/test/hivemind/test/TestServicesByInterface.java?view=diff&rev=504455&r1=504454&r2=504455
==============================================================================
--- hivemind/hivemind2/trunk/framework/src/test/hivemind/test/TestServicesByInterface.java (original)
+++ hivemind/hivemind2/trunk/framework/src/test/hivemind/test/TestServicesByInterface.java Tue Feb 6 23:43:11 2007
@@ -16,8 +16,8 @@
import org.apache.hivemind.ApplicationRuntimeException;
import org.apache.hivemind.Registry;
-import org.apache.hivemind.definition.ModuleDefinition;
import org.apache.hivemind.definition.ImplementationDefinition;
+import org.apache.hivemind.definition.impl.ModuleDefinitionImpl;
import org.apache.hivemind.definition.impl.ServicePointDefinitionImpl;
/**
@@ -33,7 +33,7 @@
{
super.setUp();
- ModuleDefinition module = createModuleDefinition("hivemind.tests.serviceByInterface");
+ ModuleDefinitionImpl module = createModuleDefinition("hivemind.tests.serviceByInterface");
ServicePointDefinitionImpl sp1 = createServicePointDefinition(module, "uniqueService", IUniqueService.class);
ImplementationDefinition impl1 = createServiceImplementationDefinition(module, UniqueServiceImpl.class);
Modified: hivemind/hivemind2/trunk/framework/src/test/hivemind/test/services/TestEagerLoader.java
URL: http://svn.apache.org/viewvc/hivemind/hivemind2/trunk/framework/src/test/hivemind/test/services/TestEagerLoader.java?view=diff&rev=504455&r1=504454&r2=504455
==============================================================================
--- hivemind/hivemind2/trunk/framework/src/test/hivemind/test/services/TestEagerLoader.java (original)
+++ hivemind/hivemind2/trunk/framework/src/test/hivemind/test/services/TestEagerLoader.java Tue Feb 6 23:43:11 2007
@@ -23,9 +23,9 @@
import org.apache.hivemind.Registry;
import org.apache.hivemind.definition.Contribution;
import org.apache.hivemind.definition.ContributionContext;
-import org.apache.hivemind.definition.ModuleDefinition;
import org.apache.hivemind.definition.ModuleDefinitionHelper;
import org.apache.hivemind.definition.ServicePointDefinition;
+import org.apache.hivemind.definition.impl.ModuleDefinitionImpl;
import org.apache.hivemind.internal.ServiceModel;
import org.apache.hivemind.internal.ServicePoint;
import org.apache.hivemind.service.impl.EagerLoader;
@@ -99,7 +99,7 @@
*/
private Registry createEagerLoadModule(final String serviceModel)
{
- ModuleDefinition module = createModuleDefinition("hivemind.test.services");
+ ModuleDefinitionImpl module = createModuleDefinition("hivemind.test.services");
ModuleDefinitionHelper helper = new ModuleDefinitionHelper(module);
ServicePointDefinition sp1 = helper.addServicePoint("Loud", Runnable.class.getName());
Modified: hivemind/hivemind2/trunk/framework/src/test/hivemind/test/services/TestServices.java
URL: http://svn.apache.org/viewvc/hivemind/hivemind2/trunk/framework/src/test/hivemind/test/services/TestServices.java?view=diff&rev=504455&r1=504454&r2=504455
==============================================================================
--- hivemind/hivemind2/trunk/framework/src/test/hivemind/test/services/TestServices.java (original)
+++ hivemind/hivemind2/trunk/framework/src/test/hivemind/test/services/TestServices.java Tue Feb 6 23:43:11 2007
@@ -33,10 +33,11 @@
import org.apache.hivemind.definition.ImplementationConstructionContext;
import org.apache.hivemind.definition.ImplementationConstructor;
import org.apache.hivemind.definition.InterceptorConstructor;
+import org.apache.hivemind.definition.InterceptorDefinition;
import org.apache.hivemind.definition.ModuleDefinition;
import org.apache.hivemind.definition.ModuleDefinitionHelper;
-import org.apache.hivemind.definition.InterceptorDefinition;
import org.apache.hivemind.definition.ServicePointDefinition;
+import org.apache.hivemind.definition.impl.ModuleDefinitionImpl;
import org.apache.hivemind.definition.impl.OrderedServiceInterceptorDefinitionImpl;
import org.apache.hivemind.definition.impl.ServiceInterceptorDefinitionImpl;
import org.apache.hivemind.internal.AbstractServiceImplementationConstructor;
@@ -189,7 +190,7 @@
private Registry createRegistryWithInterceptedService(String serviceName, String serviceInterface, String implementationClass,
final List interceptedMethods)
{
- ModuleDefinition module = createModuleDefinition("hivemind.test.services");
+ ModuleDefinitionImpl module = createModuleDefinition("hivemind.test.services");
ModuleDefinitionHelper helper = new ModuleDefinitionHelper(module);
ServicePointDefinition sp = helper.addServicePoint(serviceName, serviceInterface);
helper.addSimpleServiceImplementation(sp, implementationClass, ServiceModel.SINGLETON);
@@ -299,7 +300,7 @@
*/
private Registry createRegistryWithRecursiveService()
{
- ModuleDefinition module = createModuleDefinition("hivemind.test.services");
+ ModuleDefinitionImpl module = createModuleDefinition("hivemind.test.services");
ModuleDefinitionHelper helper = new ModuleDefinitionHelper(module);
ServicePointDefinition sp = helper.addServicePoint("Recursive", SimpleService.class.getName());
Modified: hivemind/hivemind2/trunk/framework/src/test/hivemind/test/services/TestShutdown.java
URL: http://svn.apache.org/viewvc/hivemind/hivemind2/trunk/framework/src/test/hivemind/test/services/TestShutdown.java?view=diff&rev=504455&r1=504454&r2=504455
==============================================================================
--- hivemind/hivemind2/trunk/framework/src/test/hivemind/test/services/TestShutdown.java (original)
+++ hivemind/hivemind2/trunk/framework/src/test/hivemind/test/services/TestShutdown.java Tue Feb 6 23:43:11 2007
@@ -21,8 +21,8 @@
import org.apache.hivemind.Registry;
import org.apache.hivemind.definition.ImplementationConstructionContext;
import org.apache.hivemind.definition.ImplementationConstructor;
-import org.apache.hivemind.definition.ModuleDefinition;
import org.apache.hivemind.definition.ImplementationDefinition;
+import org.apache.hivemind.definition.impl.ModuleDefinitionImpl;
import org.apache.hivemind.definition.impl.ServiceImplementationDefinitionImpl;
import org.apache.hivemind.definition.impl.ServicePointDefinitionImpl;
import org.apache.hivemind.events.RegistryShutdownListener;
@@ -153,7 +153,7 @@
*/
private Registry createModuleWithShutdownListener(final String serviceModel)
{
- ModuleDefinition module = createModuleDefinition("module1");
+ ModuleDefinitionImpl module = createModuleDefinition("module1");
ServicePointDefinitionImpl sp1 = createServicePointDefinition(module, "Listener", Runnable.class);
Modified: hivemind/hivemind2/trunk/framework/src/test/hivemind/test/services/TestStartup.java
URL: http://svn.apache.org/viewvc/hivemind/hivemind2/trunk/framework/src/test/hivemind/test/services/TestStartup.java?view=diff&rev=504455&r1=504454&r2=504455
==============================================================================
--- hivemind/hivemind2/trunk/framework/src/test/hivemind/test/services/TestStartup.java (original)
+++ hivemind/hivemind2/trunk/framework/src/test/hivemind/test/services/TestStartup.java Tue Feb 6 23:43:11 2007
@@ -23,9 +23,9 @@
import org.apache.hivemind.Registry;
import org.apache.hivemind.definition.Contribution;
import org.apache.hivemind.definition.ContributionContext;
-import org.apache.hivemind.definition.ModuleDefinition;
import org.apache.hivemind.definition.ModuleDefinitionHelper;
import org.apache.hivemind.definition.ServicePointDefinition;
+import org.apache.hivemind.definition.impl.ModuleDefinitionImpl;
import org.apache.hivemind.impl.StartupImpl;
import org.apache.hivemind.internal.ServiceModel;
@@ -70,7 +70,7 @@
*/
private Registry createRegistry()
{
- ModuleDefinition module = createModuleDefinition("hivemind.test.services");
+ ModuleDefinitionImpl module = createModuleDefinition("hivemind.test.services");
ModuleDefinitionHelper helper = new ModuleDefinitionHelper(module);
ServicePointDefinition sp1 = helper.addServicePoint("StartupRunnableFixture", StartupRunnableFixture.class.getName());
Modified: hivemind/hivemind2/trunk/framework/src/test/hivemind/test/services/TestThreadedModel.java
URL: http://svn.apache.org/viewvc/hivemind/hivemind2/trunk/framework/src/test/hivemind/test/services/TestThreadedModel.java?view=diff&rev=504455&r1=504454&r2=504455
==============================================================================
--- hivemind/hivemind2/trunk/framework/src/test/hivemind/test/services/TestThreadedModel.java (original)
+++ hivemind/hivemind2/trunk/framework/src/test/hivemind/test/services/TestThreadedModel.java Tue Feb 6 23:43:11 2007
@@ -20,9 +20,9 @@
import org.apache.hivemind.HiveMind;
import org.apache.hivemind.Registry;
-import org.apache.hivemind.definition.ModuleDefinition;
import org.apache.hivemind.definition.ModuleDefinitionHelper;
import org.apache.hivemind.definition.ServicePointDefinition;
+import org.apache.hivemind.definition.impl.ModuleDefinitionImpl;
import org.apache.hivemind.internal.ServiceModel;
import org.apache.hivemind.service.ThreadEventNotifier;
@@ -187,7 +187,7 @@
*/
private Registry createRegistryShutdownListener(Class implementationClass)
{
- ModuleDefinition module = createModuleDefinition("hivemind.test.services");
+ ModuleDefinitionImpl module = createModuleDefinition("hivemind.test.services");
ModuleDefinitionHelper helper = new ModuleDefinitionHelper(module);
ServicePointDefinition sp1 = helper.addServicePoint("StringHolder", StringHolder.class.getName());
Modified: hivemind/hivemind2/trunk/framework/src/test/org/apache/hivemind/TestBeanService.java
URL: http://svn.apache.org/viewvc/hivemind/hivemind2/trunk/framework/src/test/org/apache/hivemind/TestBeanService.java?view=diff&rev=504455&r1=504454&r2=504455
==============================================================================
--- hivemind/hivemind2/trunk/framework/src/test/org/apache/hivemind/TestBeanService.java (original)
+++ hivemind/hivemind2/trunk/framework/src/test/org/apache/hivemind/TestBeanService.java Tue Feb 6 23:43:11 2007
@@ -16,9 +16,9 @@
import hivemind.test.FrameworkTestCase;
-import org.apache.hivemind.definition.ModuleDefinition;
import org.apache.hivemind.definition.ModuleDefinitionHelper;
import org.apache.hivemind.definition.ServicePointDefinition;
+import org.apache.hivemind.definition.impl.ModuleDefinitionImpl;
import org.apache.hivemind.internal.ServiceModel;
/**
@@ -72,7 +72,7 @@
*/
private Registry createRegistryWithPojo(final String serviceModel)
{
- ModuleDefinition module = createModuleDefinition("bean");
+ ModuleDefinitionImpl module = createModuleDefinition("bean");
ModuleDefinitionHelper helper = new ModuleDefinitionHelper(module);
ServicePointDefinition sp1 = helper.addServicePoint("Reverser", Reverser.class.getName());
Modified: hivemind/hivemind2/trunk/framework/src/test/org/apache/hivemind/impl/TestRegistryInfrastructureConstructor.java
URL: http://svn.apache.org/viewvc/hivemind/hivemind2/trunk/framework/src/test/org/apache/hivemind/impl/TestRegistryInfrastructureConstructor.java?view=diff&rev=504455&r1=504454&r2=504455
==============================================================================
--- hivemind/hivemind2/trunk/framework/src/test/org/apache/hivemind/impl/TestRegistryInfrastructureConstructor.java (original)
+++ hivemind/hivemind2/trunk/framework/src/test/org/apache/hivemind/impl/TestRegistryInfrastructureConstructor.java Tue Feb 6 23:43:11 2007
@@ -18,8 +18,8 @@
import org.apache.commons.logging.LogFactory;
import org.apache.hivemind.definition.ConfigurationPointDefinition;
-import org.apache.hivemind.definition.ModuleDefinition;
import org.apache.hivemind.definition.RegistryDefinition;
+import org.apache.hivemind.definition.impl.ModuleDefinitionImpl;
import org.apache.hivemind.definition.impl.RegistryDefinitionImpl;
import org.apache.hivemind.definition.impl.ServicePointDefinitionImpl;
import org.apache.hivemind.internal.ConfigurationPoint;
@@ -40,13 +40,13 @@
RegistryDefinition definition = new RegistryDefinitionImpl();
- ModuleDefinition fooBar = createModuleDefinition("foo.bar");
+ ModuleDefinitionImpl fooBar = createModuleDefinition("foo.bar");
ServicePointDefinitionImpl spd = createServicePointDefinition(fooBar, "sp1", Runnable.class);
fooBar.addServicePoint(spd);
- ModuleDefinition zipZoop = createModuleDefinition("zip.zoop");
+ ModuleDefinitionImpl zipZoop = createModuleDefinition("zip.zoop");
ConfigurationPointDefinition cpd = createConfigurationPointDefinition(fooBar, "cp1");
Modified: hivemind/hivemind2/trunk/framework/src/test/org/apache/hivemind/impl/servicemodel/TestRegistryShutdownListenerServices.java
URL: http://svn.apache.org/viewvc/hivemind/hivemind2/trunk/framework/src/test/org/apache/hivemind/impl/servicemodel/TestRegistryShutdownListenerServices.java?view=diff&rev=504455&r1=504454&r2=504455
==============================================================================
--- hivemind/hivemind2/trunk/framework/src/test/org/apache/hivemind/impl/servicemodel/TestRegistryShutdownListenerServices.java (original)
+++ hivemind/hivemind2/trunk/framework/src/test/org/apache/hivemind/impl/servicemodel/TestRegistryShutdownListenerServices.java Tue Feb 6 23:43:11 2007
@@ -20,9 +20,9 @@
import org.apache.hivemind.ShutdownCoordinator;
import org.apache.hivemind.definition.ImplementationConstructionContext;
import org.apache.hivemind.definition.ImplementationConstructor;
-import org.apache.hivemind.definition.ModuleDefinition;
import org.apache.hivemind.definition.ModuleDefinitionHelper;
import org.apache.hivemind.definition.ServicePointDefinition;
+import org.apache.hivemind.definition.impl.ModuleDefinitionImpl;
import org.apache.hivemind.internal.AbstractServiceImplementationConstructor;
import org.apache.hivemind.internal.ServiceModel;
@@ -95,7 +95,7 @@
*/
private Registry createRegistryWithSimpleService(final String serviceModel, final boolean manual)
{
- ModuleDefinition module = createModuleDefinition("hivemind.lib.test");
+ ModuleDefinitionImpl module = createModuleDefinition("hivemind.lib.test");
ModuleDefinitionHelper helper = new ModuleDefinitionHelper(module);
ServicePointDefinition sp1 = helper.addServicePoint("Simple", Simple.class.getName());
@@ -127,7 +127,7 @@
*/
private Registry createRegistryWithPojo(final String serviceModel)
{
- ModuleDefinition module = createModuleDefinition("hivemind.lib.test");
+ ModuleDefinitionImpl module = createModuleDefinition("hivemind.lib.test");
ModuleDefinitionHelper helper = new ModuleDefinitionHelper(module);
ServicePointDefinition sp1 = helper.addServicePoint("RegistryShutdownBean", RegistryShutdownBean.class.getName());
Modified: hivemind/hivemind2/trunk/framework/src/test/org/apache/hivemind/service/impl/TestLoggingInterceptorFactory.java
URL: http://svn.apache.org/viewvc/hivemind/hivemind2/trunk/framework/src/test/org/apache/hivemind/service/impl/TestLoggingInterceptorFactory.java?view=diff&rev=504455&r1=504454&r2=504455
==============================================================================
--- hivemind/hivemind2/trunk/framework/src/test/org/apache/hivemind/service/impl/TestLoggingInterceptorFactory.java (original)
+++ hivemind/hivemind2/trunk/framework/src/test/org/apache/hivemind/service/impl/TestLoggingInterceptorFactory.java Tue Feb 6 23:43:11 2007
@@ -22,9 +22,9 @@
import org.apache.commons.logging.Log;
import org.apache.hivemind.Registry;
import org.apache.hivemind.definition.ImplementationConstructor;
-import org.apache.hivemind.definition.ModuleDefinition;
-import org.apache.hivemind.definition.RegistryDefinition;
import org.apache.hivemind.definition.ImplementationDefinition;
+import org.apache.hivemind.definition.RegistryDefinition;
+import org.apache.hivemind.definition.impl.ModuleDefinitionImpl;
import org.apache.hivemind.definition.impl.RegistryDefinitionImpl;
import org.apache.hivemind.definition.impl.ServiceImplementationDefinitionImpl;
import org.apache.hivemind.definition.impl.ServicePointDefinitionImpl;
@@ -127,7 +127,7 @@
{
RegistryDefinition definition = new RegistryDefinitionImpl();
- ModuleDefinition module = createModuleDefinition("hivemind.tests.serviceByInterface");
+ ModuleDefinitionImpl module = createModuleDefinition("hivemind.tests.serviceByInterface");
definition.addModule(module);
ServicePointDefinitionImpl sp1 = createServicePointDefinition(module, "BeanInterface", BeanInterface.class);
Modified: hivemind/hivemind2/trunk/xml/src/java/org/apache/hivemind/impl/XmlCoreServicesProvider.java
URL: http://svn.apache.org/viewvc/hivemind/hivemind2/trunk/xml/src/java/org/apache/hivemind/impl/XmlCoreServicesProvider.java?view=diff&rev=504455&r1=504454&r2=504455
==============================================================================
--- hivemind/hivemind2/trunk/xml/src/java/org/apache/hivemind/impl/XmlCoreServicesProvider.java (original)
+++ hivemind/hivemind2/trunk/xml/src/java/org/apache/hivemind/impl/XmlCoreServicesProvider.java Tue Feb 6 23:43:11 2007
@@ -20,6 +20,7 @@
import org.apache.hivemind.definition.ModuleDefinitionHelper;
import org.apache.hivemind.definition.RegistryDefinition;
import org.apache.hivemind.definition.ServicePointDefinition;
+import org.apache.hivemind.definition.impl.ModuleDefinitionImpl;
import org.apache.hivemind.internal.AbstractServiceImplementationConstructor;
import org.apache.hivemind.internal.ServiceModel;
@@ -41,7 +42,8 @@
// The "hivemind" module is available here only if the HivemoduleProvider
// has been executed before. This order is defined in the MANIFEST.MF file of the xml module
- ModuleDefinition moduleDefinition = registryDefinition.getModule("hivemind");
+ // The cast is safe since the module is defined in the core.
+ ModuleDefinitionImpl moduleDefinition = (ModuleDefinitionImpl) registryDefinition.getModule("hivemind");
if (moduleDefinition == null) {
throw new ApplicationRuntimeException("Module 'hivemind' not found.");
}
Modified: hivemind/hivemind2/trunk/xml/src/java/org/apache/hivemind/impl/XmlModuleDescriptorProcessor.java
URL: http://svn.apache.org/viewvc/hivemind/hivemind2/trunk/xml/src/java/org/apache/hivemind/impl/XmlModuleDescriptorProcessor.java?view=diff&rev=504455&r1=504454&r2=504455
==============================================================================
--- hivemind/hivemind2/trunk/xml/src/java/org/apache/hivemind/impl/XmlModuleDescriptorProcessor.java (original)
+++ hivemind/hivemind2/trunk/xml/src/java/org/apache/hivemind/impl/XmlModuleDescriptorProcessor.java Tue Feb 6 23:43:11 2007
@@ -15,11 +15,11 @@
import org.apache.hivemind.conditional.Parser;
import org.apache.hivemind.definition.ConfigurationParserDefinition;
import org.apache.hivemind.definition.ImplementationDefinition;
-import org.apache.hivemind.definition.ModuleDefinition;
import org.apache.hivemind.definition.RegistryDefinition;
import org.apache.hivemind.definition.impl.ConfigurationParserDefinitionImpl;
import org.apache.hivemind.definition.impl.ConfigurationPointDefinitionImpl;
import org.apache.hivemind.definition.impl.ContributionDefinitionImpl;
+import org.apache.hivemind.definition.impl.ModuleDefinitionImpl;
import org.apache.hivemind.definition.impl.ServiceImplementationDefinitionImpl;
import org.apache.hivemind.definition.impl.ServiceInterceptorDefinitionImpl;
import org.apache.hivemind.definition.impl.ServicePointDefinitionImpl;
@@ -105,7 +105,7 @@
/**
* Adds all module dependencies to the module definition.
*/
- private void addDependencies(ModuleDefinition module, ModuleDescriptor md)
+ private void addDependencies(ModuleDefinitionImpl module, ModuleDescriptor md)
{
int count = size(md.getDependencies());
for (int i = 0; i < count; i++)
@@ -180,7 +180,7 @@
/**
* Adds all service implementations to the module definition.
*/
- private void addImplementations(ModuleDefinition module, ModuleDescriptor md)
+ private void addImplementations(ModuleDefinitionImpl module, ModuleDescriptor md)
{
String moduleId = md.getModuleId();
@@ -206,7 +206,7 @@
/**
* Adds one implementation and its interceptors to a module definition.
*/
- private void addImplementationAndInterceptors(ModuleDefinition sourceModule, String qualifiedPointId, ImplementationDescriptor id)
+ private void addImplementationAndInterceptors(ModuleDefinitionImpl sourceModule, String qualifiedPointId, ImplementationDescriptor id)
{
InstanceBuilder builder = id.getInstanceBuilder();
List interceptors = id.getInterceptors();
@@ -231,7 +231,7 @@
* Adds internal service contributions; the contributions provided inplace with the service
* definition.
*/
- private void addInternalImplementations(ModuleDefinition module, ServicePointDefinitionImpl point,
+ private void addInternalImplementations(ModuleDefinitionImpl module, ServicePointDefinitionImpl point,
ServicePointDescriptor spd)
{
InstanceBuilder builder = spd.getInstanceBuilder();
@@ -306,7 +306,7 @@
/**
* Adds all contributions to a module definition.
*/
- private void addContributions(ModuleDefinition module, ModuleDescriptor md)
+ private void addContributions(ModuleDefinitionImpl module, ModuleDescriptor md)
{
String moduleId = md.getModuleId();
@@ -333,7 +333,7 @@
/**
* Adds all interceptors to a module definition.
*/
- private void addInterceptor(ModuleDefinition module, String qualifiedPointId, InterceptorDescriptor id)
+ private void addInterceptor(ModuleDefinitionImpl module, String qualifiedPointId, InterceptorDescriptor id)
{
if (_log.isDebugEnabled())
_log.debug("Adding " + id + " to service extension point " + qualifiedPointId);
@@ -359,7 +359,7 @@
* of the expression (used if an error is reported)
*/
- private boolean includeContribution(String expression, ModuleDefinition module, Location location)
+ private boolean includeContribution(String expression, ModuleDefinitionImpl module, Location location)
{
if (expression == null)
return true;