hivemind-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahue...@apache.org
Subject svn commit: r419908 - in /hivemind/branches/branch-2-0-annot: ./ framework/src/java/org/apache/hivemind/ framework/src/java/org/apache/hivemind/definition/ framework/src/java/org/apache/hivemind/impl/ framework/src/java/org/apache/hivemind/internal/ xm...
Date Fri, 07 Jul 2006 15:26:10 GMT
Author: ahuegen
Date: Fri Jul  7 08:26:09 2006
New Revision: 419908

URL: http://svn.apache.org/viewvc?rev=419908&view=rev
Log:
Moved messages to the right place.
Core services are defined manually.

Added:
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/DefinitionMessages.java
      - copied, changed from r419477, hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ImplMessages.java
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/DefinitionStrings.properties
      - copied, changed from r419477, hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ImplStrings.properties
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/CoreServicesProvider.java
    hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/service/TestBuilderFactory.java   (contents, props changed)
      - copied, changed from r419546, hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/service/TestBuilderFactory.java
Removed:
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ImplMessages.java
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ImplStrings.properties
    hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/service/TestBuilderFactory.java
Modified:
    hivemind/branches/branch-2-0-annot/.classpath
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/HiveMind.java
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/RegistryDefinition.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/ImplStrings.properties
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/RegistryBuilder.java
    hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ServiceModel.java
    hivemind/branches/branch-2-0-annot/xml/src/descriptor/META-INF/hivemodule.xml
    hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/InvokeFactoryServiceConstructor.java
    hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/SchemaElement.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/TranslatorManagerImpl.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/XmlImplStrings.properties
    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/impl/XmlRegistryProvider.java
    hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/impl/TestInvokeFactoryServiceConstructor.java

Modified: hivemind/branches/branch-2-0-annot/.classpath
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/.classpath?rev=419908&r1=419907&r2=419908&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/.classpath (original)
+++ hivemind/branches/branch-2-0-annot/.classpath Fri Jul  7 08:26:09 2006
@@ -33,7 +33,7 @@
 	<classpathentry kind="var" path="M2_REPO/oro/oro/2.0.8/oro-2.0.8.jar"/>
 	<classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.3/servlet-api-2.3.jar"/>
 	<classpathentry kind="var" path="M2_REPO/org/springframework/spring-full/1.0.1/spring-full-1.0.1.jar"/>
-	<classpathentry excluding="org/" output="xml/target/eclipse-classes" kind="src" path="xml/src/java"/>
+	<classpathentry output="xml/target/eclipse-classes" kind="src" path="xml/src/java"/>
 	<classpathentry output="xml/target/eclipse-classes" kind="src" path="xml/src/descriptor"/>
 	<classpathentry output="xml/target/eclipse-test-classes" kind="src" path="xml/src/test"/>
 	<classpathentry kind="output" path="bin"/>

Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/HiveMind.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/HiveMind.java?rev=419908&r1=419907&r2=419908&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/HiveMind.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/HiveMind.java Fri Jul  7 08:26:09 2006
@@ -16,6 +16,9 @@
 
 import java.util.Collection;
 
+import org.apache.hivemind.impl.LocationImpl;
+import org.apache.hivemind.util.ClasspathResource;
+
 /**
  * Static utility class for HiveMind.
  * 
@@ -122,6 +125,15 @@
         return HiveMindMessages.unknownLocation();
     }
 
+    public static Location getClassLocation(Class theClass, ClassResolver classResolver)
+    {
+        String path = "/" + theClass.getName().replace('.', '/');
+
+        Resource r = new ClasspathResource(classResolver, path);
+
+        return new LocationImpl(r);
+    }
+    
     /**
      * Returns true if the string is null, empty, or contains only whitespace.
      * <p>

Copied: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/DefinitionMessages.java (from r419477, hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ImplMessages.java)
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/DefinitionMessages.java?p2=hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/DefinitionMessages.java&p1=hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ImplMessages.java&r1=419477&r2=419908&rev=419908&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ImplMessages.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/DefinitionMessages.java Fri Jul  7 08:26:09 2006
@@ -14,123 +14,21 @@
 
 package org.apache.hivemind.definition;
 
-import java.net.URL;
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.apache.hivemind.ClassResolver;
-import org.apache.hivemind.Element;
-import org.apache.hivemind.HiveMind;
 import org.apache.hivemind.Location;
 import org.apache.hivemind.Occurances;
-import org.apache.hivemind.Resource;
-import org.apache.hivemind.events.RegistryShutdownListener;
 import org.apache.hivemind.impl.MessageFormatter;
-import org.apache.hivemind.impl.ServicePointImpl;
-import org.apache.hivemind.impl.TranslatorContribution;
-import org.apache.hivemind.internal.ConfigurationPoint;
-import org.apache.hivemind.internal.ExtensionPoint;
-import org.apache.hivemind.internal.Module;
-import org.apache.hivemind.internal.ServiceInterceptorContribution;
-import org.apache.hivemind.internal.ServicePoint;
-import org.apache.hivemind.schema.SchemaProcessor;
 import org.apache.hivemind.util.IdUtils;
 
 /**
- * Used to format messages used in errors and log output for classes within the impl package.
+ * Used to format messages used in errors and log output for classes within the definition package.
  * 
- * @author Howard Lewis Ship
+ * @author Achim Huegen
  */
-class ImplMessages
+class DefinitionMessages
 {
-    private static final MessageFormatter _formatter = new MessageFormatter(ImplMessages.class,
-            "ImplStrings");
-
-    static String recursiveServiceBuild(ServicePoint point)
-    {
-        return _formatter.format("recursive-service-build", point.getExtensionPointId());
-    }
-
-    static String recursiveConfiguration(String pointId)
-    {
-        return _formatter.format("recursive-configuration", pointId);
-    }
-
-    static String unableToConstructConfiguration(String pointId, Throwable exception)
-    {
-        return _formatter.format("unable-to-construct-configuration", pointId, exception
-                .getMessage());
-    }
-
-    static String unknownServiceModel(String name)
-    {
-        return _formatter.format("unknown-service-model", name);
-    }
-
-    static String unknownTranslatorName(String name, String configurationId)
-    {
-        return _formatter.format("unknown-translator-name", name, configurationId);
-    }
-
-    static String duplicateTranslatorName(String name, Location oldLocation)
-    {
-        return _formatter.format("duplicate-translator-name", name, HiveMind
-                .getLocationString(oldLocation));
-    }
-
-    static String translatorInstantiationFailure(Class translatorClass, Throwable cause)
-    {
-        return _formatter.format(
-                "translator-instantiation-failure",
-                translatorClass.getName(),
-                cause);
-    }
-
-    static String unqualifiedServicePoint( String serviceId, String matchingIds )
-    {
-        return _formatter.format( "unqualified-service-point", serviceId, matchingIds );
-    }
+    private static final MessageFormatter _formatter = new MessageFormatter(DefinitionMessages.class,
+            "DefinitionStrings");
     
-    static String noSuchServicePoint(String serviceId)
-    {
-        return _formatter.format("no-such-service-point", serviceId);
-    }
-
-    static String unableToLoadClass(String name, ClassLoader loader, Throwable cause)
-    {
-        return _formatter.format("unable-to-load-class", name, loader, cause);
-    }
-
-    static String nullInterceptor(ServiceInterceptorContribution contribution,
-            ServicePoint point)
-    {
-        return _formatter.format("null-interceptor", contribution.getFactoryServiceId(), point
-                .getExtensionPointId());
-    }
-
-    static String interceptorDoesNotImplementInterface(Object interceptor,
-            ServiceInterceptorContribution contribution, ServicePoint point, Class serviceInterface)
-    {
-        return _formatter.format("interceptor-does-not-implement-interface", new Object[]
-        { interceptor, contribution.getFactoryServiceId(), point.getExtensionPointId(),
-                serviceInterface.getName() });
-    }
-
-    static String unableToReadMessages(URL url)
-    {
-        return _formatter.format("unable-to-read-messages", url);
-    }
-
-    static String unableToParse(Resource resource, Throwable cause)
-    {
-        return _formatter.format("unable-to-parse", resource, cause);
-    }
-
-    static String unableToFindModules(ClassResolver resolver, Throwable cause)
-    {
-        return _formatter.format("unable-to-find-modules", resolver, cause);
-    }
-
     static String duplicateModuleId(String moduleId, Location locationOfExisting,
             Location locationOfDuplicate)
     {
@@ -141,37 +39,6 @@
                 locationOfDuplicate.getResource());
     }
 
-    static String duplicateExtensionPointId(String pointId, ExtensionPoint existingPoint)
-    {
-        return _formatter.format("duplicate-extension-point", pointId, existingPoint.getLocation());
-    }
-
-    static String unknownConfigurationPoint(String moduleId,
-            String configurationId)
-    {
-        return _formatter.format("unknown-configuration-extension-point", moduleId, configurationId);
-    }
-
-    static String unknownServicePoint(String moduleId, String pointId)
-    {
-        return _formatter.format(
-                "unknown-service-extension-point",
-                moduleId,
-                pointId);
-    }
-
-    static String missingService(ServicePoint point)
-    {
-        return _formatter.format("missing-service", point.getExtensionPointId());
-    }
-
-    static String duplicateFactory(Module sourceModule, String pointId,
-            ServicePointImpl existing)
-    {
-        return _formatter.format("duplicate-factory", sourceModule.getModuleId(), pointId, existing
-                .getServiceConstructor().getContributingModuleId());
-    }
-
     static String wrongNumberOfContributions(ModuleDefinition definingModule, ConfigurationPointDefinition point, int actualCount,
             Occurances expectation)
     {
@@ -183,217 +50,33 @@
                 occurances(expectation));
     }
 
-    static String occurances(Occurances occurances)
-    {
-        return _formatter.getMessage("occurances." + occurances.getName());
-    }
-
     static String contributionCount(int count)
     {
         return _formatter.format("contribution-count", new Integer(count));
     }
 
-    static String wrongNumberOfParameters(String factoryServiceId, int actualCount,
-            Occurances expectation)
-    {
-        return _formatter.format(
-                "wrong-number-of-parameters",
-                factoryServiceId,
-                contributionCount(actualCount),
-                occurances(expectation));
-
-    }
-
-    static String noSuchConfiguration(String pointId)
-    {
-        return _formatter.format("no-such-configuration", pointId);
-    }
-
-    static String noSuchSymbol(String name)
-    {
-        return _formatter.format("no-such-symbol", name);
-    }
-
-    static String symbolSourceContribution()
-    {
-        return _formatter.getMessage("symbol-source-contribution");
-    }
-
-    static String unknownAttribute(String name)
-    {
-        return _formatter.format("unknown-attribute", name);
-    }
-
-    static String missingAttribute(String name)
-    {
-        return _formatter.format("missing-attribute", name);
-    }
-
-    static String uniqueAttributeConstraintBroken(String name, String value,
-            Location priorLocation)
-    {
-        return _formatter.format("unique-attribute-constraint-broken", name, value, priorLocation);
-    }
-
-    static String elementErrors(SchemaProcessor processor, Element element)
-    {
-        return _formatter.format("element-errors", processor.getElementPath(), element
-                .getLocation());
-    }
-
-    static String unknownElement(SchemaProcessor processor, Element element)
-    {
-        return _formatter.format("unknown-element", processor.getElementPath());
-    }
-
-    static String badInterface(String interfaceName, String pointId)
-    {
-        return _formatter.format("bad-interface", interfaceName, pointId);
-    }
-
-    static String serviceWrongInterface(ServicePoint servicePoint, Class requestedInterface)
-    {
-        return _formatter.format(
-                "service-wrong-interface",
-                servicePoint.getExtensionPointId(),
-                requestedInterface.getName(),
-                servicePoint.getServiceInterface().getName());
-    }
-
-    static String shutdownCoordinatorFailure(RegistryShutdownListener listener,
-            Throwable cause)
-    {
-        return _formatter.format("shutdown-coordinator-failure", listener, cause);
-    }
-
-    static String unlocatedError(String message)
-    {
-        return _formatter.format("unlocated-error", message);
-    }
-
-    static String locatedError(Location location, String message)
-    {
-        return _formatter.format("located-error", location, message);
-    }
-
-    static String interceptorContribution()
-    {
-        return _formatter.getMessage("interceptor-contribution");
-    }
-
-    static String registryAlreadyStarted()
-    {
-        return _formatter.getMessage("registry-already-started");
-    }
-
-    static String noServicePointForInterface(Class interfaceClass)
-    {
-        return _formatter.format("no-service-point-for-interface", interfaceClass.getName());
-    }
-
-    static String multipleServicePointsForInterface(Class interfaceClass,
-            Collection matchingPoints)
-    {
-        StringBuffer buffer = new StringBuffer("{");
-
-        boolean following = false;
-
-        Iterator i = matchingPoints.iterator();
-        while (i.hasNext())
-        {
-            if (following)
-                buffer.append(", ");
-
-            ServicePoint p = (ServicePoint) i.next();
-
-            buffer.append(p.getExtensionPointId());
-
-            following = true;
-        }
-
-        buffer.append("}");
-
-        return _formatter.format(
-                "multiple-service-points-for-interface",
-                interfaceClass.getName(),
-                buffer);
-    }
-
-    static String incompleteTranslator(TranslatorContribution c)
-    {
-        return _formatter.format("incomplete-translator", c.getName());
-    }
-
-    static String schemaStackViolation(SchemaProcessor processor)
-    {
-        return _formatter.format("schema-stack-violation", processor.getElementPath());
-    }
-
-    static String subModuleDoesNotExist(Resource subModuleDescriptor)
+    static String occurances(Occurances occurances)
     {
-        return _formatter.format("sub-module-does-not-exist", subModuleDescriptor);
+        return _formatter.getMessage("occurances." + occurances.getName());
     }
 
     static String dependencyOnUnknownModule(String toModuleId)
     {
         return _formatter.format("dependency-on-unknown-module", toModuleId);
     }
-
-    private static String convertModule(Module module)
-    {
-        if (module == null)
-            return _formatter.getMessage("null-module");
-
-        return _formatter.format("module", module.getModuleId());
-    }
-
-    static String unableToResolveSchema(String schemaId)
-    {
-        return _formatter.format("unable-to-resolve-schema", schemaId);
-    }
-
-    static String schemaNotVisible(String schemaId, String moduleId)
-    {
-        return _formatter.format("schema-not-visible", schemaId, moduleId);
-    }
-
-    static String serviceNotVisible(String serviceId, Module module)
-    {
-        return _formatter.format("service-not-visible", serviceId, convertModule(module));
-    }
-
-    static String configurationNotVisible(String configurationId, Module module)
-    {
-        return _formatter.format(
-                "configuration-not-visible",
-                configurationId,
-                convertModule(module));
-    }
-
-    static String configurationPointNotVisible(ConfigurationPoint point,
-            Module contributingModule)
+    
+    static String unknownConfigurationPoint(String moduleId,
+            String configurationId)
     {
-        return _formatter.format(
-                "configuration-point-not-visible",
-                point.getExtensionPointId(),
-                contributingModule.getModuleId());
+        return _formatter.format("unknown-configuration-extension-point", moduleId, configurationId);
     }
 
-    static String servicePointNotVisible(ServicePoint point, Module contributingModule)
+    static String unknownServicePoint(String moduleId, String pointId)
     {
         return _formatter.format(
-                "service-point-not-visible",
-                point.getExtensionPointId(),
-                contributingModule.getModuleId());
-    }
-
-    static String unableToMapConfiguration(ConfigurationPoint point)
-    {
-        return _formatter.format("unable-to-map-configuration", point.getExtensionPointId());
+                "unknown-service-extension-point",
+                moduleId,
+                pointId);
     }
 
-    static String unableToConvertType(String type, String packageName)
-    {
-        return _formatter.format("unable-to-convert-type", type, packageName);
-    }
 }

Copied: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/DefinitionStrings.properties (from r419477, hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ImplStrings.properties)
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/DefinitionStrings.properties?p2=hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/DefinitionStrings.properties&p1=hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ImplStrings.properties&r1=419477&r2=419908&rev=419908&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/ImplStrings.properties (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/DefinitionStrings.properties Fri Jul  7 08:26:09 2006
@@ -12,30 +12,9 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-recursive-service-build=A recursive call to construct service {0} has occured.  This indicates a cycle between one or more services or configurations.
-recursive-configuration=A recursive call to construct configuration {0} has occured.  This indicates a cycle between one or more configurations or services.
-unable-to-construct-configuration=Unable to construct configuration {0}: {1}
-unknown-service-model=Service model ''{0}'' is not defined.
-unknown-translator-name=No translator named ''{0}'' has been registered in configuration point {1}.
-duplicate-translator-name=Translator ''{0}'' duplicates a previous definition at {1} and has been ignored.
-translator-instantiation-failure=Unable to instantiate translator class {0}: {1}
-registry-shutdown=The HiveMind Registry has been shutdown.
-no-such-service-point=Service point {0} does not exist.
-unqualified-service-point=The service id specified ("{0}") is not fully qualified.  Perhaps you meant one of {1}.
-no-service-point-for-interface=There is no service point for interface {0}.
-multiple-service-points-for-interface=There are multiple service points for interface {0}: {1}.
-unable-to-load-class=Could not load class {0} from {1}: {2}
-null-interceptor=Service {0} generated a null interceptor (for service point {1}).
-interceptor-does-not-implement-interface=The service interceptor ({0}) generated by service {1} for service point {2} does not implement the {3} interface defined by the service point.
-unable-to-read-messages=Unable to read message properties from {0}.
-unable-to-parse=Unable to parse module deployment descriptor {0}: {1}
-unable-to-find-modules=Unable to locate HiveMind module deployment descriptors in {0}: {1}
 duplicate-module-id=Module {0} is duplicated!  Definition in {2} has been ignored in favor of existing definition from {1}.
-duplicate-extension-point=Extension point {0} conflicts with definition at {1} and has been ignored.
 unknown-configuration-extension-point=Module {0} has contributed to unknown configuration point {1}. The contribution has been ignored.
 unknown-service-extension-point=Module {0} contributed to unknown service point {1}. The contribution has been ignored.
-missing-service=No module has contributed a service constructor for service point {0}.
-duplicate-factory=Module {0} has contributed a instance builder to service point {1}, which conflicts with an existing contribution by module {2}. The duplicate contribution has been ignored.  
 
 occurances.NONE=no contributions
 occurances.OPTIONAL=an optional contribution
@@ -45,43 +24,6 @@
 contribution-count={0,choice,0#no contributions|1#one contribution|1<{0,number,integer} contributions}
 
 wrong-number-of-contributions=Configuration point {0} contains {1} but expects {2}.
-wrong-number-of-parameters=Parameters to service implementation factory {0} contains {1} but expects {2}.
-
-no-such-configuration=Configuration point {0} does not exist.
-no-such-symbol=No value available for symbol ''{0}''.
-symbol-source-contribution=symbol source
-unknown-attribute=Attribute ''{0}'' is not defined in the schema.
-missing-attribute=Attribute ''{0}'' is required but no value was provided.
-unique-attribute-constraint-broken=Value for attribute ''{0}'' (''{1}'') duplicates a prior instance at {2}.
-element-errors=Element {0} (at {1}) contains errors:
-unknown-element=Element {0} is not allowed here.
-bad-interface=Unable to find interface {0} (for service {1}).
-service-wrong-interface=Service {0} does not implement the requested interface ({1}).  The declared service interface type is {2}.
-shutdown-coordinator-failure=Unable to shutdown {0}: {1}
-sub-module-does-not-exist=Sub-module {0} does not exist.
 
 dependency-on-unknown-module=Required module {0} does not exist.
 
-unlocated-error=Error: {0}
-located-error=Error at {0}: {1}
-
-interceptor-contribution=interceptor contribution
-registry-already-started=The HiveMind Registry has already been started.
-
-incomplete-translator=Translator contribution ''{0}'' must specify either the service-id or class attribute.
-
-schema-stack-violation=The rules for processing element {0} have incorrectly manipulated the schema processor object stack.
-
-null-module=the application
-module=module {0}
-
-unable-to-resolve-schema=Unable to resolve reference to schema ''{0}''.
-schema-not-visible=Schema ''{0}'' is not visible to module {1}.
-service-not-visible=Service point {0} is not visible to {1}.
-configuration-not-visible=Configuration point {0} is not visible to {1}.
-
-configuration-point-not-visible=Configuration point {0} is not visible to module {1}.
-service-point-not-visible=Service point {0} is not visible to module {1}.
-
-unable-to-map-configuration=Unable to map the contributions to configuration point {0}. All top-level schema elements must define a key attribute.
-unable-to-convert-type=Unable to convert type ''{0}'' to a Java class, either as is, or in package {1}.
\ No newline at end of file

Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/RegistryDefinition.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/RegistryDefinition.java?rev=419908&r1=419907&r2=419908&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/RegistryDefinition.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/definition/RegistryDefinition.java Fri Jul  7 08:26:09 2006
@@ -51,7 +51,7 @@
         {
             ModuleDefinition existing = (ModuleDefinition) _modules.get(module.getId());
 
-            _errorHandler.error(LOG, ImplMessages.duplicateModuleId(module.getId(), existing
+            _errorHandler.error(LOG, DefinitionMessages.duplicateModuleId(module.getId(), existing
                     .getLocation(), module.getLocation()), null, null);
 
         }
@@ -197,7 +197,7 @@
             {
                 _errorHandler.error(
                         LOG,
-                        ImplMessages.unknownServicePoint(
+                        DefinitionMessages.unknownServicePoint(
                                 IdUtils.extractModule(servicePointId),
                                 IdUtils.stripModule(servicePointId)),
                         unresolved.getExtension().getLocation(),
@@ -220,7 +220,7 @@
             {
                 _errorHandler.error(
                         LOG,
-                        ImplMessages.unknownServicePoint(
+                        DefinitionMessages.unknownServicePoint(
                                 IdUtils.extractModule(servicePointId),
                                 IdUtils.stripModule(servicePointId)),
                         unresolved.getExtension().getLocation(),
@@ -243,7 +243,7 @@
             {
                 _errorHandler.error(
                         LOG,
-                        ImplMessages.unknownConfigurationPoint(
+                        DefinitionMessages.unknownConfigurationPoint(
                                 IdUtils.extractModule(configurationPointId),
                                 IdUtils.stripModule(configurationPointId)),
                         unresolved.getExtension().getLocation(),
@@ -278,7 +278,7 @@
             // TODO annotation: Location in Dependencies aufnehmen
             _errorHandler.error(
                     LOG,
-                    ImplMessages.dependencyOnUnknownModule(requiredModuleId),
+                    DefinitionMessages.dependencyOnUnknownModule(requiredModuleId),
                     null,
                     null);
             return;
@@ -311,7 +311,7 @@
         if (expected.inRange(actual))
             return;
 
-        _errorHandler.error(LOG, ImplMessages.wrongNumberOfContributions(
+        _errorHandler.error(LOG, DefinitionMessages.wrongNumberOfContributions(
                 definingModule, configurationPoint,
                 actual,
                 expected), configurationPoint.getLocation(), null);

Added: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/CoreServicesProvider.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/CoreServicesProvider.java?rev=419908&view=auto
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/CoreServicesProvider.java (added)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/CoreServicesProvider.java Fri Jul  7 08:26:09 2006
@@ -0,0 +1,124 @@
+package org.apache.hivemind.impl;
+
+import org.apache.hivemind.ErrorHandler;
+import org.apache.hivemind.HiveMind;
+import org.apache.hivemind.definition.ModuleDefinition;
+import org.apache.hivemind.definition.RegistryDefinition;
+import org.apache.hivemind.definition.ServiceImplementationDefinition;
+import org.apache.hivemind.definition.ServicePointDefinition;
+import org.apache.hivemind.internal.ServiceModel;
+import org.apache.hivemind.internal.Visibility;
+import org.apache.hivemind.service.ClassFactory;
+import org.apache.hivemind.service.ThreadEventNotifier;
+import org.apache.hivemind.service.ThreadLocalStorage;
+import org.apache.hivemind.service.impl.ClassFactoryImpl;
+import org.apache.hivemind.service.impl.ThreadEventNotifierImpl;
+import org.apache.hivemind.service.impl.ThreadLocalStorageImpl;
+
+/**
+ * Loads the core HiveMind services into a registry definition.
+ * 
+ * @author Achim Huegen
+ */
+public class CoreServicesProvider implements RegistryProvider
+{
+
+    public void process(RegistryDefinition registryDefinition, ErrorHandler errorHandler)
+
+    {
+        DefaultClassResolver resolver = new DefaultClassResolver();
+
+        // Don't do this at home: For the sake of backward compatibility add the core
+        // to an existing module that may have been created by the XmlRegistryProvider
+
+        ModuleDefinition md = registryDefinition.getModule("hivemind");
+        if (md == null)
+        {
+            md = new ModuleDefinition("hivemind", HiveMind.getClassLocation(getClass(), resolver),
+                    resolver, null);
+            registryDefinition.addModule(md);
+        }
+
+        addClassFactory(md);
+
+        addThreadEventNotifier(md);
+
+        addThreadLocalStorage(md);
+
+    }
+
+    /**
+     * Wrapper around Javassist used to dynamically create classes such as service interceptors.
+     */
+    private void addClassFactory(ModuleDefinition md)
+    {
+        ServicePointDefinition spd = addServicePoint(md, "ClassFactory", ClassFactory.class);
+        addServiceImplementation(md, spd, ClassFactoryImpl.class, ServiceModel.PRITIMIVE);
+    }
+
+    /**
+     * Service used by other services to be alerted when a thread is cleaned up (typically, at the
+     * end of a request or transaction).
+     */
+    private void addThreadEventNotifier(ModuleDefinition md)
+    {
+        ServicePointDefinition spd = addServicePoint(
+                md,
+                "ThreadEventNotifier",
+                ThreadEventNotifier.class);
+        addServiceImplementation(md, spd, ThreadEventNotifierImpl.class, ServiceModel.SINGLETON);
+    }
+
+    /**
+     * Service which manages a thread-local map of data items. This can be used for temporary
+     * storage of information when local variables can't be used. All stored items are released when
+     * the thread is cleaned up. Note: this service should be considered deprecated; use the
+     * threaded service model instead.
+     */
+    private void addThreadLocalStorage(ModuleDefinition md)
+    {
+        ServicePointDefinition spd = addServicePoint(
+                md,
+                "ThreadLocalStorage",
+                ThreadLocalStorage.class);
+        addServiceImplementation(md, spd, ThreadLocalStorageImpl.class, ServiceModel.THREADED);
+    }
+
+    /**
+     * Stores the locale for the current thread. The default is determined when the Registry is
+     * first constructed. This locale is used for any messages.
+     */
+    // private void addThreadLocale(ModuleDefinition md)
+    // {
+    // ServicePointDefinition spd = addServicePoint(
+    // md,
+    // "ThreadLocale",
+    // ThreadLocale.class);
+    //        
+    // ServiceImplementationDefinition sid = new ServiceImplementationDefinition(null,
+    // new CreateClassServiceConstructor(module.getId(), serviceImplementationClass
+    // .getName()), serviceModel, true);
+    // servicePoint.addImplementation(result);
+    // }
+    public static ServicePointDefinition addServicePoint(ModuleDefinition module,
+            String servicePointId, Class serviceInterface)
+    {
+        ServicePointDefinition result = new ServicePointDefinition(servicePointId, module
+                .getLocation(), Visibility.PUBLIC, serviceInterface.getName());
+
+        module.addServicePoint(result);
+        return result;
+    }
+
+    public static ServiceImplementationDefinition addServiceImplementation(ModuleDefinition module,
+            ServicePointDefinition servicePoint, Class serviceImplementationClass,
+            String serviceModel)
+    {
+        ServiceImplementationDefinition result = new ServiceImplementationDefinition(module
+                .getLocation(), new CreateClassServiceConstructor(module.getId(),
+                serviceImplementationClass.getName()), serviceModel, true);
+        servicePoint.addImplementation(result);
+        return result;
+    }
+
+}

Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ImplMessages.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ImplMessages.java?rev=419908&r1=419907&r2=419908&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ImplMessages.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ImplMessages.java Fri Jul  7 08:26:09 2006
@@ -19,10 +19,7 @@
 import java.util.Iterator;
 
 import org.apache.hivemind.ClassResolver;
-import org.apache.hivemind.Element;
-import org.apache.hivemind.HiveMind;
 import org.apache.hivemind.Location;
-import org.apache.hivemind.Occurances;
 import org.apache.hivemind.Resource;
 import org.apache.hivemind.events.RegistryShutdownListener;
 import org.apache.hivemind.internal.ConfigurationPoint;
@@ -30,8 +27,6 @@
 import org.apache.hivemind.internal.Module;
 import org.apache.hivemind.internal.ServiceInterceptorConstructor;
 import org.apache.hivemind.internal.ServicePoint;
-import org.apache.hivemind.parse.ContributionDescriptor;
-import org.apache.hivemind.schema.SchemaProcessor;
 
 /**
  * Used to format messages used in errors and log output for classes within the impl package.
@@ -64,25 +59,6 @@
         return _formatter.format("unknown-service-model", name);
     }
 
-    static String unknownTranslatorName(String name, String configurationId)
-    {
-        return _formatter.format("unknown-translator-name", name, configurationId);
-    }
-
-    static String duplicateTranslatorName(String name, Location oldLocation)
-    {
-        return _formatter.format("duplicate-translator-name", name, HiveMind
-                .getLocationString(oldLocation));
-    }
-
-    static String translatorInstantiationFailure(Class translatorClass, Throwable cause)
-    {
-        return _formatter.format(
-                "translator-instantiation-failure",
-                translatorClass.getName(),
-                cause);
-    }
-
     static String unqualifiedServicePoint( String serviceId, String matchingIds )
     {
         return _formatter.format( "unqualified-service-point", serviceId, matchingIds );
@@ -123,11 +99,6 @@
         return _formatter.format("unable-to-parse", resource, cause);
     }
 
-    static String unableToFindModules(ClassResolver resolver, Throwable cause)
-    {
-        return _formatter.format("unable-to-find-modules", resolver, cause);
-    }
-    
     static String unableToFindProviders(ClassResolver resolver, Throwable cause)
     {
         return _formatter.format("unable-to-find-providers", resolver, cause);
@@ -153,21 +124,6 @@
         return _formatter.format("duplicate-extension-point", pointId, existingPoint.getLocation());
     }
 
-    static String unknownConfigurationPoint(String moduleId,
-            ContributionDescriptor descriptor)
-    {
-        return _formatter.format("unknown-configuration-extension-point", moduleId, descriptor
-                .getConfigurationId());
-    }
-
-    static String unknownServicePoint(Module sourceModule, String pointId)
-    {
-        return _formatter.format(
-                "unknown-service-extension-point",
-                sourceModule.getModuleId(),
-                pointId);
-    }
-
     static String missingService(ServicePoint point)
     {
         return _formatter.format("missing-service", point.getExtensionPointId());
@@ -180,37 +136,6 @@
                 .getServiceConstructor().getContributingModuleId());
     }
 
-    static String wrongNumberOfContributions(ConfigurationPoint point, int actualCount,
-            Occurances expectation)
-    {
-        return _formatter.format(
-                "wrong-number-of-contributions",
-                point.getExtensionPointId(),
-                contributionCount(actualCount),
-                occurances(expectation));
-    }
-
-    static String occurances(Occurances occurances)
-    {
-        return _formatter.getMessage("occurances." + occurances.getName());
-    }
-
-    static String contributionCount(int count)
-    {
-        return _formatter.format("contribution-count", new Integer(count));
-    }
-
-    static String wrongNumberOfParameters(String factoryServiceId, int actualCount,
-            Occurances expectation)
-    {
-        return _formatter.format(
-                "wrong-number-of-parameters",
-                factoryServiceId,
-                contributionCount(actualCount),
-                occurances(expectation));
-
-    }
-
     static String noSuchConfiguration(String pointId)
     {
         return _formatter.format("no-such-configuration", pointId);
@@ -226,33 +151,6 @@
         return _formatter.getMessage("symbol-source-contribution");
     }
 
-    static String unknownAttribute(String name)
-    {
-        return _formatter.format("unknown-attribute", name);
-    }
-
-    static String missingAttribute(String name)
-    {
-        return _formatter.format("missing-attribute", name);
-    }
-
-    static String uniqueAttributeConstraintBroken(String name, String value,
-            Location priorLocation)
-    {
-        return _formatter.format("unique-attribute-constraint-broken", name, value, priorLocation);
-    }
-
-    static String elementErrors(SchemaProcessor processor, Element element)
-    {
-        return _formatter.format("element-errors", processor.getElementPath(), element
-                .getLocation());
-    }
-
-    static String unknownElement(SchemaProcessor processor, Element element)
-    {
-        return _formatter.format("unknown-element", processor.getElementPath());
-    }
-
     static String badInterface(String interfaceName, String pointId)
     {
         return _formatter.format("bad-interface", interfaceName, pointId);
@@ -324,26 +222,6 @@
                 "multiple-service-points-for-interface",
                 interfaceClass.getName(),
                 buffer);
-    }
-
-    static String incompleteTranslator(TranslatorContribution c)
-    {
-        return _formatter.format("incomplete-translator", c.getName());
-    }
-
-    static String schemaStackViolation(SchemaProcessor processor)
-    {
-        return _formatter.format("schema-stack-violation", processor.getElementPath());
-    }
-
-    static String subModuleDoesNotExist(Resource subModuleDescriptor)
-    {
-        return _formatter.format("sub-module-does-not-exist", subModuleDescriptor);
-    }
-
-    static String dependencyOnUnknownModule(String toModuleId)
-    {
-        return _formatter.format("dependency-on-unknown-module", toModuleId);
     }
 
     private static String convertModule(Module module)

Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ImplStrings.properties
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ImplStrings.properties?rev=419908&r1=419907&r2=419908&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ImplStrings.properties (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/ImplStrings.properties Fri Jul  7 08:26:09 2006
@@ -16,9 +16,6 @@
 recursive-configuration=A recursive call to construct configuration {0} has occured.  This indicates a cycle between one or more configurations or services.
 unable-to-construct-configuration=Unable to construct configuration {0}: {1}
 unknown-service-model=Service model ''{0}'' is not defined.
-unknown-translator-name=No translator named ''{0}'' has been registered in configuration point {1}.
-duplicate-translator-name=Translator ''{0}'' duplicates a previous definition at {1} and has been ignored.
-translator-instantiation-failure=Unable to instantiate translator class {0}: {1}
 registry-shutdown=The HiveMind Registry has been shutdown.
 no-such-service-point=Service point {0} does not exist.
 unqualified-service-point=The service id specified ("{0}") is not fully qualified.  Perhaps you meant one of {1}.
@@ -29,48 +26,23 @@
 interceptor-does-not-implement-interface=The service interceptor ({0}) generated by service {1} for service point {2} does not implement the {3} interface defined by the service point.
 unable-to-read-messages=Unable to read message properties from {0}.
 unable-to-parse=Unable to parse module deployment descriptor {0}: {1}
-unable-to-find-modules=Unable to locate HiveMind module deployment descriptors in {0}: {1}
 duplicate-module-id=Module {0} is duplicated!  Definition in {2} has been ignored in favor of existing definition from {1}.
 duplicate-extension-point=Extension point {0} conflicts with definition at {1} and has been ignored.
-unknown-configuration-extension-point=Module {0} has contributed to unknown configuration point {1}. The contribution has been ignored.
-unknown-service-extension-point=Module {0} contributed to unknown service point {1}. The contribution has been ignored.
 missing-service=No module has contributed a service constructor for service point {0}.
 duplicate-factory=Module {0} has contributed a instance builder to service point {1}, which conflicts with an existing contribution by module {2}. The duplicate contribution has been ignored.  
 
-occurances.NONE=no contributions
-occurances.OPTIONAL=an optional contribution
-occurances.REQUIRED=exactly one contribution
-occurances.ONE_PLUS=at least one contribution
-
-contribution-count={0,choice,0#no contributions|1#one contribution|1<{0,number,integer} contributions}
-
-wrong-number-of-contributions=Configuration point {0} contains {1} but expects {2}.
-wrong-number-of-parameters=Parameters to service implementation factory {0} contains {1} but expects {2}.
-
 no-such-configuration=Configuration point {0} does not exist.
 no-such-symbol=No value available for symbol ''{0}''.
 symbol-source-contribution=symbol source
-unknown-attribute=Attribute ''{0}'' is not defined in the schema.
-missing-attribute=Attribute ''{0}'' is required but no value was provided.
-unique-attribute-constraint-broken=Value for attribute ''{0}'' (''{1}'') duplicates a prior instance at {2}.
-element-errors=Element {0} (at {1}) contains errors:
-unknown-element=Element {0} is not allowed here.
 bad-interface=Unable to find interface {0} (for service {1}).
 service-wrong-interface=Service {0} does not implement the requested interface ({1}).  The declared service interface type is {2}.
 shutdown-coordinator-failure=Unable to shutdown {0}: {1}
-sub-module-does-not-exist=Sub-module {0} does not exist.
-
-dependency-on-unknown-module=Required module {0} does not exist.
 
 unlocated-error=Error: {0}
 located-error=Error at {0}: {1}
 
 interceptor-contribution=interceptor contribution
 registry-already-started=The HiveMind Registry has already been started.
-
-incomplete-translator=Translator contribution ''{0}'' must specify either the service-id or class attribute.
-
-schema-stack-violation=The rules for processing element {0} have incorrectly manipulated the schema processor object stack.
 
 null-module=the application
 module=module {0}

Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/RegistryBuilder.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/RegistryBuilder.java?rev=419908&r1=419907&r2=419908&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/RegistryBuilder.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/impl/RegistryBuilder.java Fri Jul  7 08:26:09 2006
@@ -103,6 +103,10 @@
     {
         RegistryDefinition definition = getRegistryDefinition();
         
+        // Add Core HiveMind services like ClassFactory
+        CoreServicesProvider coreServicesProvider = new CoreServicesProvider();
+        coreServicesProvider.process(definition, _errorHandler);
+        
         definition.resolveExtensions();
         definition.checkDependencies();
         definition.checkContributionCounts();

Modified: hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ServiceModel.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ServiceModel.java?rev=419908&r1=419907&r2=419908&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ServiceModel.java (original)
+++ hivemind/branches/branch-2-0-annot/framework/src/java/org/apache/hivemind/internal/ServiceModel.java Fri Jul  7 08:26:09 2006
@@ -24,6 +24,12 @@
  */
 public interface ServiceModel
 {
+    public static final String PRITIMIVE = "primitive";
+    public static final String SINGLETON = "singleton";
+    public static final String THREADED = "threaded";
+    public static final String POOLED = "pooled";
+    
+    
     /**
      * Invoked by the service extension point to obtain the service implementation. The model may
      * return the actual service implementation or some form of proxy.

Modified: hivemind/branches/branch-2-0-annot/xml/src/descriptor/META-INF/hivemodule.xml
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/xml/src/descriptor/META-INF/hivemodule.xml?rev=419908&r1=419907&r2=419908&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/xml/src/descriptor/META-INF/hivemodule.xml (original)
+++ hivemind/branches/branch-2-0-annot/xml/src/descriptor/META-INF/hivemodule.xml Fri Jul  7 08:26:09 2006
@@ -113,13 +113,6 @@
     </invoke-factory>
   </service-point>
   
-  <service-point id="ClassFactory" interface="org.apache.hivemind.service.ClassFactory">
-    
-    Wrapper around Javassist used to dynamically create classes such as service interceptors.
-      
-    <create-instance class="service.impl.ClassFactoryImpl" model="primitive"/>
-  </service-point>
-  
   <schema id="MethodFilter">
     Used primarily as parameters to interceptor factories (such as LoggingInterceptor) to define which methods of service interface are to be included and which excluded.
       
@@ -470,24 +463,6 @@
     </parameters-schema>
     
     <create-instance class="service.impl.BuilderFactory" model="primitive"/>
-  </service-point>
-  
-  <service-point id="ThreadEventNotifier" interface="org.apache.hivemind.service.ThreadEventNotifier">
-    
-    Service used by other services to be alerted when a thread is cleaned up (typically, at the end of a request or transaction).
-      
-    <create-instance class="service.impl.ThreadEventNotifierImpl"/>
-  </service-point>
-  
-  <service-point id="ThreadLocalStorage" interface="org.apache.hivemind.service.ThreadLocalStorage">
-    
-    Service which manages a thread-local map of data items. 
-    This can be used for temporary storage of information when local variables can't be used. 
-    All stored items are released when the thread is cleaned up.
-    Note: this service should be considered deprecated; use the threaded service model
-    instead.
-      
-    <create-instance model="threaded" class="service.impl.ThreadLocalStorageImpl"/>
   </service-point>
   
   <configuration-point id="ServiceModels">

Modified: hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/InvokeFactoryServiceConstructor.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/InvokeFactoryServiceConstructor.java?rev=419908&r1=419907&r2=419908&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/InvokeFactoryServiceConstructor.java (original)
+++ hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/InvokeFactoryServiceConstructor.java Fri Jul  7 08:26:09 2006
@@ -152,7 +152,7 @@
         if (expected.inRange(actual))
             return;
 
-        String message = ImplMessages.wrongNumberOfParameters(_factoryServiceId, actual, expected);
+        String message = XmlImplMessages.wrongNumberOfParameters(_factoryServiceId, actual, expected);
 
         log.error(message, getLocation(), null);
     }

Modified: hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/SchemaElement.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/SchemaElement.java?rev=419908&r1=419907&r2=419908&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/SchemaElement.java (original)
+++ hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/SchemaElement.java Fri Jul  7 08:26:09 2006
@@ -145,7 +145,7 @@
             String name = a.getName();
 
             if (!_knownAttributes.contains(name))
-                errors.add(ImplMessages.unknownAttribute(name));
+                errors.add(XmlImplMessages.unknownAttribute(name));
 
             checkUniquness(name, a.getValue(), element.getLocation(), errors);
 
@@ -157,7 +157,7 @@
         while (it.hasNext())
         {
             String name = (String) it.next();
-            errors.add(ImplMessages.missingAttribute(name));
+            errors.add(XmlImplMessages.missingAttribute(name));
         }
 
         count = errors.size();
@@ -167,7 +167,7 @@
 
         StringBuffer buffer = new StringBuffer();
 
-        buffer.append(ImplMessages.elementErrors(_processor, element));
+        buffer.append(XmlImplMessages.elementErrors(_processor, element));
 
         for (int i = 0; i < count; i++)
         {
@@ -206,7 +206,7 @@
 
         // A conflict.
 
-        errors.add(ImplMessages.uniqueAttributeConstraintBroken(
+        errors.add(XmlImplMessages.uniqueAttributeConstraintBroken(
                 name,
                 translatedValue.toString(),
                 prior));

Modified: hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/SchemaProcessorImpl.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/SchemaProcessorImpl.java?rev=419908&r1=419907&r2=419908&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/SchemaProcessorImpl.java (original)
+++ hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/SchemaProcessorImpl.java Fri Jul  7 08:26:09 2006
@@ -85,7 +85,7 @@
     public Object pop()
     {
         if (_stack.isEmpty())
-            throw new ArrayIndexOutOfBoundsException(ImplMessages.schemaStackViolation(this));
+            throw new ArrayIndexOutOfBoundsException(XmlImplMessages.schemaStackViolation(this));
 
         return _stack.remove(_stack.size() - 1);
     }
@@ -102,7 +102,7 @@
         int position = count - 1 - depth;
 
         if (position < 0)
-            throw new ArrayIndexOutOfBoundsException(ImplMessages.schemaStackViolation(this));
+            throw new ArrayIndexOutOfBoundsException(XmlImplMessages.schemaStackViolation(this));
 
         return _stack.get(count - 1 - depth);
     }
@@ -203,7 +203,7 @@
 
         if (schemaElement == null)
             _errorLog
-                    .error(ImplMessages.unknownElement(this, element), element.getLocation(), null);
+                    .error(XmlImplMessages.unknownElement(this, element), element.getLocation(), null);
         else
         {
             SchemaElement prior = _activeElement;

Modified: hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/TranslatorManagerImpl.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/TranslatorManagerImpl.java?rev=419908&r1=419907&r2=419908&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/TranslatorManagerImpl.java (original)
+++ hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/TranslatorManagerImpl.java Fri Jul  7 08:26:09 2006
@@ -142,7 +142,7 @@
         }
         catch (Exception ex)
         {
-            throw new ApplicationRuntimeException(ImplMessages.translatorInstantiationFailure(
+            throw new ApplicationRuntimeException(XmlImplMessages.translatorInstantiationFailure(
                     translatorClass,
                     ex), ex);
         }
@@ -153,7 +153,7 @@
         Class result = (Class) _translatorClasses.get(translatorName);
 
         if (result == null)
-            throw new ApplicationRuntimeException(ImplMessages.unknownTranslatorName(
+            throw new ApplicationRuntimeException(XmlImplMessages.unknownTranslatorName(
                     translatorName,
                     TRANSLATORS_CONFIGURATION_ID));
 
@@ -181,7 +181,7 @@
 
             if (oldLocation != null)
             {
-                _errorHandler.error(LOG, ImplMessages.duplicateTranslatorName(name, oldLocation), c
+                _errorHandler.error(LOG, XmlImplMessages.duplicateTranslatorName(name, oldLocation), c
                         .getLocation(), null);
 
                 continue;
@@ -203,7 +203,7 @@
             {
                 _errorHandler.error(
                         LOG,
-                        ImplMessages.incompleteTranslator(c),
+                        XmlImplMessages.incompleteTranslator(c),
                         c.getLocation(),
                         null);
                 continue;

Modified: hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/XmlImplMessages.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/XmlImplMessages.java?rev=419908&r1=419907&r2=419908&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/XmlImplMessages.java (original)
+++ hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/XmlImplMessages.java Fri Jul  7 08:26:09 2006
@@ -14,6 +14,14 @@
 
 package org.apache.hivemind.impl;
 
+import org.apache.hivemind.ClassResolver;
+import org.apache.hivemind.Element;
+import org.apache.hivemind.HiveMind;
+import org.apache.hivemind.Location;
+import org.apache.hivemind.Occurances;
+import org.apache.hivemind.Resource;
+import org.apache.hivemind.schema.SchemaProcessor;
+
 
 /**
  * Used to format messages used in errors and log output for classes within the impl package.
@@ -34,6 +42,93 @@
     static String schemaNotVisible(String schemaId, String moduleId)
     {
         return _formatter.format("schema-not-visible", schemaId, moduleId);
+    }
+
+    static String wrongNumberOfParameters(String factoryServiceId, int actualCount,
+            Occurances expectation)
+    {
+        return _formatter.format(
+                "wrong-number-of-parameters",
+                factoryServiceId,
+                contributionCount(actualCount),
+                occurances(expectation));
+    
+    }
+    
+    static String occurances(Occurances occurances)
+    {
+        return _formatter.getMessage("occurances." + occurances.getName());
+    }
+
+    static String contributionCount(int count)
+    {
+        return _formatter.format("contribution-count", new Integer(count));
+    }
+
+    static String uniqueAttributeConstraintBroken(String name, String value,
+            Location priorLocation)
+    {
+        return _formatter.format("unique-attribute-constraint-broken", name, value, priorLocation);
+    }
+
+    static String unknownAttribute(String name)
+    {
+        return _formatter.format("unknown-attribute", name);
+    }
+
+    static String schemaStackViolation(SchemaProcessor processor)
+    {
+        return _formatter.format("schema-stack-violation", processor.getElementPath());
+    }
+  
+    static String missingAttribute(String name)
+    {
+        return _formatter.format("missing-attribute", name);
+    }
+
+    static String elementErrors(SchemaProcessor processor, Element element)
+    {
+        return _formatter.format("element-errors", processor.getElementPath(), element
+                .getLocation());
+    }
+
+    static String unknownElement(SchemaProcessor processor, Element element)
+    {
+        return _formatter.format("unknown-element", processor.getElementPath());
+    }
+
+    static String translatorInstantiationFailure(Class translatorClass, Throwable cause)
+    {
+        return _formatter.format(
+                "translator-instantiation-failure",
+                translatorClass.getName(),
+                cause);
+    }
+
+    static String unknownTranslatorName(String name, String configurationId)
+    {
+        return _formatter.format("unknown-translator-name", name, configurationId);
+    }
+
+    static String duplicateTranslatorName(String name, Location oldLocation)
+    {
+        return _formatter.format("duplicate-translator-name", name, HiveMind
+                .getLocationString(oldLocation));
+    }
+
+    static String incompleteTranslator(TranslatorContribution c)
+    {
+        return _formatter.format("incomplete-translator", c.getName());
+    }
+
+    static String subModuleDoesNotExist(Resource subModuleDescriptor)
+    {
+        return _formatter.format("sub-module-does-not-exist", subModuleDescriptor);
+    }
+
+    static String unableToFindModules(ClassResolver resolver, Throwable cause)
+    {
+        return _formatter.format("unable-to-find-modules", resolver, cause);
     }
     
 }

Modified: hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/XmlImplStrings.properties
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/XmlImplStrings.properties?rev=419908&r1=419907&r2=419908&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/XmlImplStrings.properties (original)
+++ hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/XmlImplStrings.properties Fri Jul  7 08:26:09 2006
@@ -14,3 +14,27 @@
 
 unable-to-resolve-schema=Unable to resolve reference to schema ''{0}''.
 schema-not-visible=Schema ''{0}'' is not visible to module {1}.
+
+occurances.NONE=no contributions
+occurances.OPTIONAL=an optional contribution
+occurances.REQUIRED=exactly one contribution
+occurances.ONE_PLUS=at least one contribution
+
+contribution-count={0,choice,0#no contributions|1#one contribution|1<{0,number,integer} contributions}
+
+wrong-number-of-parameters=Parameters to service implementation factory {0} contains {1} but expects {2}.
+unique-attribute-constraint-broken=Value for attribute ''{0}'' (''{1}'') duplicates a prior instance at {2}.
+
+unknown-attribute=Attribute ''{0}'' is not defined in the schema.
+missing-attribute=Attribute ''{0}'' is required but no value was provided.
+element-errors=Element {0} (at {1}) contains errors:
+unknown-element=Element {0} is not allowed here.
+
+schema-stack-violation=The rules for processing element {0} have incorrectly manipulated the schema processor object stack.
+translator-instantiation-failure=Unable to instantiate translator class {0}: {1}
+unknown-translator-name=No translator named ''{0}'' has been registered in configuration point {1}.
+duplicate-translator-name=Translator ''{0}'' duplicates a previous definition at {1} and has been ignored.
+incomplete-translator=Translator contribution ''{0}'' must specify either the service-id or class attribute.
+
+sub-module-does-not-exist=Sub-module {0} does not exist.
+unable-to-find-modules=Unable to locate HiveMind module deployment descriptors in {0}: {1}

Modified: hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/XmlModuleReader.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/XmlModuleReader.java?rev=419908&r1=419907&r2=419908&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/XmlModuleReader.java (original)
+++ hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/XmlModuleReader.java Fri Jul  7 08:26:09 2006
@@ -92,7 +92,7 @@
             {
                 _errorHandler.error(
                         LOG,
-                        ImplMessages.subModuleDoesNotExist(descriptorResource),
+                        XmlImplMessages.subModuleDoesNotExist(descriptorResource),
                         smd.getLocation(),
                         null);
                 continue;

Modified: hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/XmlRegistryProvider.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/XmlRegistryProvider.java?rev=419908&r1=419907&r2=419908&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/XmlRegistryProvider.java (original)
+++ hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/impl/XmlRegistryProvider.java Fri Jul  7 08:26:09 2006
@@ -59,7 +59,7 @@
         }
         catch (IOException ex)
         {
-            throw new ApplicationRuntimeException(ImplMessages.unableToFindModules(_classResolver, ex),
+            throw new ApplicationRuntimeException(XmlImplMessages.unableToFindModules(_classResolver, ex),
                     ex);
         }
 

Modified: hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/impl/TestInvokeFactoryServiceConstructor.java
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/impl/TestInvokeFactoryServiceConstructor.java?rev=419908&r1=419907&r2=419908&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/impl/TestInvokeFactoryServiceConstructor.java (original)
+++ hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/impl/TestInvokeFactoryServiceConstructor.java Fri Jul  7 08:26:09 2006
@@ -90,7 +90,7 @@
         xmlRegistryNature.getTranslationManager();
         xmlRegistryNatureControl.setReturnValue(null);
         
-        String message = ImplMessages
+        String message = XmlImplMessages
                 .wrongNumberOfParameters("foo.bar.Baz", 0, Occurances.REQUIRED);
 
         log.error(message, null, null);

Copied: hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/service/TestBuilderFactory.java (from r419546, hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/service/TestBuilderFactory.java)
URL: http://svn.apache.org/viewvc/hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/service/TestBuilderFactory.java?p2=hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/service/TestBuilderFactory.java&p1=hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/service/TestBuilderFactory.java&r1=419546&r2=419908&rev=419908&view=diff
==============================================================================
--- hivemind/branches/branch-2-0-annot/xml/src/java/org/apache/hivemind/service/TestBuilderFactory.java (original)
+++ hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/service/TestBuilderFactory.java Fri Jul  7 08:26:09 2006
@@ -12,8 +12,17 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package hivemind.test.services;
+package org.apache.hivemind.service;
 
+import hivemind.test.services.AutowireTarget;
+import hivemind.test.services.ClassResolverHolder;
+import hivemind.test.services.ConstructorAutowireTarget;
+import hivemind.test.services.ErrorHandlerHolder;
+import hivemind.test.services.InitializeFixture;
+import hivemind.test.services.ServiceAutowireTarget;
+import hivemind.test.services.SetObjectFixture;
+import hivemind.test.services.SimpleService;
+import hivemind.test.services.StringHolder;
 import hivemind.test.services.impl.StringHolderImpl;
 
 import org.apache.commons.logging.Log;

Propchange: hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/service/TestBuilderFactory.java
------------------------------------------------------------------------------
    cvs2svn:cvs-rev = 1.28

Propchange: hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/service/TestBuilderFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: hivemind/branches/branch-2-0-annot/xml/src/test/org/apache/hivemind/service/TestBuilderFactory.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision



Mime
View raw message