felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clem...@apache.org
Subject svn commit: r1477245 - in /felix/trunk/ipojo/runtime: composite/src/main/java/org/apache/felix/ipojo/composite/ core/src/main/java/org/apache/felix/ipojo/
Date Mon, 29 Apr 2013 18:13:56 GMT
Author: clement
Date: Mon Apr 29 18:13:56 2013
New Revision: 1477245

URL: http://svn.apache.org/r1477245
Log:
Added generics to factories.

Modified:
    felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/CompositeFactory.java
    felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/CompositeManager.java
    felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/ComponentFactory.java
    felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/HandlerManagerFactory.java

Modified: felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/CompositeFactory.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/CompositeFactory.java?rev=1477245&r1=1477244&r2=1477245&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/CompositeFactory.java
(original)
+++ felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/CompositeFactory.java
Mon Apr 29 18:13:56 2013
@@ -76,19 +76,20 @@ public class CompositeFactory extends Co
         }
     }
     
-    public String getClassName() { return "composite"; }
+    public String getClassName() { return null; }
 
     /**
      * Compute required handlers.
      * @return the list of required handler.
      */
-    public List getRequiredHandlerList() {
-        List list = new ArrayList();
+    public List<RequiredHandler> getRequiredHandlerList() {
+        List<RequiredHandler> list = new ArrayList<RequiredHandler>();
         Element[] elems = m_componentMetadata.getElements();
-        for (int i = 0; i < elems.length; i++) {
-            Element current = elems[i]; 
+        for (Element current : elems) {
             RequiredHandler req = new RequiredHandler(current.getName(), current.getNameSpace());
-            if (! list.contains(req)) { list.add(req); }
+            if (!list.contains(req)) {
+                list.add(req);
+            }
         }
         
         // Add architecture if architecture != 'false'
@@ -126,7 +127,6 @@ public class CompositeFactory extends Co
             } catch (InvalidSyntaxException e) {
                 m_logger.log(Logger.ERROR, "A factory filter is not valid: " + e.getMessage());
                 stop();
-                return;
             }
         }
     }
@@ -165,7 +165,7 @@ public class CompositeFactory extends Co
             name = (String) properties.get("name");
         }
 
-        ComponentInstance instance = (ComponentInstance) m_componentInstances.get(name);
+        ComponentInstance instance = m_componentInstances.get(name);
         if (instance == null) { // The instance does not exists.
             return;
         }

Modified: felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/CompositeManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/CompositeManager.java?rev=1477245&r1=1477244&r2=1477245&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/CompositeManager.java
(original)
+++ felix/trunk/ipojo/runtime/composite/src/main/java/org/apache/felix/ipojo/composite/CompositeManager.java
Mon Apr 29 18:13:56 2013
@@ -181,7 +181,7 @@ public class CompositeManager implements
     public CompositeHandler getCompositeHandler(String name) {
         for (int i = 0; i < m_handlers.length; i++) {
             HandlerFactory fact = (HandlerFactory) m_handlers[i].getFactory();
-            if (fact.getHandlerName().equals(name) || fact.getComponentDescription().getClassName().equals(name))
{
+            if (fact.getHandlerName().equals(name) || name.equals(fact.getComponentDescription().getClassName()))
{
                 return (CompositeHandler) m_handlers[i].getHandler();
             }
         }

Modified: felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/ComponentFactory.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/ComponentFactory.java?rev=1477245&r1=1477244&r2=1477245&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/ComponentFactory.java
(original)
+++ felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/ComponentFactory.java
Mon Apr 29 18:13:56 2013
@@ -290,7 +290,7 @@ public class ComponentFactory extends IP
      *
      * @return the required handler list.
      */
-    public List getRequiredHandlerList() {
+    public List<RequiredHandler> getRequiredHandlerList() {
         List<RequiredHandler> list = new ArrayList<RequiredHandler>();
         Element[] elems = m_componentMetadata.getElements();
         for (Element current : elems) {

Modified: felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/HandlerManagerFactory.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/HandlerManagerFactory.java?rev=1477245&r1=1477244&r2=1477245&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/HandlerManagerFactory.java
(original)
+++ felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/HandlerManagerFactory.java
Mon Apr 29 18:13:56 2013
@@ -155,8 +155,8 @@ public class HandlerManagerFactory exten
      * and a handler is never immediate.
      * @return the required handler list.
      */
-    public List getRequiredHandlerList() {
-        List list = new ArrayList();
+    public List<RequiredHandler> getRequiredHandlerList() {
+        List<RequiredHandler> list = new ArrayList<RequiredHandler>();
         Element[] elems = m_componentMetadata.getElements();
         for (int i = 0; i < elems.length; i++) {
             Element current = elems[i];



Mime
View raw message