felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clem...@apache.org
Subject svn commit: r613250 - in /felix/sandbox/clement/ipojo: ./ annotations/ ant/ arch/ arch/src/main/java/org/apache/felix/ipojo/arch/ composite/ composite/src/main/java/org/apache/felix/ipojo/composite/ core/ core/src/main/java/org/apache/felix/ipojo/ core...
Date Fri, 18 Jan 2008 20:01:07 GMT
Author: clement
Date: Fri Jan 18 12:00:43 2008
New Revision: 613250

URL: http://svn.apache.org/viewvc?rev=613250&view=rev
Log:
Add checkstyle to the pom files to check "core" projects code style.
AbstractFactory becomes IPojoFactory
Modified ManipulationMetadata to PojoMetadata, change the access to this object (now cached in the component factory).

Added:
    felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/IPojoFactory.java
      - copied, changed from r610817, felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/AbstractFactory.java
    felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/parser/PojoMetadata.java
      - copied, changed from r613219, felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/parser/ManipulationMetadata.java
Removed:
    felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/AbstractFactory.java
    felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/parser/ManipulationMetadata.java
Modified:
    felix/sandbox/clement/ipojo/annotations/pom.xml
    felix/sandbox/clement/ipojo/ant/pom.xml
    felix/sandbox/clement/ipojo/arch/pom.xml
    felix/sandbox/clement/ipojo/arch/src/main/java/org/apache/felix/ipojo/arch/ArchCommandImpl.java
    felix/sandbox/clement/ipojo/composite/pom.xml
    felix/sandbox/clement/ipojo/composite/src/main/java/org/apache/felix/ipojo/composite/CompositeHandler.java
    felix/sandbox/clement/ipojo/core/pom.xml
    felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/ComponentFactory.java
    felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/Extender.java
    felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/Handler.java
    felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/HandlerManager.java
    felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/InstanceCreator.java
    felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/PrimitiveHandler.java
    felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/configuration/ConfigurationHandler.java
    felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyHandler.java
    felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/lifecycle/callback/LifecycleCallbackHandler.java
    felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/lifecycle/controller/ControllerHandler.java
    felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceHandler.java
    felix/sandbox/clement/ipojo/event.admin.handler/pom.xml
    felix/sandbox/clement/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handler/event/EventAdminSubscriberHandler.java
    felix/sandbox/clement/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handler/event/EventAdminSubscriberMetadata.java
    felix/sandbox/clement/ipojo/examples/property-handler/PropertyHandler/src/main/java/org/apache/felix/ipojo/handler/properties/PropertiesHandler.java
    felix/sandbox/clement/ipojo/examples/tutorial-maven/hello.impl.annotation/pom.xml
    felix/sandbox/clement/ipojo/extender.pattern.handler/   (props changed)
    felix/sandbox/clement/ipojo/extender.pattern.handler/pom.xml
    felix/sandbox/clement/ipojo/jmx.handler/pom.xml
    felix/sandbox/clement/ipojo/jmx.handler/src/main/java/org/apache/felix/ipojo/handlers/jmx/MBeanHandler.java
    felix/sandbox/clement/ipojo/manipulator/pom.xml
    felix/sandbox/clement/ipojo/metadata/pom.xml
    felix/sandbox/clement/ipojo/plugin/pom.xml
    felix/sandbox/clement/ipojo/plugin/src/main/java/org/apache/felix/ipojo/plugin/ManipulatorMojo.java
    felix/sandbox/clement/ipojo/pom.xml
    felix/sandbox/clement/ipojo/white.board.pattern.handler/   (props changed)
    felix/sandbox/clement/ipojo/white.board.pattern.handler/pom.xml
    felix/sandbox/clement/ipojo/white.board.pattern.handler/src/main/java/org/apache/felix/ipojo/handler/wbp/WhiteBoardManager.java
    felix/sandbox/clement/ipojo/white.board.pattern.handler/src/main/java/org/apache/felix/ipojo/handler/wbp/WhiteBoardPatternHandler.java

Modified: felix/sandbox/clement/ipojo/annotations/pom.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/annotations/pom.xml?rev=613250&r1=613249&r2=613250&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/annotations/pom.xml (original)
+++ felix/sandbox/clement/ipojo/annotations/pom.xml Fri Jan 18 12:00:43 2008
@@ -37,4 +37,15 @@
   	</plugin>
   </plugins>
   </build>
+  <reporting>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <configuration>
+          <configLocation>http://people.apache.org/~clement/styles/checkstyle_ipojo.xml</configLocation>
+        </configuration>
+      </plugin>
+    </plugins>
+  </reporting>
 </project>

Modified: felix/sandbox/clement/ipojo/ant/pom.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/ant/pom.xml?rev=613250&r1=613249&r2=613250&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/ant/pom.xml (original)
+++ felix/sandbox/clement/ipojo/ant/pom.xml Fri Jan 18 12:00:43 2008
@@ -53,4 +53,15 @@
   	</plugin>
   </plugins>
   </build>
+  <reporting>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <configuration>
+          <configLocation>http://people.apache.org/~clement/styles/checkstyle_ipojo.xml</configLocation>
+        </configuration>
+      </plugin>
+    </plugins>
+  </reporting>
 </project>

Modified: felix/sandbox/clement/ipojo/arch/pom.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/arch/pom.xml?rev=613250&r1=613249&r2=613250&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/arch/pom.xml (original)
+++ felix/sandbox/clement/ipojo/arch/pom.xml Fri Jan 18 12:00:43 2008
@@ -59,4 +59,16 @@
       </plugin>
     </plugins>
    </build>
+   
+    <reporting>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <configuration>
+          <configLocation>http://people.apache.org/~clement/styles/checkstyle_ipojo.xml</configLocation>
+        </configuration>
+      </plugin>
+    </plugins>
+  </reporting>
 </project>

Modified: felix/sandbox/clement/ipojo/arch/src/main/java/org/apache/felix/ipojo/arch/ArchCommandImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/arch/src/main/java/org/apache/felix/ipojo/arch/ArchCommandImpl.java?rev=613250&r1=613249&r2=613250&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/arch/src/main/java/org/apache/felix/ipojo/arch/ArchCommandImpl.java (original)
+++ felix/sandbox/clement/ipojo/arch/src/main/java/org/apache/felix/ipojo/arch/ArchCommandImpl.java Fri Jan 18 12:00:43 2008
@@ -22,7 +22,7 @@
 import java.lang.reflect.Field;
 import java.util.List;
 
-import org.apache.felix.ipojo.AbstractFactory;
+import org.apache.felix.ipojo.IPojoFactory;
 import org.apache.felix.ipojo.ComponentInstance;
 import org.apache.felix.ipojo.Factory;
 import org.apache.felix.ipojo.HandlerFactory;
@@ -127,7 +127,7 @@
     
     private void printStats(PrintStream out) {
         try {
-            Field field = AbstractFactory.class.getDeclaredField("m_instancesName");
+            Field field = IPojoFactory.class.getDeclaredField("m_instancesName");
             field.setAccessible(true);
             List names = (List) field.get(null);
             out.println("Number of living instances : " + names.size());

Modified: felix/sandbox/clement/ipojo/composite/pom.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/composite/pom.xml?rev=613250&r1=613249&r2=613250&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/composite/pom.xml (original)
+++ felix/sandbox/clement/ipojo/composite/pom.xml Fri Jan 18 12:00:43 2008
@@ -95,4 +95,15 @@
       </plugin>
     </plugins>
   </build>
+  <reporting>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <configuration>
+          <configLocation>http://people.apache.org/~clement/styles/checkstyle_ipojo.xml</configLocation>
+        </configuration>
+      </plugin>
+    </plugins>
+  </reporting>
 </project>

Modified: felix/sandbox/clement/ipojo/composite/src/main/java/org/apache/felix/ipojo/composite/CompositeHandler.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/composite/src/main/java/org/apache/felix/ipojo/composite/CompositeHandler.java?rev=613250&r1=613249&r2=613250&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/composite/src/main/java/org/apache/felix/ipojo/composite/CompositeHandler.java (original)
+++ felix/sandbox/clement/ipojo/composite/src/main/java/org/apache/felix/ipojo/composite/CompositeHandler.java Fri Jan 18 12:00:43 2008
@@ -19,7 +19,9 @@
 package org.apache.felix.ipojo.composite;
 
 import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.Factory;
 import org.apache.felix.ipojo.Handler;
+import org.apache.felix.ipojo.util.Logger;
 
 
 /**
@@ -41,13 +43,25 @@
     private CompositeManager m_manager;
     
     /**
+     * Composite Factory
+     */
+    private CompositeFactory m_factory;
+    
+    /**
      * Set the manager.
      * This method me be called only once time.
      * @param cm : the composite manager.
      */
     protected final void attach(ComponentInstance cm) {
         m_manager = (CompositeManager) cm;
-        setLogger(m_manager.getFactory().getLogger());
+    }
+    
+    public final void setFactory(Factory factory) {
+        m_factory = (CompositeFactory) factory;
+    }
+    
+    public final Logger getLogger() {
+        return m_factory.getLogger();
     }
     
     public final CompositeManager getCompositeManager() {

Modified: felix/sandbox/clement/ipojo/core/pom.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/core/pom.xml?rev=613250&r1=613249&r2=613250&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/core/pom.xml (original)
+++ felix/sandbox/clement/ipojo/core/pom.xml Fri Jan 18 12:00:43 2008
@@ -92,5 +92,17 @@
         </executions>
       </plugin>
     </plugins>
-  </build>
+	</build>
+	
+	<reporting>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <configuration>
+          <configLocation>http://people.apache.org/~clement/styles/checkstyle_ipojo.xml</configLocation>
+        </configuration>
+      </plugin>
+    </plugins>
+  </reporting>
 </project>

Modified: felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/ComponentFactory.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/ComponentFactory.java?rev=613250&r1=613249&r2=613250&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/ComponentFactory.java (original)
+++ felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/ComponentFactory.java Fri Jan 18 12:00:43 2008
@@ -30,6 +30,7 @@
 import org.apache.felix.ipojo.architecture.ComponentTypeDescription;
 import org.apache.felix.ipojo.metadata.Attribute;
 import org.apache.felix.ipojo.metadata.Element;
+import org.apache.felix.ipojo.parser.PojoMetadata;
 import org.apache.felix.ipojo.util.Logger;
 import org.apache.felix.ipojo.util.Tracker;
 import org.apache.felix.ipojo.util.TrackerCustomizer;
@@ -44,7 +45,7 @@
  * 
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
-public class ComponentFactory extends AbstractFactory implements TrackerCustomizer {
+public class ComponentFactory extends IPojoFactory implements TrackerCustomizer {
 
     /**
      * Tracker used to track required handler factories.
@@ -67,6 +68,11 @@
     private String m_componentClassName = null;
     
     /**
+     * Manipulation Metadata of the internal POJO.
+     */
+    private PojoMetadata m_manipulation = null;
+    
+    /**
      * Create a instance manager factory. The class is given in parameter. The
      * component type is not a composite.
      * @param bc : bundle context
@@ -118,7 +124,7 @@
      * @param handlers : handler to use
      * @return the created instance
      * @throws org.apache.felix.ipojo.ConfigurationException : if the configuration process failed.
-     * @see org.apache.felix.ipojo.AbstractFactory#createInstance(java.util.Dictionary, org.apache.felix.ipojo.IPojoContext, org.apache.felix.ipojo.HandlerManager[])
+     * @see org.apache.felix.ipojo.IPojoFactory#createInstance(java.util.Dictionary, org.apache.felix.ipojo.IPojoContext, org.apache.felix.ipojo.HandlerManager[])
      */
     public ComponentInstance createInstance(Dictionary configuration, IPojoContext context, HandlerManager[] handlers) throws org.apache.felix.ipojo.ConfigurationException {
         InstanceManager instance = new InstanceManager(this, context, handlers);
@@ -309,6 +315,20 @@
     public void modifiedService(ServiceReference reference, Object service) {
         // Noting to do
     }
+    
+    
+    /**
+     * Returns manipulation metadata of this component type.
+     * The returned object is computed at the first call and then is cached.
+     * @return manipulation metadata of this component type.
+     */
+    public PojoMetadata getPojoMetadata() {
+        if (m_manipulation == null) {
+            m_manipulation = new PojoMetadata(m_componentMetadata);
+        }
+        return m_manipulation;
+    }
+    
     /**
      * FactoryClassloader.
      */

Modified: felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/Extender.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/Extender.java?rev=613250&r1=613249&r2=613250&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/Extender.java (original)
+++ felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/Extender.java Fri Jan 18 12:00:43 2008
@@ -120,7 +120,7 @@
             if (mft.m_createdFactories != null) {
                 List cfs = (List) mft.m_createdFactories.remove(bundle);
                 for (int i = 0; cfs != null && i < cfs.size(); i++) {
-                    AbstractFactory factory = (AbstractFactory) cfs.get(i);
+                    IPojoFactory factory = (IPojoFactory) cfs.get(i);
                     m_creator.removeFactory(factory);
                     factory.stop();
                 }
@@ -134,7 +134,7 @@
                         Bundle key = (Bundle) it.next();
                         List list = (List) mft.m_createdFactories.get(key);
                         for (int i = 0; i < list.size(); i++) {
-                            AbstractFactory af = (AbstractFactory) list.get(i);
+                            IPojoFactory af = (IPojoFactory) list.get(i);
                             af.stop();
                             m_unboundTypes.add(new UnboundComponentType(mft.m_type, af.m_componentMetadata, af.getBundleContext().getBundle()));
                         }
@@ -275,7 +275,7 @@
                     Bundle key = (Bundle) it.next();
                     List list = (List) mft.m_createdFactories.get(key);
                     for (int i = 0; i < list.size(); i++) {
-                        AbstractFactory af = (AbstractFactory) list.get(i);
+                        IPojoFactory af = (IPojoFactory) list.get(i);
                         m_creator.removeFactory(af);
                         af.stop();
                     }
@@ -310,7 +310,7 @@
         Class clazz = factoryType.m_clazz;
         try {
             Constructor cst = clazz.getConstructor(new Class[] {BundleContext.class, Element.class});
-            AbstractFactory factory = (AbstractFactory) cst.newInstance(new Object[] { bundle.getBundleContext(), cm});
+            IPojoFactory factory = (IPojoFactory) cst.newInstance(new Object[] { bundle.getBundleContext(), cm});
 
             if (factoryType.m_createdFactories == null) {
                 factoryType.m_createdFactories = new HashMap();

Modified: felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/Handler.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/Handler.java?rev=613250&r1=613249&r2=613250&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/Handler.java (original)
+++ felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/Handler.java Fri Jan 18 12:00:43 2008
@@ -63,24 +63,25 @@
     protected HandlerManager m_instance;
     
     /**
-     * Handler logger.
+     * Set the factory attached to this handler object.
+     * This method must be override to depend on each component factory type. 
+     * @param factory : the factory.
      */
-    private Logger m_logger;
+    public abstract void setFactory(Factory factory);
     
     /**
-     * Set the logger use by this handler.
-     * @param logger : the logger object to use.
+     * Get the logger to use in the handler.
+     * This method must be override to depend on each component factory type logging policy.
+     * @return the logger.
      */
-    public final void setLogger(Logger logger) {
-        m_logger = logger;
-    }
+    public abstract Logger getLogger();
     
     /**
      * Log method (warning).
      * @param message : message to log
      */
     public final void warn(String message) {
-        m_logger.log(Logger.WARNING, message);
+        getLogger().log(Logger.WARNING, message);
     }
     
     /**
@@ -88,7 +89,7 @@
      * @param message : message to log
      */
     public final void error(String message) {
-        m_logger.log(Logger.ERROR, message);
+        getLogger().log(Logger.ERROR, message);
     }
     
     /**
@@ -96,7 +97,7 @@
      * @param message : message to log
      */
     public final void info(String message) {
-        m_logger.log(Logger.INFO, message);
+        getLogger().log(Logger.INFO, message);
     }
     
     /**
@@ -105,7 +106,7 @@
      * @param ex : exception to attach to the message
      */
     public final void warn(String message, Throwable ex) {
-        m_logger.log(Logger.WARNING, message, ex);
+        getLogger().log(Logger.WARNING, message, ex);
     }
     
     /**
@@ -114,7 +115,7 @@
      * @param ex : exception to attach to the message
      */
     public final void error(String message, Throwable ex) {
-        m_logger.log(Logger.ERROR, message, ex);
+        getLogger().log(Logger.ERROR, message, ex);
     }
     
     /**

Modified: felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/HandlerManager.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/HandlerManager.java?rev=613250&r1=613249&r2=613250&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/HandlerManager.java (original)
+++ felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/HandlerManager.java Fri Jan 18 12:00:43 2008
@@ -66,6 +66,7 @@
      */
     public void init(ComponentInstance ci, Element cm, Dictionary configuration) throws ConfigurationException {
         createHandlerObject();
+        m_handler.setFactory(ci.getFactory());
         m_handler.attach(ci);
         m_handler.configure(cm, configuration);
     }

Copied: felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/IPojoFactory.java (from r610817, felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/AbstractFactory.java)
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/IPojoFactory.java?p2=felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/IPojoFactory.java&p1=felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/AbstractFactory.java&r1=610817&r2=613250&rev=613250&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/AbstractFactory.java (original)
+++ felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/IPojoFactory.java Fri Jan 18 12:00:43 2008
@@ -38,7 +38,7 @@
  * This class abstracts iPOJO factories.
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
-public abstract class AbstractFactory implements Factory, ManagedServiceFactory  {
+public abstract class IPojoFactory implements Factory, ManagedServiceFactory  {
     
     /**
      * List of the managed instance name. This list is shared by all factories.
@@ -118,7 +118,7 @@
      * @param cm : description of the component type.
      * @throws ConfigurationException occurs when the element describing the factory is malformed.
      */
-    public AbstractFactory(BundleContext bc, Element cm) throws ConfigurationException {
+    public IPojoFactory(BundleContext bc, Element cm) throws ConfigurationException {
         m_context = bc;
         m_componentMetadata = cm;
         m_factoryName = getFactoryName();
@@ -532,7 +532,7 @@
             HandlerManager hm = getHandler(hi, null);
             Handler ch =  hm.getHandler();
             try {
-                ch.setLogger(getLogger());
+                ch.setFactory(this);
                 ch.initializeComponentFactory(m_componentDesc, m_componentMetadata);
                 ((Pojo) ch).getComponentInstance().dispose();
             } catch (org.apache.felix.ipojo.ConfigurationException e) {

Modified: felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/InstanceCreator.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/InstanceCreator.java?rev=613250&r1=613249&r2=613250&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/InstanceCreator.java (original)
+++ felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/InstanceCreator.java Fri Jan 18 12:00:43 2008
@@ -74,7 +74,7 @@
     synchronized void  addInstance(Dictionary instance, long bundle) {
         ManagedInstance mi = new ManagedInstance(instance, bundle);
         for (int i = 0; i < m_factories.size(); i++) {
-            AbstractFactory factory = (AbstractFactory) m_factories.get(i);
+            IPojoFactory factory = (IPojoFactory) m_factories.get(i);
             if (factory.getState() == Factory.VALID && mi.match(factory)) {
                 try {
                     mi.create(factory);
@@ -113,7 +113,7 @@
         List instanceToRemove = new ArrayList();
         List factoryToRemove = new ArrayList();
         while (it.hasNext()) {
-            AbstractFactory factory = (AbstractFactory) it.next();
+            IPojoFactory factory = (IPojoFactory) it.next();
             List list = (List) m_attachedInstances.get(factory);
             for (int i = 0; i < list.size(); i++) {
                 ManagedInstance mi = (ManagedInstance) list.get(i);
@@ -150,7 +150,7 @@
      * A new factory appears.
      * @param factory : the new factory.
      */
-    void addFactory(AbstractFactory factory) {
+    void addFactory(IPojoFactory factory) {
         m_factories.add(factory);
         synchronized (m_factories) {
             if (factory.getState() == Factory.VALID) {
@@ -163,7 +163,7 @@
      * A factory is leaving.
      * @param factory : the leaving factory
      */
-    void removeFactory(AbstractFactory factory) {
+    void removeFactory(IPojoFactory factory) {
         factory.removeFactoryStateListener(this);
         m_factories.remove(factory);
         onInvalidation(factory);
@@ -174,7 +174,7 @@
      * The given factory becomes valid.
      * @param factory : the factory becoming valid.
      */
-    private void onValidation(AbstractFactory factory) {
+    private void onValidation(IPojoFactory factory) {
         List toRemove = new ArrayList();
         for (int i = 0; i < m_idleInstances.size(); i++) {
             ManagedInstance mi = (ManagedInstance) m_idleInstances.get(i);
@@ -208,7 +208,7 @@
      * The given factory becomes invalid.
      * @param factory : factory which becomes invalid.
      */
-    private void onInvalidation(AbstractFactory factory) {
+    private void onInvalidation(IPojoFactory factory) {
         List instances = (List) m_attachedInstances.remove(factory);
         if (instances != null) {
             for (int i = 0; i < instances.size(); i++) {
@@ -227,9 +227,9 @@
      */
     public void stateChanged(Factory factory, int newState) {
         if (newState == Factory.VALID) {
-            onValidation((AbstractFactory) factory);
+            onValidation((IPojoFactory) factory);
         } else {
-            onInvalidation((AbstractFactory) factory);
+            onInvalidation((IPojoFactory) factory);
         }
     }
 
@@ -251,7 +251,7 @@
         /**
          * Factory used to create the instance.
          */
-        private AbstractFactory m_factory;
+        private IPojoFactory m_factory;
     
         /**
          * Created instance.
@@ -274,7 +274,7 @@
          * Return the used factory name.
          * @return the factory
          */
-        AbstractFactory getFactory() {
+        IPojoFactory getFactory() {
             return m_factory;
         }
     
@@ -293,7 +293,7 @@
          * @param factory : the factory to confront against the current instance.
          * @return true if the factory match.
          */
-        public boolean match(AbstractFactory factory) {
+        public boolean match(IPojoFactory factory) {
             // Test factory name (and classname)
             String component = (String) m_configuration.get("component");
             if (factory.getName().equals(component) || factory.getClassName().equalsIgnoreCase(component)) {
@@ -317,7 +317,7 @@
          * @throws MissingHandlerException occurs when an handler is missing.
          * @throws ConfigurationException occurs when an error appears when configuring the instance.
          */
-        public void create(AbstractFactory factory) throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
+        public void create(IPojoFactory factory) throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
             m_factory = factory;
             m_instance = m_factory.createComponentInstance(m_configuration);
         }

Modified: felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/PrimitiveHandler.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/PrimitiveHandler.java?rev=613250&r1=613249&r2=613250&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/PrimitiveHandler.java (original)
+++ felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/PrimitiveHandler.java Fri Jan 18 12:00:43 2008
@@ -20,6 +20,10 @@
 
 import java.lang.reflect.Method;
 
+import org.apache.felix.ipojo.metadata.Element;
+import org.apache.felix.ipojo.parser.PojoMetadata;
+import org.apache.felix.ipojo.util.Logger;
+
 
 
 /**
@@ -39,6 +43,12 @@
      */
     private InstanceManager m_manager;
     
+    
+    /**
+     * Factory of the instance manager. 
+     */
+    private ComponentFactory m_factory;
+    
     /**
      * Attach the current handler to the given instance.
      * @param im ! the instance on which the current handler will be attached.
@@ -46,11 +56,30 @@
      */
     protected final void attach(ComponentInstance im) {
         m_manager = (InstanceManager) im;
-        setLogger(m_manager.getFactory().getLogger());
+    }
+    
+    public final void setFactory(Factory factory) {
+        m_factory = (ComponentFactory) factory;
+    }
+    
+    public Logger getLogger() {
+        return m_factory.getLogger();
     }
     
     public InstanceManager getInstanceManager() {
         return m_manager;
+    }
+    
+    public ComponentFactory getFactory() {
+        return m_factory;
+    }
+    
+    public Element[] getMetadata() {
+        return null;
+    }
+    
+    public PojoMetadata getPojoMetadata() {
+        return m_factory.getPojoMetadata();
     }
     
     /**

Modified: felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/configuration/ConfigurationHandler.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/configuration/ConfigurationHandler.java?rev=613250&r1=613249&r2=613250&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/configuration/ConfigurationHandler.java (original)
+++ felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/configuration/ConfigurationHandler.java Fri Jan 18 12:00:43 2008
@@ -34,8 +34,8 @@
 import org.apache.felix.ipojo.metadata.Attribute;
 import org.apache.felix.ipojo.metadata.Element;
 import org.apache.felix.ipojo.parser.FieldMetadata;
-import org.apache.felix.ipojo.parser.ManipulationMetadata;
 import org.apache.felix.ipojo.parser.MethodMetadata;
+import org.apache.felix.ipojo.parser.PojoMetadata;
 
 /**
  * Handler managing the Configuration Admin.
@@ -101,7 +101,7 @@
             String value = configurables[i].getAttribute("value");
 
             // Detect the type of the property
-            ManipulationMetadata manipulation = new ManipulationMetadata(metadata);
+            PojoMetadata manipulation = getFactory().getPojoMetadata();
             String type = null;
             if (fieldName != null) {
                 FieldMetadata fm = manipulation.getField(fieldName);

Modified: felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyHandler.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyHandler.java?rev=613250&r1=613249&r2=613250&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyHandler.java (original)
+++ felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/dependency/DependencyHandler.java Fri Jan 18 12:00:43 2008
@@ -30,8 +30,8 @@
 import org.apache.felix.ipojo.architecture.HandlerDescription;
 import org.apache.felix.ipojo.metadata.Element;
 import org.apache.felix.ipojo.parser.FieldMetadata;
-import org.apache.felix.ipojo.parser.ManipulationMetadata;
 import org.apache.felix.ipojo.parser.MethodMetadata;
+import org.apache.felix.ipojo.parser.PojoMetadata;
 import org.osgi.framework.ServiceReference;
 
 /**
@@ -122,7 +122,7 @@
      * @return true if the dependency is valid
      * @throws ConfigurationException : the checked dependency is not correct
      */
-    private boolean checkDependency(Dependency dep, ManipulationMetadata manipulation) throws ConfigurationException {
+    private boolean checkDependency(Dependency dep, PojoMetadata manipulation) throws ConfigurationException {
         // Check the internal type of dependency
         String field = dep.getField();
         DependencyCallback[] callbacks = dep.getCallbacks();
@@ -205,7 +205,8 @@
      * @see org.apache.felix.ipojo.Handler#configure(org.apache.felix.ipojo.InstanceManager, org.apache.felix.ipojo.metadata.Element, java.util.Dictionary)
      */
     public void configure(Element componentMetadata, Dictionary configuration) throws ConfigurationException {
-        ManipulationMetadata manipulation = new ManipulationMetadata(componentMetadata);
+        // getPojoMetadata();
+        PojoMetadata manipulation = getFactory().getPojoMetadata();
         List fl = new ArrayList();
 
         // Create the dependency according to the component metadata

Modified: felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/lifecycle/callback/LifecycleCallbackHandler.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/lifecycle/callback/LifecycleCallbackHandler.java?rev=613250&r1=613249&r2=613250&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/lifecycle/callback/LifecycleCallbackHandler.java (original)
+++ felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/lifecycle/callback/LifecycleCallbackHandler.java Fri Jan 18 12:00:43 2008
@@ -26,8 +26,8 @@
 import org.apache.felix.ipojo.InstanceManager;
 import org.apache.felix.ipojo.PrimitiveHandler;
 import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.parser.ManipulationMetadata;
 import org.apache.felix.ipojo.parser.MethodMetadata;
+import org.apache.felix.ipojo.parser.PojoMetadata;
 
 /**
  * Lifecycle callback handler.
@@ -86,7 +86,7 @@
         String imm = metadata.getAttribute("immediate");
         m_immediate = imm != null && imm.equalsIgnoreCase("true");
         
-        ManipulationMetadata mm = new ManipulationMetadata(metadata);
+        PojoMetadata mm = getFactory().getPojoMetadata();
 
         Element[] hooksMetadata = metadata.getElements("callback");
         for (int i = 0; hooksMetadata != null && i < hooksMetadata.length; i++) {

Modified: felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/lifecycle/controller/ControllerHandler.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/lifecycle/controller/ControllerHandler.java?rev=613250&r1=613249&r2=613250&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/lifecycle/controller/ControllerHandler.java (original)
+++ felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/lifecycle/controller/ControllerHandler.java Fri Jan 18 12:00:43 2008
@@ -27,7 +27,7 @@
 import org.apache.felix.ipojo.architecture.ComponentTypeDescription;
 import org.apache.felix.ipojo.metadata.Element;
 import org.apache.felix.ipojo.parser.FieldMetadata;
-import org.apache.felix.ipojo.parser.ManipulationMetadata;
+import org.apache.felix.ipojo.parser.PojoMetadata;
 
 /**
  * Lifecycle Controller handler.
@@ -124,7 +124,7 @@
             throw new ConfigurationException("Lifecycle controller : the controller element needs to have a field attribute");
         }
         
-        ManipulationMetadata mm = new ManipulationMetadata(metadata);
+        PojoMetadata mm = getFactory().getPojoMetadata();
         FieldMetadata fm = mm.getField(field);
         if (fm == null) {
             throw new ConfigurationException("Lifecycle controller : The field " + field + " does not exist in the class");

Modified: felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceHandler.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceHandler.java?rev=613250&r1=613249&r2=613250&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceHandler.java (original)
+++ felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceHandler.java Fri Jan 18 12:00:43 2008
@@ -40,9 +40,9 @@
 import org.apache.felix.ipojo.metadata.Element;
 import org.apache.felix.ipojo.parser.FieldMetadata;
 import org.apache.felix.ipojo.parser.ManifestMetadataParser;
-import org.apache.felix.ipojo.parser.ManipulationMetadata;
 import org.apache.felix.ipojo.parser.ParseException;
 import org.apache.felix.ipojo.parser.ParseUtils;
+import org.apache.felix.ipojo.parser.PojoMetadata;
 import org.osgi.framework.Bundle;
 
 /**
@@ -508,7 +508,7 @@
     public void initializeComponentFactory(ComponentTypeDescription cd, Element metadata) throws ConfigurationException {
         // Change ComponentInfo
         Element[] provides = metadata.getElements("provides");
-        ManipulationMetadata manipulation = new ManipulationMetadata(metadata);
+        PojoMetadata manipulation = getFactory().getPojoMetadata();
 
         for (int i = 0; i < provides.length; i++) {
          // First : create the serviceSpecification list

Copied: felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/parser/PojoMetadata.java (from r613219, felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/parser/ManipulationMetadata.java)
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/parser/PojoMetadata.java?p2=felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/parser/PojoMetadata.java&p1=felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/parser/ManipulationMetadata.java&r1=613219&r2=613250&rev=613250&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/parser/ManipulationMetadata.java (original)
+++ felix/sandbox/clement/ipojo/core/src/main/java/org/apache/felix/ipojo/parser/PojoMetadata.java Fri Jan 18 12:00:43 2008
@@ -26,7 +26,7 @@
  * 
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
-public class ManipulationMetadata {
+public class PojoMetadata {
     
     /**
      * List of implemented interfaces.
@@ -55,7 +55,7 @@
      * parsing manipulation metadata.
      * @param metadata : component type metadata
      */
-    public ManipulationMetadata(Element metadata) {
+    public PojoMetadata(Element metadata) {
         Element manip = metadata.getElements("manipulation", "")[0];
         m_super = manip.getAttribute("super");
         Element[] fields = manip.getElements("field");

Modified: felix/sandbox/clement/ipojo/event.admin.handler/pom.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/event.admin.handler/pom.xml?rev=613250&r1=613249&r2=613250&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/event.admin.handler/pom.xml (original)
+++ felix/sandbox/clement/ipojo/event.admin.handler/pom.xml Fri Jan 18 12:00:43 2008
@@ -28,9 +28,7 @@
          <version>0.9.0-SNAPSHOT</version>
 	</dependency>
   </dependencies>
-  
 
-  
   <build>
     <plugins>
       <plugin>
@@ -62,4 +60,15 @@
       </plugin>
     </plugins>
   </build>
+  <reporting>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <configuration>
+          <configLocation>http://people.apache.org/~clement/styles/checkstyle_ipojo.xml</configLocation>
+        </configuration>
+      </plugin>
+    </plugins>
+  </reporting>
 </project>

Modified: felix/sandbox/clement/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handler/event/EventAdminSubscriberHandler.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handler/event/EventAdminSubscriberHandler.java?rev=613250&r1=613249&r2=613250&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handler/event/EventAdminSubscriberHandler.java (original)
+++ felix/sandbox/clement/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handler/event/EventAdminSubscriberHandler.java Fri Jan 18 12:00:43 2008
@@ -30,8 +30,8 @@
 import org.apache.felix.ipojo.architecture.ComponentTypeDescription;
 import org.apache.felix.ipojo.architecture.PropertyDescription;
 import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.parser.ManipulationMetadata;
 import org.apache.felix.ipojo.parser.MethodMetadata;
+import org.apache.felix.ipojo.parser.PojoMetadata;
 import org.apache.felix.ipojo.util.Callback;
 import org.osgi.framework.InvalidSyntaxException;
 import org.osgi.service.event.Event;
@@ -92,7 +92,7 @@
 
         // Store the component manager
         m_manager = getInstanceManager();
-        ManipulationMetadata mm = new ManipulationMetadata(metadata);
+        PojoMetadata mm = getFactory().getPojoMetadata();
 
         // Get Metadata subscribers
         Element[] subscribers = metadata.getElements("subscriber", NAMESPACE);

Modified: felix/sandbox/clement/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handler/event/EventAdminSubscriberMetadata.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handler/event/EventAdminSubscriberMetadata.java?rev=613250&r1=613249&r2=613250&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handler/event/EventAdminSubscriberMetadata.java (original)
+++ felix/sandbox/clement/ipojo/event.admin.handler/src/main/java/org/apache/felix/ipojo/handler/event/EventAdminSubscriberMetadata.java Fri Jan 18 12:00:43 2008
@@ -43,7 +43,7 @@
     private Callback m_callback;
 
     /**
-     * Listenned topics.
+     * Listened topics.
      */
     private String m_topics;
 

Modified: felix/sandbox/clement/ipojo/examples/property-handler/PropertyHandler/src/main/java/org/apache/felix/ipojo/handler/properties/PropertiesHandler.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/examples/property-handler/PropertyHandler/src/main/java/org/apache/felix/ipojo/handler/properties/PropertiesHandler.java?rev=613250&r1=613249&r2=613250&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/examples/property-handler/PropertyHandler/src/main/java/org/apache/felix/ipojo/handler/properties/PropertiesHandler.java (original)
+++ felix/sandbox/clement/ipojo/examples/property-handler/PropertyHandler/src/main/java/org/apache/felix/ipojo/handler/properties/PropertiesHandler.java Fri Jan 18 12:00:43 2008
@@ -1,11 +1,11 @@
 package org.apache.felix.ipojo.handler.properties;
 
 import java.io.File;
-import java.io.FileReader;
-import java.io.FileWriter;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
 import java.io.IOException;
-import java.io.Reader;
-import java.io.Writer;
+import java.io.InputStream;
+import java.io.OutputStream;
 import java.util.Dictionary;
 import java.util.Enumeration;
 import java.util.Properties;
@@ -17,7 +17,7 @@
 import org.apache.felix.ipojo.metadata.Attribute;
 import org.apache.felix.ipojo.metadata.Element;
 import org.apache.felix.ipojo.parser.FieldMetadata;
-import org.apache.felix.ipojo.parser.ManipulationMetadata;
+import org.apache.felix.ipojo.parser.PojoMetadata;
 
 /**
  * This handler load a properties file containing property value. The handler injects this values inside fields.
@@ -89,14 +89,14 @@
         // Register fields
         // By convention, properties file entry are field name, so look for each property to get field list.
         
-        //First get manipulation metadata :
-        ManipulationMetadata manipulation = new ManipulationMetadata(metadata);
+        //First get Pojo Metadata metadata :
+        PojoMetadata pojoMeta = getPojoMetadata();
         FieldMetadata[] fields = new FieldMetadata[m_properties.size()]; // Array of field to register.
         int i = 0;
         Enumeration e = m_properties.keys();
         while(e.hasMoreElements()) {
             String field = (String) e.nextElement();
-            FieldMetadata fm = manipulation.getField(field);
+            FieldMetadata fm = pojoMeta.getField(field);
             
             if (fm == null) { // The field does not exist
                 throw new ConfigurationException("The field " + field + " is declared in the properties file but does not exist in the pojo");
@@ -220,8 +220,8 @@
     private void loadProperties() throws IOException {
         // Load the properties file from file system
         File file = new File(m_file);
-        Reader reader = new FileReader(file);
-        m_properties.load(reader);
+        InputStream is = new FileInputStream(file);
+        m_properties.load(is);
     }
     
     /**
@@ -231,8 +231,8 @@
     private void saveProperties() throws IOException {
         // Store the file, modified the last modification date.
         File file = new File(m_file);
-        Writer writer = new FileWriter(file);
-        m_properties.store(writer, "");
+        OutputStream os = new FileOutputStream(file);
+        m_properties.store(os, "");
     }
     
     /**

Modified: felix/sandbox/clement/ipojo/examples/tutorial-maven/hello.impl.annotation/pom.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/examples/tutorial-maven/hello.impl.annotation/pom.xml?rev=613250&r1=613249&r2=613250&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/examples/tutorial-maven/hello.impl.annotation/pom.xml (original)
+++ felix/sandbox/clement/ipojo/examples/tutorial-maven/hello.impl.annotation/pom.xml Fri Jan 18 12:00:43 2008
@@ -45,7 +45,6 @@
           <instructions>
             <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
             <Private-Package>ipojo.example.hello.impl</Private-Package>
-            <Export-Package>ipojo.example.hello</Export-Package> 
           </instructions>
         </configuration>
       </plugin>

Propchange: felix/sandbox/clement/ipojo/extender.pattern.handler/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Jan 18 12:00:43 2008
@@ -1,4 +1,5 @@
-.classpath
-.project
-target*
-bin*
+.classpath
+.project
+target*
+bin*
+.checkstyle

Modified: felix/sandbox/clement/ipojo/extender.pattern.handler/pom.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/extender.pattern.handler/pom.xml?rev=613250&r1=613249&r2=613250&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/extender.pattern.handler/pom.xml (original)
+++ felix/sandbox/clement/ipojo/extender.pattern.handler/pom.xml Fri Jan 18 12:00:43 2008
@@ -62,4 +62,15 @@
       </plugin>
     </plugins>
   </build>
+  <reporting>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <configuration>
+          <configLocation>http://people.apache.org/~clement/styles/checkstyle_ipojo.xml</configLocation>
+        </configuration>
+      </plugin>
+    </plugins>
+  </reporting>
 </project>

Modified: felix/sandbox/clement/ipojo/jmx.handler/pom.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/jmx.handler/pom.xml?rev=613250&r1=613249&r2=613250&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/jmx.handler/pom.xml (original)
+++ felix/sandbox/clement/ipojo/jmx.handler/pom.xml Fri Jan 18 12:00:43 2008
@@ -70,4 +70,15 @@
       		</plugin>
 		</plugins>
 	</build>
+	<reporting>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <configuration>
+          <configLocation>http://people.apache.org/~clement/styles/checkstyle_ipojo.xml</configLocation>
+        </configuration>
+      </plugin>
+    </plugins>
+  </reporting>
 </project>

Modified: felix/sandbox/clement/ipojo/jmx.handler/src/main/java/org/apache/felix/ipojo/handlers/jmx/MBeanHandler.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/jmx.handler/src/main/java/org/apache/felix/ipojo/handlers/jmx/MBeanHandler.java?rev=613250&r1=613249&r2=613250&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/jmx.handler/src/main/java/org/apache/felix/ipojo/handlers/jmx/MBeanHandler.java (original)
+++ felix/sandbox/clement/ipojo/jmx.handler/src/main/java/org/apache/felix/ipojo/handlers/jmx/MBeanHandler.java Fri Jan 18 12:00:43 2008
@@ -27,8 +27,8 @@
 import org.apache.felix.ipojo.PrimitiveHandler;
 import org.apache.felix.ipojo.metadata.Element;
 import org.apache.felix.ipojo.parser.FieldMetadata;
-import org.apache.felix.ipojo.parser.ManipulationMetadata;
 import org.apache.felix.ipojo.parser.MethodMetadata;
+import org.apache.felix.ipojo.parser.PojoMetadata;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceRegistration;
 
@@ -43,7 +43,7 @@
      */
     private InstanceManager m_instanceManager;
     /**
-     * ServiceRegistration : use to register and deregister the Dynamic MBean.
+     * ServiceRegistration : use to register and unregister the Dynamic MBean.
      */
     private ServiceRegistration m_serviceRegistration;
     /**
@@ -66,7 +66,7 @@
      */
     public void configure(Element metadata, Dictionary dict) {
         
-        ManipulationMetadata manipulation = new ManipulationMetadata(metadata);
+        PojoMetadata manipulation = getPojoMetadata();
         
         m_instanceManager = getInstanceManager();
 
@@ -214,7 +214,7 @@
      * @param manipulation : metadata extract from metadata.xml file
      * @return          : type of the field or null if it wasn't found
      */
-    private static String getTypeFromAttributeField(String fieldRequire, ManipulationMetadata manipulation) {
+    private static String getTypeFromAttributeField(String fieldRequire, PojoMetadata manipulation) {
         
         FieldMetadata field = manipulation.getField(fieldRequire);
         if (field == null) {
@@ -231,7 +231,7 @@
      * @param description  : description which appears in jmx console
      * @return          : array of methods with the right name
      */
-    private MethodField[] getMethodsFromName(String methodName, ManipulationMetadata manipulation, String description) {
+    private MethodField[] getMethodsFromName(String methodName, PojoMetadata manipulation, String description) {
         
         MethodMetadata[] fields = manipulation.getMethods(methodName);
         if (fields.length == 0) {

Modified: felix/sandbox/clement/ipojo/manipulator/pom.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/manipulator/pom.xml?rev=613250&r1=613249&r2=613250&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/manipulator/pom.xml (original)
+++ felix/sandbox/clement/ipojo/manipulator/pom.xml Fri Jan 18 12:00:43 2008
@@ -10,8 +10,8 @@
   <packaging>bundle</packaging>
   <artifactId>org.apache.felix.ipojo.manipulator</artifactId>
   <version>0.7.6-SNAPSHOT</version>
-  <name>Apache Felix iPOJO Manipulator</name>
-  
+  <name>Apache Felix iPOJO Manipulator</name>
+  
   
   <dependencies>
     <dependency>
@@ -22,12 +22,12 @@
     <dependency>
       <groupId>asm</groupId>
       <artifactId>asm-commons</artifactId>
-      <version>3.0</version>
-      <exclusions>
-    	<exclusion>
-      		<groupId>asm</groupId>
-      		<artifactId>asm-tree</artifactId>
-    	</exclusion>
+      <version>3.0</version>
+      <exclusions>
+    	<exclusion>
+      		<groupId>asm</groupId>
+      		<artifactId>asm-tree</artifactId>
+    	</exclusion>
   	   </exclusions>
     </dependency>
     <dependency>
@@ -61,4 +61,15 @@
       </plugin>
     </plugins>
   </build>
+  <reporting>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <configuration>
+          <configLocation>http://people.apache.org/~clement/styles/checkstyle_ipojo.xml</configLocation>
+        </configuration>
+      </plugin>
+    </plugins>
+  </reporting>
 </project>

Modified: felix/sandbox/clement/ipojo/metadata/pom.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/metadata/pom.xml?rev=613250&r1=613249&r2=613250&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/metadata/pom.xml (original)
+++ felix/sandbox/clement/ipojo/metadata/pom.xml Fri Jan 18 12:00:43 2008
@@ -28,4 +28,15 @@
   	</plugin>
   </plugins>
   </build>
+  <reporting>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <configuration>
+          <configLocation>http://people.apache.org/~clement/styles/checkstyle_ipojo.xml</configLocation>
+        </configuration>
+      </plugin>
+    </plugins>
+  </reporting>
 </project>

Modified: felix/sandbox/clement/ipojo/plugin/pom.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/plugin/pom.xml?rev=613250&r1=613249&r2=613250&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/plugin/pom.xml (original)
+++ felix/sandbox/clement/ipojo/plugin/pom.xml Fri Jan 18 12:00:43 2008
@@ -15,6 +15,7 @@
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-plugin-api</artifactId>
       <version>2.0</version>
+      <scope>compile</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
@@ -47,4 +48,15 @@
       <version>0.7.6-SNAPSHOT</version>
     </dependency>
   </dependencies>
+  <reporting>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <configuration>
+          <configLocation>http://people.apache.org/~clement/styles/checkstyle_ipojo.xml</configLocation>
+        </configuration>
+      </plugin>
+    </plugins>
+  </reporting>
 </project>

Modified: felix/sandbox/clement/ipojo/plugin/src/main/java/org/apache/felix/ipojo/plugin/ManipulatorMojo.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/plugin/src/main/java/org/apache/felix/ipojo/plugin/ManipulatorMojo.java?rev=613250&r1=613249&r2=613250&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/plugin/src/main/java/org/apache/felix/ipojo/plugin/ManipulatorMojo.java (original)
+++ felix/sandbox/clement/ipojo/plugin/src/main/java/org/apache/felix/ipojo/plugin/ManipulatorMojo.java Fri Jan 18 12:00:43 2008
@@ -1,4 +1,4 @@
-/*
+/* 
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -25,7 +25,6 @@
 import org.apache.felix.ipojo.manipulator.Pojoization;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.MavenProjectHelper;
 
@@ -113,11 +112,10 @@
 
     /**
      * Execute method : launch the pojoization.
-     * @throws MojoExecutionException : an exception occurs.
-     * @throws MojoFailureException : an failure occurs.
+     * @throws MojoExecutionException : an exception occurs during the manipulation.
      * @see org.apache.maven.plugin.AbstractMojo#execute()
      */
-    public void execute() throws MojoExecutionException, MojoFailureException {
+    public void execute() throws MojoExecutionException {
         // ignore project types not supported, useful when the plugin is configured in the parent pom
         if (!this.m_supportedProjectTypes.contains(this.getProject().getArtifact().getType())) {
             this.getLog().debug("Ignoring project " + this.getProject().getArtifact() + " : type " + this.getProject().getArtifact().getType() + " is not supported by ipojo plugin, supported types are " + this.m_supportedProjectTypes);

Modified: felix/sandbox/clement/ipojo/pom.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/pom.xml?rev=613250&r1=613249&r2=613250&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/pom.xml (original)
+++ felix/sandbox/clement/ipojo/pom.xml Fri Jan 18 12:00:43 2008
@@ -53,4 +53,5 @@
 		</modules>
 	</profile>
   </profiles>
+  
 </project>

Propchange: felix/sandbox/clement/ipojo/white.board.pattern.handler/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Jan 18 12:00:43 2008
@@ -1,5 +1,6 @@
-target*
-bin*
-.settings
-.project
-.classpath
+target*
+bin*
+.settings
+.project
+.classpath
+.checkstyle

Modified: felix/sandbox/clement/ipojo/white.board.pattern.handler/pom.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/white.board.pattern.handler/pom.xml?rev=613250&r1=613249&r2=613250&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/white.board.pattern.handler/pom.xml (original)
+++ felix/sandbox/clement/ipojo/white.board.pattern.handler/pom.xml Fri Jan 18 12:00:43 2008
@@ -29,8 +29,6 @@
 	</dependency>
   </dependencies>
   
-
-  
   <build>
     <plugins>
       <plugin>
@@ -62,4 +60,15 @@
       </plugin>
     </plugins>
   </build>
+  <reporting>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <configuration>
+          <configLocation>http://people.apache.org/~clement/styles/checkstyle_ipojo.xml</configLocation>
+        </configuration>
+      </plugin>
+    </plugins>
+  </reporting>
 </project>

Modified: felix/sandbox/clement/ipojo/white.board.pattern.handler/src/main/java/org/apache/felix/ipojo/handler/wbp/WhiteBoardManager.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/white.board.pattern.handler/src/main/java/org/apache/felix/ipojo/handler/wbp/WhiteBoardManager.java?rev=613250&r1=613249&r2=613250&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/white.board.pattern.handler/src/main/java/org/apache/felix/ipojo/handler/wbp/WhiteBoardManager.java (original)
+++ felix/sandbox/clement/ipojo/white.board.pattern.handler/src/main/java/org/apache/felix/ipojo/handler/wbp/WhiteBoardManager.java Fri Jan 18 12:00:43 2008
@@ -1,3 +1,21 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.felix.ipojo.handler.wbp;
 
 import java.lang.reflect.InvocationTargetException;
@@ -9,15 +27,50 @@
 import org.osgi.framework.Filter;
 import org.osgi.framework.ServiceReference;
 
+/**
+ * Manage a white board pattern.
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
 public class WhiteBoardManager implements TrackerCustomizer {
     
+    /**
+     * monitored filter. 
+     */
     private Filter m_filter;
+    
+    /**
+     * onArrival method. 
+     */
     private Callback m_onArrival;
+    
+    /**
+     * onDeparture method. 
+     */
     private Callback m_onDeparture;
+    
+    /**
+     * onModify method. 
+     */
     private Callback m_onModification;
+    
+    /**
+     * Service Tracker. 
+     */
     private Tracker m_tracker;
+    
+    /**
+     * Attached handler. 
+     */
     private PrimitiveHandler m_handler;
     
+    /**
+     * Constructor.
+     * @param handler : attached handler
+     * @param filter : monitored filter
+     * @param bind : onArrival method
+     * @param unbind : onDeparture method
+     * @param modification : onModify method
+     */
     public WhiteBoardManager(WhiteBoardPatternHandler handler, Filter filter, String bind, String unbind, String modification) {
         m_handler = handler;
         m_onArrival = new Callback(bind, new Class[] {ServiceReference.class}, false, m_handler.getInstanceManager());
@@ -29,14 +82,25 @@
         m_tracker = new Tracker(handler.getInstanceManager().getContext(), m_filter, this);
     }
     
+    /**
+     * Open the tracker.
+     */
     public void start() {
         m_tracker.open();
     }
     
+    /**
+     * Close the tracker.
+     */
     public void stop() {
         m_tracker.close();
     }
 
+    /**
+     * A new service was added to the tracker.
+     * @param arg0 : service reference.
+     * @see org.apache.felix.ipojo.util.TrackerCustomizer#addedService(org.osgi.framework.ServiceReference)
+     */
     public void addedService(ServiceReference arg0) {
         try {
             m_onArrival.call(new Object[] {arg0});
@@ -52,10 +116,22 @@
         }
     }
 
+    /**
+     * A new service is detected.
+     * @param arg0 : service reference
+     * @return true to add the service
+     * @see org.apache.felix.ipojo.util.TrackerCustomizer#addingService(org.osgi.framework.ServiceReference)
+     */
     public boolean addingService(ServiceReference arg0) {
         return true;
     }
 
+    /**
+     * An existing service was modified.
+     * @param arg0 : service reference
+     * @param arg1 : service object (if already get)
+     * @see org.apache.felix.ipojo.util.TrackerCustomizer#modifiedService(org.osgi.framework.ServiceReference, java.lang.Object)
+     */
     public void modifiedService(ServiceReference arg0, Object arg1) {
         if (m_onModification != null) {
             try {
@@ -73,6 +149,12 @@
         }
     }
 
+    /**
+     * A service disappears.
+     * @param arg0 : service reference
+     * @param arg1 : service object (if already get)
+     * @see org.apache.felix.ipojo.util.TrackerCustomizer#removedService(org.osgi.framework.ServiceReference, java.lang.Object)
+     */
     public void removedService(ServiceReference arg0, Object arg1) {
         try {
             m_onDeparture.call(new Object[] {arg0});

Modified: felix/sandbox/clement/ipojo/white.board.pattern.handler/src/main/java/org/apache/felix/ipojo/handler/wbp/WhiteBoardPatternHandler.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/ipojo/white.board.pattern.handler/src/main/java/org/apache/felix/ipojo/handler/wbp/WhiteBoardPatternHandler.java?rev=613250&r1=613249&r2=613250&view=diff
==============================================================================
--- felix/sandbox/clement/ipojo/white.board.pattern.handler/src/main/java/org/apache/felix/ipojo/handler/wbp/WhiteBoardPatternHandler.java (original)
+++ felix/sandbox/clement/ipojo/white.board.pattern.handler/src/main/java/org/apache/felix/ipojo/handler/wbp/WhiteBoardPatternHandler.java Fri Jan 18 12:00:43 2008
@@ -1,3 +1,21 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.felix.ipojo.handler.wbp;
 
 import java.util.ArrayList;
@@ -9,14 +27,32 @@
 import org.apache.felix.ipojo.metadata.Element;
 import org.osgi.framework.InvalidSyntaxException;
 
+/**
+ * White board pattern handler.
+ * This handler aims to automate white board patterns by invoking callback when needed.
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
 public class WhiteBoardPatternHandler extends PrimitiveHandler {
     
-    public final static String NAMESPACE = "org.apache.felix.ipojo.white-board-pattern";
+    /**
+     * Handler namespace.
+     */
+    public static final String NAMESPACE = "org.apache.felix.ipojo.white-board-pattern";
     
+    /**
+     * White board pattern to manage. By default just one. 
+     */
     private List m_managers = new ArrayList(1);
 
+    /**
+     * Configure method. It will parse metadata to analyze org.apache.felix.ipojo.white-board-pattern:wbp element. 
+     * @param elem : component type description
+     * @param dict : instance description
+     * @throws ConfigurationException : occurs when the description is not valid.
+     * @see org.apache.felix.ipojo.Handler#configure(org.apache.felix.ipojo.metadata.Element, java.util.Dictionary)
+     */
     public void configure(Element elem, Dictionary dict) throws ConfigurationException {
-        Element[] elems = elem.getElements("wbp",NAMESPACE);
+        Element[] elems = elem.getElements("wbp", NAMESPACE);
         for (int i = 0; i < elems.length; i++) {
             String filter = elems[i].getAttribute("filter");
             String onArrival = elems[i].getAttribute("onArrival");
@@ -40,12 +76,20 @@
         
     }
 
+    /**
+     * Start method : start managers.
+     * @see org.apache.felix.ipojo.Handler#start()
+     */
     public void start() {
         for (int i = 0; i < m_managers.size(); i++) {
             ((WhiteBoardManager) m_managers.get(i)).start();
         }
     }
 
+    /**
+     * Stop method : stop managers.
+     * @see org.apache.felix.ipojo.Handler#stop()
+     */
     public void stop() {
         for (int i = 0; i < m_managers.size(); i++) {
             ((WhiteBoardManager) m_managers.get(i)).stop();



Mime
View raw message