hivemind-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahue...@apache.org
Subject svn commit: r506138 - in /hivemind/hivemind2/trunk/annotations/src: java/org/apache/hivemind/annotations/AbstractAnnotatedModule.java test/org/apache/hivemind/annotations/SimpleAnnotatedModule.java
Date Sun, 11 Feb 2007 21:08:36 GMT
Author: ahuegen
Date: Sun Feb 11 13:08:35 2007
New Revision: 506138

URL: http://svn.apache.org/viewvc?view=rev&rev=506138
Log:
Service and configuration access simplified

Modified:
    hivemind/hivemind2/trunk/annotations/src/java/org/apache/hivemind/annotations/AbstractAnnotatedModule.java
    hivemind/hivemind2/trunk/annotations/src/test/org/apache/hivemind/annotations/SimpleAnnotatedModule.java

Modified: hivemind/hivemind2/trunk/annotations/src/java/org/apache/hivemind/annotations/AbstractAnnotatedModule.java
URL: http://svn.apache.org/viewvc/hivemind/hivemind2/trunk/annotations/src/java/org/apache/hivemind/annotations/AbstractAnnotatedModule.java?view=diff&rev=506138&r1=506137&r2=506138
==============================================================================
--- hivemind/hivemind2/trunk/annotations/src/java/org/apache/hivemind/annotations/AbstractAnnotatedModule.java
(original)
+++ hivemind/hivemind2/trunk/annotations/src/java/org/apache/hivemind/annotations/AbstractAnnotatedModule.java
Sun Feb 11 13:08:35 2007
@@ -20,6 +20,10 @@
         return _typedRegistry;
     }
 
+    /**
+     * This setter is used to inject the registry reference.
+     * @param typedRegistry  the registry
+     */
     public void setRegistry(TypedRegistry typedRegistry)
     {
         _typedRegistry = typedRegistry;
@@ -28,7 +32,7 @@
     /**
      * @return  a reference to the {@link Autowiring} service.
      */
-    public Autowiring getAutowiring()
+    protected Autowiring getAutowiring()
     {
         return _typedRegistry.getAutowiring();
     }
@@ -38,7 +42,7 @@
      * @param target  the object to wire
      * @return the wired object 
      */
-    public <T> T autowireProperties(T target) 
+    protected <T> T autowireProperties(T target) 
     {
         return (T) getAutowiring().autowireProperties(target);
     }
@@ -48,7 +52,7 @@
      * 
      * @see org.apache.hivemind.Registry#getService(String, Class)
      */
-    public <T> T getService(String serviceId, Class<T> serviceInterface)
+    protected <T> T service(String serviceId, Class<T> serviceInterface)
     {
         return _typedRegistry.getService(serviceId, serviceInterface);
     }
@@ -59,7 +63,7 @@
      * 
      * @see org.apache.hivemind.Registry#getService(Class)
      */
-    public <T> T getService(Class<T> serviceInterface)
+    protected <T> T service(Class<T> serviceInterface)
     {
         return _typedRegistry.getService(serviceInterface);
     }
@@ -69,7 +73,7 @@
      * 
      * @see org.apache.hivemind.Registry#getConfiguration(String)
      */
-    public <T> T getConfiguration(String configurationId, Class<T> configurationType)
+    protected <T> T configuration(String configurationId, Class<T> configurationType)
     {
         return _typedRegistry.getConfiguration(configurationId, configurationType);
     }
@@ -80,7 +84,7 @@
      * 
      * @see org.apache.hivemind.Registry#getConfiguration(String)
      */
-    public <T> T getConfiguration(Class<T> configurationType)
+    protected <T> T configuration(Class<T> configurationType)
     {
         return _typedRegistry.getConfiguration(configurationType);
     }

Modified: hivemind/hivemind2/trunk/annotations/src/test/org/apache/hivemind/annotations/SimpleAnnotatedModule.java
URL: http://svn.apache.org/viewvc/hivemind/hivemind2/trunk/annotations/src/test/org/apache/hivemind/annotations/SimpleAnnotatedModule.java?view=diff&rev=506138&r1=506137&r2=506138
==============================================================================
--- hivemind/hivemind2/trunk/annotations/src/test/org/apache/hivemind/annotations/SimpleAnnotatedModule.java
(original)
+++ hivemind/hivemind2/trunk/annotations/src/test/org/apache/hivemind/annotations/SimpleAnnotatedModule.java
Sun Feb 11 13:08:35 2007
@@ -20,17 +20,17 @@
 
             public void run()
             {
-                List<String> demoList = (List<String>) getConfiguration("Demo",
List.class);
+                List<String> demoList = (List<String>) configuration("Demo",
List.class);
                 for (String entry : demoList)
                 {
                     System.out.println(entry);
                 }
-                String one = (String) getConfiguration("SingleElement", String.class);
+                String one = (String) configuration("SingleElement", String.class);
                 System.out.println(one);
-                StringHolderImpl holder = (StringHolderImpl) getConfiguration("StringHolder",
StringHolderImpl.class);
+                StringHolderImpl holder = (StringHolderImpl) configuration("StringHolder",
StringHolderImpl.class);
                 System.out.println(holder.getValue());
                 
-                StringHolderImpl holderService = (StringHolderImpl) getService("StringHolder",
StringHolderImpl.class);
+                StringHolderImpl holderService = (StringHolderImpl) service("StringHolder",
StringHolderImpl.class);
                 System.out.println(holderService.getValue());
             }
         };



Mime
View raw message