Removed DOCUMENT ME comments that were generated and applied source code
[utils] / system / spring / src / main / java / org / wamblee / system / spring / SpringComponent.java
index ad6c4b0fd2362b79cd47d2b00c3e6b2ebd80b651..8b8bed94b5b1a401dee1618e9dc119ba08841722 100644 (file)
@@ -35,143 +35,91 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.Properties;
 
-
 /**
- * Represents a system configured based on spring. The spring config files
- * that are configured should not contain any PropertyPlaceholderConfigurer
- * objects.
- *
+ * Represents a system configured based on spring. The spring config files that
+ * are configured should not contain any PropertyPlaceholderConfigurer objects.
+ * 
  * @author Erik Brakkee
  */
 public class SpringComponent extends AbstractComponent<Scope> {
-    /**
-     * DOCUMENT ME!
-     */
     private static final String CONTEXT_KEY = "context";
 
-    /**
-     * DOCUMENT ME!
-     */
     static final ThreadLocal<SpringComponent> THIS = new ThreadLocal<SpringComponent>();
 
-    /**
-     * DOCUMENT ME!
-     */
     static final ThreadLocal<Scope> SCOPE = new ThreadLocal<Scope>();
 
-    /**
-     * DOCUMENT ME!
-     */
     private Properties properties;
 
-    /**
-     * DOCUMENT ME!
-     */
     private String[] configFiles;
 
-    /**
-     * DOCUMENT ME!
-     */
     private Map<String, ProvidedInterface> provided;
 
-    /**
-     * DOCUMENT ME!
-     */
     private Map<RequiredInterface, String> required;
 
-    /**
-     * DOCUMENT ME!
-     */
     private Map<String, Properties> propertyObjects;
 
-/**
-         * Constructs a spring system.
-         
-         * @param aName
-         *            Name of the system.
-         * @param aConfigFil
-         *            Spring config files to read.
-         * @param aProvided
-         *            Map of bean name to service descriptor describing the bean
-         *            names that the spring config files use for each required
-         *            service.
-         * @param aRequired
-         *            Map of bean name to service descriptor describing the bean
-         *            names that the spring config files use for each required
-         *            service.
-         */
+    /**
+     * Constructs a spring system.
+     * 
+     * @param aName
+     *            Name of the system.
+     * @param aConfigFil
+     *            Spring config files to read.
+     * @param aProvided
+     *            Map of bean name to service descriptor describing the bean
+     *            names that the spring config files use for each required
+     *            service.
+     * @param aRequired
+     *            Map of bean name to service descriptor describing the bean
+     *            names that the spring config files use for each required
+     *            service.
+     */
     public SpringComponent(String aName, String[] aConfigFiles,
         Map<String, ProvidedInterface> aProvided,
         Map<RequiredInterface, String> aRequired) {
         super(aName, aProvided.values().toArray(new ProvidedInterface[0]),
             aRequired.keySet().toArray(new RequiredInterface[0]));
-        properties          = new Properties();
-        configFiles         = aConfigFiles;
-        provided            = aProvided;
-        required            = aRequired;
-        propertyObjects     = new HashMap<String, Properties>();
+        properties = new Properties();
+        configFiles = aConfigFiles;
+        provided = aProvided;
+        required = aRequired;
+        propertyObjects = new HashMap<String, Properties>();
     }
 
     /**
-     * Must be called to make a property available in the application
-     * context.
-     *
-     * @param aKey Property key.
-     * @param aValue Property value.
+     * Must be called to make a property available in the application context.
+     * 
+     * @param aKey
+     *            Property key.
+     * @param aValue
+     *            Property value.
      */
     public void setProperty(String aKey, String aValue) {
         properties.put(aKey, aValue);
     }
 
-    /**
-     * DOCUMENT ME!
-     *
-     * @param aProperties DOCUMENT ME!
-     */
     public void addProperties(Properties aProperties) {
         for (Object key : aProperties.keySet()) {
             setProperty((String) key, aProperties.getProperty((String) key));
         }
     }
 
-    /**
-     * DOCUMENT ME!
-     *
-     * @param aBeanname DOCUMENT ME!
-     * @param aProperties DOCUMENT ME!
-     */
     public void addProperties(String aBeanname, Properties aProperties) {
         propertyObjects.put(aBeanname, aProperties);
     }
 
-    /**
-     * DOCUMENT ME!
-     *
-     * @param aBeanname DOCUMENT ME!
-     *
-     * @return DOCUMENT ME!
-     */
     public Properties getProperties(String aBeanname) {
         return propertyObjects.get(aBeanname);
     }
 
-    /**
-     * DOCUMENT ME!
-     *
-     * @param aExternalScope DOCUMENT ME!
-     *
-     * @return DOCUMENT ME!
-     *
-     * @throws SystemAssemblyException DOCUMENT ME!
-     */
     @Override
     protected Scope doStart(Scope aExternalScope) {
-        SpringComponent old      = THIS.get();
-        Scope           oldScope = SCOPE.get();
+        SpringComponent old = THIS.get();
+        Scope oldScope = SCOPE.get();
         THIS.set(this);
 
-        Scope scope = new DefaultScope(getProvidedInterfaces()
-                .toArray(new ProvidedInterface[0]), aExternalScope);
+        Scope scope = new DefaultScope(getProvidedInterfaces().toArray(
+            new ProvidedInterface[0]), aExternalScope);
         SCOPE.set(scope);
 
         try {
@@ -203,14 +151,6 @@ public class SpringComponent extends AbstractComponent<Scope> {
         }
     }
 
-    /**
-     * DOCUMENT ME!
-     *
-     * @param aContext DOCUMENT ME!
-     * @param aScope DOCUMENT ME!
-     *
-     * @throws IllegalArgumentException DOCUMENT ME!
-     */
     private void exposeProvidedServices(AbstractApplicationContext aContext,
         Scope aScope) {
         // Call addService for each provided service.
@@ -218,8 +158,8 @@ public class SpringComponent extends AbstractComponent<Scope> {
             Object svc = aContext.getBean(name);
 
             if (svc == null) {
-                throw new IllegalArgumentException(getQualifiedName()
-                    ": service '" + name + "' is null");
+                throw new IllegalArgumentException(getQualifiedName() +
+                    ": service '" + name + "' is null");
             }
 
             addInterface(provided.get(name), svc, aScope);
@@ -227,13 +167,6 @@ public class SpringComponent extends AbstractComponent<Scope> {
         }
     }
 
-    /**
-     * DOCUMENT ME!
-     *
-     * @param aParentContext DOCUMENT ME!
-     *
-     * @return DOCUMENT ME!
-     */
     private AbstractApplicationContext parseConfigFiles(
         GenericApplicationContext aParentContext) {
         // Parse spring config files
@@ -241,11 +174,6 @@ public class SpringComponent extends AbstractComponent<Scope> {
             false, aParentContext);
     }
 
-    /**
-     * DOCUMENT ME!
-     *
-     * @param aParentContext DOCUMENT ME!
-     */
     private void registerRequiredServices(
         GenericApplicationContext aParentContext) {
         // Register required services in a parent context
@@ -256,38 +184,30 @@ public class SpringComponent extends AbstractComponent<Scope> {
                 ConstructorArgumentValues cargs = new ConstructorArgumentValues();
                 cargs.addGenericArgumentValue(requiredIntf.getName());
 
-                BeanDefinition definition = new RootBeanDefinition(RequiredServiceBean.class,
-                        cargs, new MutablePropertyValues());
+                BeanDefinition definition = new RootBeanDefinition(
+                    RequiredServiceBean.class, cargs,
+                    new MutablePropertyValues());
                 aParentContext.registerBeanDefinition(beanName, definition);
             } else {
-                // The required interface is not required by the spring config but by the sub-class directly.
+                // The required interface is not required by the spring config
+                // but by the sub-class directly.
             }
         }
     }
 
-    /**
-     * DOCUMENT ME!
-     *
-     * @param aParentContext DOCUMENT ME!
-     */
     private void registerPropertyObjects(
         GenericApplicationContext aParentContext) {
         for (String beanName : propertyObjects.keySet()) {
             ConstructorArgumentValues cargs = new ConstructorArgumentValues();
-            cargs.addGenericArgumentValue(PropertySetter.createPropertyFile(
-                    propertyObjects.get(beanName)));
+            cargs.addGenericArgumentValue(PropertySetter
+                .createPropertyFile(propertyObjects.get(beanName)));
 
-            BeanDefinition definition = new RootBeanDefinition(ConfiguredProperties.class,
-                    cargs, new MutablePropertyValues());
+            BeanDefinition definition = new RootBeanDefinition(
+                ConfiguredProperties.class, cargs, new MutablePropertyValues());
             aParentContext.registerBeanDefinition(beanName, definition);
         }
     }
 
-    /**
-     * DOCUMENT ME!
-     *
-     * @param aRuntime DOCUMENT ME!
-     */
     @Override
     protected void doStop(Scope aRuntime) {
         AbstractApplicationContext context = (AbstractApplicationContext) aRuntime