felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pde...@apache.org
Subject svn commit: r1640052 - in /felix/sandbox/pderop/dependencymanager-prototype: org.apache.felix.dependencymanager.runtime/src/org/apache/felix/dm/runtime/ org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/customdep...
Date Sun, 16 Nov 2014 23:38:48 GMT
Author: pderop
Date: Sun Nov 16 23:38:48 2014
New Revision: 1640052

URL: http://svn.apache.org/r1640052
Log:
Refactored the AbstractDependency class, which was too complex.
Removed unecessary methods in ComponentContext, and in DependendencyContext interfaces.

Modified:
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime/src/org/apache/felix/dm/runtime/ToggleServiceDependency.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/customdep/PathDependency.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/context/AbstractDependency.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/context/ComponentContext.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/context/DependencyContext.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/BundleDependencyImpl.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ComponentImpl.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ConfigurationDependencyImpl.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/FilterComponent.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ResourceDependencyImpl.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ServiceDependencyImpl.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/TemporalServiceDependencyImpl.java
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/test/test/SimpleServiceDependency.java

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime/src/org/apache/felix/dm/runtime/ToggleServiceDependency.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime/src/org/apache/felix/dm/runtime/ToggleServiceDependency.java?rev=1640052&r1=1640051&r2=1640052&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime/src/org/apache/felix/dm/runtime/ToggleServiceDependency.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.runtime/src/org/apache/felix/dm/runtime/ToggleServiceDependency.java Sun Nov 16 23:38:48 2014
@@ -82,9 +82,9 @@ public class ToggleServiceDependency ext
 
     public void activate(boolean active) {
         if (active) {
-            add(new ToggleEvent());
+            m_component.handleAdded(this, new ToggleEvent());
         } else {
-            remove(new ToggleEvent());
+            m_component.handleRemoved(this, new ToggleEvent());
         }
     }
 

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/customdep/PathDependency.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/customdep/PathDependency.java?rev=1640052&r1=1640051&r2=1640052&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/customdep/PathDependency.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.samples/src/org/apache/felix/dependencymanager/samples/customdep/PathDependency.java Sun Nov 16 23:38:48 2014
@@ -92,9 +92,15 @@ public class PathDependency extends Abst
         m_thread.interrupt();
     }
     
-    public boolean invoke(String method, Event e, Object[] instances) {
+    public void invokeAdd(Event e) {
+        if (m_add != null) {
+            invoke(m_add, e, getInstances());
+        }
+    }
+    
+    private void invoke(String method, Event e, Object[] instances) {
         // specific for this type of dependency
-        return m_component.invokeCallbackMethod(instances, method, 
+        m_component.invokeCallbackMethod(instances, method, 
             new Class[][] { {String.class}, 
                             {}}, 
             new Object[][] { { e.getEvent() }, 
@@ -118,9 +124,9 @@ public class PathDependency extends Abst
 						continue;
 					}
 					if (StandardWatchEventKinds.ENTRY_CREATE == kind) {
-						add(new PathEvent(event.context().toString()));
+				        m_component.handleAdded(this, new PathEvent(event.context().toString()));
 					} else if (StandardWatchEventKinds.ENTRY_DELETE == kind) {
-						remove(new PathEvent(event.context().toString()));
+					    m_component.handleRemoved(this, new PathEvent(event.context().toString()));
 					}
 				}
 				

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/context/AbstractDependency.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/context/AbstractDependency.java?rev=1640052&r1=1640051&r2=1640052&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/context/AbstractDependency.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/context/AbstractDependency.java Sun Nov 16 23:38:48 2014
@@ -18,7 +18,6 @@
  */
 package org.apache.felix.dm.context;
 
-import java.util.Arrays;
 import java.util.Collection;
 import java.util.Dictionary;
 import java.util.Hashtable;
@@ -27,12 +26,10 @@ import java.util.Set;
 
 import org.apache.felix.dm.ComponentDependencyDeclaration;
 import org.apache.felix.dm.Dependency;
-import org.apache.felix.dm.impl.AbstractDecorator;
 import org.apache.felix.dm.impl.EventImpl;
 import org.apache.felix.dm.impl.Logger;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
-import org.osgi.service.log.LogService;
 
 /**
  * Abstract class for implementing Dependencies
@@ -130,98 +127,19 @@ public abstract class AbstractDependency
     // -------------- DependencyContext -----------------------------------------------
 
     @Override
-    public void invokeAdd(Event e) {
-        if (m_add != null) {
-            // If the add callback is not found and if the component instance is not an abstract decorator, then
-            // log a warn message. (AbstractDecorator, like Aspect or Adapter are not interested in user dependency callbacks).
-            if (! invoke(m_add, e) && ! (m_component.getInstance() instanceof AbstractDecorator)) {
-                callbackNotFound(m_add);
-            }
-        }
+    public void invokeAdd(Event e) {        
     }
 
     @Override
-    public void invokeChange(Event e) {
-        if (m_change != null) {
-            // If the change callback is not found and if the component instance is not an abstract decorator, then
-            // log a warn message. (AbstractDecorator, like Aspect or Adapter are not interested in user dependency callbacks).
-            if (! invoke(m_change, e) && ! (m_component.getInstance() instanceof AbstractDecorator)) {
-                callbackNotFound(m_change);
-            }
-        }
+    public void invokeChange(Event e) {        
     }
 
     @Override
-    public void invokeRemove(Event e) {
-        if (m_remove != null) {
-            // If the remove callback is not found and if the component instance is not an abstract decorator, then
-            // log a warn message. (AbstractDecorator, like Aspect or Adapter are not interested in user dependency callbacks).
-            if (! invoke(m_remove, e) && ! (m_component.getInstance() instanceof AbstractDecorator)) {
-                callbackNotFound(m_remove);
-            }
-        }
+    public void invokeRemove(Event e) {        
     }
 
     @Override
-    public void invokeSwap(Event event, Event newEvent) {
-        // Has to be implemented by sub classes
-        throw new IllegalStateException("This method must be implemented by the class " + getClass().getName());
-    }
-
-    public void add(final Event e) {
-        // since this method can be invoked by anyone from any thread, we need to
-        // pass on the event to a runnable that we execute using the component's
-        // executor
-        m_component.getExecutor().execute(new Runnable() {
-            @Override
-            public void run() {
-                m_component.handleAdded(AbstractDependency.this, e);
-            }
-        });
-    }
-
-    public void change(final Event e) {
-        // since this method can be invoked by anyone from any thread, we need to
-        // pass on the event to a runnable that we execute using the component's
-        // executor
-        m_component.getExecutor().execute(new Runnable() {
-            @Override
-            public void run() {
-                m_component.handleChanged(AbstractDependency.this, e);
-            }
-        });
-    }
-
-    public void remove(final Event e) {
-        // since this method can be invoked by anyone from any thread, we need to
-        // pass on the event to a runnable that we execute using the component's
-        // executor
-        m_component.getExecutor().execute(new Runnable() {
-            @Override
-            public void run() {
-                try {
-                    m_component.handleRemoved(AbstractDependency.this, e);
-                } finally {
-                    e.close();
-                }
-            }
-        });
-    }
-
-    public void swap(final Event event, final Event newEvent) {
-        // since this method can be invoked by anyone from any thread, we need to
-        // pass on the event to a runnable that we execute using the component's
-        // executor
-        m_component.getExecutor().execute(new Runnable() {
-            @Override
-            public void run() {
-                try {
-                    m_component.handleSwapped(AbstractDependency.this, event, newEvent);
-                } finally {
-                    event.close();
-                }
-            }
-        });
+    public void invokeSwap(Event event, Event newEvent) {        
     }
 
     @Override
@@ -255,21 +173,6 @@ public abstract class AbstractDependency
         m_available = available;
     }
 
-    @SuppressWarnings("unchecked")
-    public T setPropagate(boolean propagate) {
-        ensureNotActive();
-        m_propagate = propagate;
-        return (T) this;
-    }
-
-    @SuppressWarnings("unchecked")
-    public T setPropagate(Object instance, String method) {
-        setPropagate(instance != null && method != null);
-        m_propagateCallbackInstance = instance;
-        m_propagateCallbackMethod = method;
-        return (T) this;
-    }
-
     public boolean isInstanceBound() {
         return m_instanceBound;
     }
@@ -278,53 +181,6 @@ public abstract class AbstractDependency
         m_instanceBound = instanceBound;
     }
 
-    public T setCallbacks(String add, String remove) {
-        return setCallbacks(add, null, remove);
-    }
-
-    public T setCallbacks(String add, String change, String remove) {
-        return setCallbacks(null, add, change, remove);
-    }
-
-    public T setCallbacks(Object instance, String add, String remove) {
-        return setCallbacks(instance, add, null, remove);
-    }
-
-    @SuppressWarnings("unchecked")
-    public T setCallbacks(Object instance, String add, String change, String remove) {
-        if ((add != null || change != null || remove != null) && !m_autoConfigInvoked) {
-            setAutoConfig(false);
-        }
-        m_callbackInstance = instance;
-        m_add = add;
-        m_change = change;
-        m_remove = remove;
-        return (T) this;
-    }
-
-    public Object[] getInstances() {
-        if (m_callbackInstance == null) {
-            return m_component.getInstances();
-        } else {
-            return new Object[] { m_callbackInstance };
-        }
-    }
-
-    public boolean invoke(String method, Event e, Object[] instances) {
-        // specific for this type of dependency
-        return m_component.invokeCallbackMethod(instances, method, new Class[][] { {} }, new Object[][] { {} });
-    }
-
-    public boolean invoke(String method, Event e) {
-        return invoke(method, e, getInstances());
-    }
-
-    @SuppressWarnings("unchecked")
-    public T setRequired(boolean required) {
-        m_required = required;
-        return (T) this;
-    }
-
     @Override
     public boolean needsInstance() {
         return false;
@@ -335,21 +191,6 @@ public abstract class AbstractDependency
         return null; // must be implemented by subclasses if autoconfig mode is enabled
     }
 
-    @SuppressWarnings("unchecked")
-    public T setAutoConfig(boolean autoConfig) {
-        m_autoConfig = autoConfig;
-        m_autoConfigInvoked = true;
-        return (T) this;
-    }
-
-    @SuppressWarnings("unchecked")
-    public T setAutoConfig(String instanceName) {
-        m_autoConfig = (instanceName != null);
-        m_autoConfigInstance = instanceName;
-        m_autoConfigInvoked = true;
-        return (T) this;
-    }
-
     @Override
     public Event getService() {
         Event event = m_component.getDependencyEvent(this);
@@ -392,26 +233,6 @@ public abstract class AbstractDependency
         }
     }
 
-    public ComponentContext getComponentContext() {
-        return m_component;
-    }
-
-    protected Object getDefaultService(boolean nullObject) {
-        return null;
-    }
-
-    protected void ensureNotActive() {
-        if (isStarted()) {
-            throw new IllegalStateException("Cannot modify state while active.");
-        }
-    }
-
-    protected void startTracking() {
-    }
-
-    protected void stopTracking() {
-    }
-
     @Override
     public abstract DependencyContext createCopy();
 
@@ -443,15 +264,93 @@ public abstract class AbstractDependency
         }
     }
     
-    // -------------- Private methods ---------------------------------------------------
+    // -------------- Methods common to sub interfaces of Dependendency
     
-    private void callbackNotFound(String callback) {
-        if (m_logger == null) {
-            System.out.println("Dependency \"" + callback + "\" callback not found on componnent instances "
-                + Arrays.toString(m_component.getInstances()));
+    @SuppressWarnings("unchecked")
+    public T setPropagate(boolean propagate) {
+        ensureNotActive();
+        m_propagate = propagate;
+        return (T) this;
+    }
+
+    @SuppressWarnings("unchecked")
+    public T setPropagate(Object instance, String method) {
+        setPropagate(instance != null && method != null);
+        m_propagateCallbackInstance = instance;
+        m_propagateCallbackMethod = method;
+        return (T) this;
+    }
+    
+    public T setCallbacks(String add, String remove) {
+        return setCallbacks(add, null, remove);
+    }
+
+    public T setCallbacks(String add, String change, String remove) {
+        return setCallbacks(null, add, change, remove);
+    }
+
+    public T setCallbacks(Object instance, String add, String remove) {
+        return setCallbacks(instance, add, null, remove);
+    }
+
+    @SuppressWarnings("unchecked")
+    public T setCallbacks(Object instance, String add, String change, String remove) {
+        if ((add != null || change != null || remove != null) && !m_autoConfigInvoked) {
+            setAutoConfig(false);
+        }
+        m_callbackInstance = instance;
+        m_add = add;
+        m_change = change;
+        m_remove = remove;
+        return (T) this;
+    }
+
+    public Object[] getInstances() {
+        if (m_callbackInstance == null) {
+            return m_component.getInstances();
         } else {
-            m_logger.log(LogService.LOG_ERROR, "Dependency \"" + callback + "\" callback not found on componnent instances "
-                + Arrays.toString(m_component.getInstances()));
+            return new Object[] { m_callbackInstance };
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public T setRequired(boolean required) {
+        m_required = required;
+        return (T) this;
+    }
+
+    @SuppressWarnings("unchecked")
+    public T setAutoConfig(boolean autoConfig) {
+        m_autoConfig = autoConfig;
+        m_autoConfigInvoked = true;
+        return (T) this;
+    }
+
+    @SuppressWarnings("unchecked")
+    public T setAutoConfig(String instanceName) {
+        m_autoConfig = (instanceName != null);
+        m_autoConfigInstance = instanceName;
+        m_autoConfigInvoked = true;
+        return (T) this;
+    }
+
+    public ComponentContext getComponentContext() {
+        return m_component;
+    }
+
+    protected Object getDefaultService(boolean nullObject) {
+        return null;
+    }
+
+    protected void ensureNotActive() {
+        if (isStarted()) {
+            throw new IllegalStateException("Cannot modify state while active.");
         }
     }
+
+    protected void startTracking() {
+    }
+
+    protected void stopTracking() {
+    }
 }

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/context/ComponentContext.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/context/ComponentContext.java?rev=1640052&r1=1640051&r2=1640052&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/context/ComponentContext.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/context/ComponentContext.java Sun Nov 16 23:38:48 2014
@@ -25,7 +25,6 @@ import java.util.concurrent.Executor;
 import org.apache.felix.dm.Component;
 
 public interface ComponentContext extends Component {
-    public Executor getExecutor(); // shared between a component and its dependencies
     public Component setThreadPool(Executor threadPool);
     public void start();
     public void stop();
@@ -36,7 +35,7 @@ public interface ComponentContext extend
     public void handleRemoved(DependencyContext dc, Event e);
     public void handleSwapped(DependencyContext dc, Event event, Event newEvent);
     public List<DependencyContext> getDependencies(); // for testing only...
-    public boolean invokeCallbackMethod(Object[] instances, String methodName, Class<?>[][] signatures, Object[][] parameters);
+    public void invokeCallbackMethod(Object[] instances, String methodName, Class<?>[][] signatures, Object[][] parameters);
     public Object[] getInstances();
     public String getAutoConfigInstance(Class<?> clazz);
     public boolean getAutoConfig(Class<?> clazz);

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/context/DependencyContext.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/context/DependencyContext.java?rev=1640052&r1=1640051&r2=1640052&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/context/DependencyContext.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/context/DependencyContext.java Sun Nov 16 23:38:48 2014
@@ -24,16 +24,11 @@ import java.util.Map;
 
 import org.apache.felix.dm.Dependency;
 
-
 public interface DependencyContext extends Dependency {
 	public void invokeAdd(Event e);
 	public void invokeChange(Event e);
 	public void invokeRemove(Event e);
 	public void invokeSwap(Event event, Event newEvent);
-	/** Whenever the dependency changes state, this method is invoked with the Event containing the new state information. */
-	public void add(final Event e);
-	public void change(final Event e);
-	public void remove(final Event e);
 	public void setComponentContext(ComponentContext component);
 	/** Invoked by the component when the dependency should start working. */
 	public void start();

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/BundleDependencyImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/BundleDependencyImpl.java?rev=1640052&r1=1640051&r2=1640052&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/BundleDependencyImpl.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/BundleDependencyImpl.java Sun Nov 16 23:38:48 2014
@@ -156,26 +156,45 @@ public class BundleDependencyImpl extend
     }
     
     public void addedBundle(Bundle bundle, BundleEvent event, Object object) {
-        add(new BundleEventImpl(bundle, event));
+        m_component.handleAdded(this, new BundleEventImpl(bundle, event));
     }
         
     public void modifiedBundle(Bundle bundle, BundleEvent event, Object object) {
-        change(new BundleEventImpl(bundle, event));
+        m_component.handleChanged(this, new BundleEventImpl(bundle, event));
     }
 
     public void removedBundle(Bundle bundle, BundleEvent event, Object object) {
-        remove(new BundleEventImpl(bundle, event));
+        m_component.handleRemoved(this, new BundleEventImpl(bundle, event));
     }
     
     @Override
-    public boolean invoke(String method, Event e) {
+    public void invokeAdd(Event e) {
+        if (m_add != null) {
+            invoke(m_add, e);
+        }
+    }
+    
+    @Override
+    public void invokeChange(Event e) {
+        if (m_change != null) {
+            invoke (m_change, e);
+        }
+    }
+
+    @Override
+    public void invokeRemove(Event e) {
+        if (m_remove != null) {
+            invoke (m_remove, e);
+        }
+    }
+        
+    private void invoke(String method, Event e) {
         BundleEventImpl be = (BundleEventImpl) e;
-        return m_component.invokeCallbackMethod(getInstances(), method,
+        m_component.invokeCallbackMethod(getInstances(), method,
             new Class[][] {{Bundle.class}, {Object.class}, {}},             
-            new Object[][] {{be.getBundle()}, {be.getBundle()}, {}}
-        );
-    }  
-        
+            new Object[][] {{be.getBundle()}, {be.getBundle()}, {}});
+    }
+    
     public BundleDependency setBundle(Bundle bundle) {
         m_bundleId = bundle.getBundleId();
         return this;

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ComponentImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ComponentImpl.java?rev=1640052&r1=1640051&r2=1640052&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ComponentImpl.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ComponentImpl.java Sun Nov 16 23:38:48 2014
@@ -50,12 +50,14 @@ import org.apache.felix.dm.ComponentStat
 import org.apache.felix.dm.ComponentStateListener;
 import org.apache.felix.dm.Dependency;
 import org.apache.felix.dm.DependencyManager;
+import org.apache.felix.dm.context.AbstractDependency;
 import org.apache.felix.dm.context.ComponentContext;
 import org.apache.felix.dm.context.DependencyContext;
 import org.apache.felix.dm.context.Event;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceRegistration;
+import org.osgi.service.log.LogService;
 
 public class ComponentImpl implements Component, ComponentContext, ComponentDeclaration {
 	private static final ServiceRegistration NULL_REGISTRATION = (ServiceRegistration) Proxy
@@ -164,11 +166,6 @@ public class ComponentImpl implements Co
         m_id = m_idGenerator.getAndIncrement();
     }
 
-    @Override
-    public Executor getExecutor() {
-		return m_executor;
-	}
-		
 	@Override
 	public Component add(final Dependency ... dependencies) {
 		getExecutor().execute(new Runnable() {
@@ -254,7 +251,19 @@ public class ComponentImpl implements Co
 	}
 
 	@Override
-	public void handleAdded(DependencyContext dc, Event e) {
+	public void handleAdded(final DependencyContext dc, final Event e) {
+        // since this method can be invoked by anyone from any thread, we need to
+        // pass on the event to a runnable that we execute using the component's
+        // executor
+	    getExecutor().execute(new Runnable() {
+            @Override
+            public void run() {
+                doHandleAdded(dc, e);
+            }
+        });
+	}
+	
+	private void doHandleAdded(DependencyContext dc, Event e) {
 	    if (! m_isStarted) {
 	        return;
 	    }
@@ -304,7 +313,19 @@ public class ComponentImpl implements Co
 	}
 		
     @Override
-    public void handleChanged(DependencyContext dc, Event e) {
+    public void handleChanged(final DependencyContext dc, final Event e) {
+        // since this method can be invoked by anyone from any thread, we need to
+        // pass on the event to a runnable that we execute using the component's
+        // executor
+        getExecutor().execute(new Runnable() {
+            @Override
+            public void run() {
+                doHandleChanged(dc, e);
+            }
+        });  
+    }
+        
+    private void doHandleChanged(DependencyContext dc, Event e) {
         if (! m_isStarted) {
             return;
         }
@@ -332,7 +353,23 @@ public class ComponentImpl implements Co
     }
 
     @Override
-    public void handleRemoved(DependencyContext dc, Event e) {
+    public void handleRemoved(final DependencyContext dc, final Event e) {
+        // since this method can be invoked by anyone from any thread, we need to
+        // pass on the event to a runnable that we execute using the component's
+        // executor
+        getExecutor().execute(new Runnable() {
+            @Override
+            public void run() {
+                try {
+                    doHandleRemoved(dc, e);
+                } finally {
+                    e.close();
+                }
+            }
+        });
+    }
+    
+    private void doHandleRemoved(DependencyContext dc, Event e) {
         if (! m_isStarted) {
             return;
         }
@@ -376,7 +413,24 @@ public class ComponentImpl implements Co
         }
     }
 
-    public void handleSwapped(DependencyContext dc, Event event, Event newEvent) {
+    @Override
+    public void handleSwapped(final DependencyContext dc, final Event event, final Event newEvent) {
+        // since this method can be invoked by anyone from any thread, we need to
+        // pass on the event to a runnable that we execute using the component's
+        // executor
+        getExecutor().execute(new Runnable() {
+            @Override
+            public void run() {
+                try {
+                    doHandleSwapped(dc, event, newEvent);
+                } finally {
+                    event.close();
+                }
+            }
+        });  
+    }
+    
+    private void doHandleSwapped(DependencyContext dc, Event event, Event newEvent) {
         if (! m_isStarted) {
             return;
         }
@@ -858,7 +912,8 @@ public class ComponentImpl implements Co
             try {
                 invokeCallbackMethod(instances, name, 
                     new Class[][] {{ Component.class }, {}}, 
-                    new Object[][] {{ this }, {}});
+                    new Object[][] {{ this }, {}},
+                    false);
             } finally {
                 long t2 = System.nanoTime();
                 m_stopwatch.put(name, t2 - t1);
@@ -876,7 +931,12 @@ public class ComponentImpl implements Co
     	return getCompositionInstances();
     }
     
-    public boolean invokeCallbackMethod(Object[] instances, String methodName, Class<?>[][] signatures, Object[][] parameters) {
+    public void invokeCallbackMethod(Object[] instances, String methodName, Class<?>[][] signatures, Object[][] parameters) {
+        invokeCallbackMethod(instances, methodName, signatures, parameters, true);
+    }
+
+    public void invokeCallbackMethod(Object[] instances, String methodName, Class<?>[][] signatures,
+        Object[][] parameters, boolean logIfNotFound) {
         boolean callbackFound = false;
         for (int i = 0; i < instances.length; i++) {
             try {
@@ -894,10 +954,22 @@ public class ComponentImpl implements Co
                 m_logger.log(Logger.LOG_ERROR, "Could not invoke '" + methodName + "'.", e);
             }
         }
-        return callbackFound;
+        
+        // If the callback is not found, we don't log if the method is on an AbstractDecorator.
+        // (Aspect or Adapter are not interested in user dependency callbacks)        
+        if (logIfNotFound && ! callbackFound && ! (getInstance() instanceof AbstractDecorator)) {
+            if (m_logger == null) {
+                System.out.println("Callback \"" + methodName + "\" not found on componnent instances "
+                    + Arrays.toString(getInstances()));
+            } else {
+                m_logger.log(LogService.LOG_ERROR, "Callback \"" + methodName + "\" callback not found on componnent instances "
+                    + Arrays.toString(getInstances()));
+            }
+
+        }
     }
 
-    private Object createInstance(Class<?> clazz) throws SecurityException, NoSuchMethodException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
+   private Object createInstance(Class<?> clazz) throws SecurityException, NoSuchMethodException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
 		Constructor<?> constructor = clazz.getConstructor(VOID);
 		constructor.setAccessible(true);
         return constructor.newInstance();
@@ -1278,4 +1350,8 @@ public class ComponentImpl implements Co
     public Map<String, Long> getCallbacksTime() {
         return m_stopwatch;
     }
+    
+    private Executor getExecutor() {
+        return m_executor;
+    }        
 }

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ConfigurationDependencyImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ConfigurationDependencyImpl.java?rev=1640052&r1=1640051&r2=1640052&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ConfigurationDependencyImpl.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ConfigurationDependencyImpl.java Sun Nov 16 23:38:48 2014
@@ -197,17 +197,17 @@ public class ConfigurationDependencyImpl
 
         if ((oldSettings == null) && (settings != null)) {
             // Notify the component that our dependency is available.
-            add(new ConfigurationEventImpl(m_pid, settings));
+            m_component.handleAdded(this, new ConfigurationEventImpl(m_pid, settings));
         }
         else if ((oldSettings != null) && (settings != null)) {
             // Notify the component that our dependency has changed.
-            change(new ConfigurationEventImpl(m_pid, settings));
+            m_component.handleChanged(this, new ConfigurationEventImpl(m_pid, settings));
         }
         else if ((oldSettings != null) && (settings == null)) {
             // Notify the component that our dependency has been removed.
             // Notice that the component will be stopped, and then all required dependencies will be unbound
             // (including our configuration dependency).
-            remove(new ConfigurationEventImpl(m_pid, oldSettings));
+            m_component.handleRemoved(this, new ConfigurationEventImpl(m_pid, oldSettings));
         }
     }
 

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/FilterComponent.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/FilterComponent.java?rev=1640052&r1=1640051&r2=1640052&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/FilterComponent.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/FilterComponent.java Sun Nov 16 23:38:48 2014
@@ -228,8 +228,8 @@ public class FilterComponent implements 
         m_component.stop();
     }
     
-    public boolean invokeCallbackMethod(Object[] instances, String methodName, Class<?>[][] signatures, Object[][] parameters) {
-        return m_component.invokeCallbackMethod(instances, methodName, signatures, parameters);
+    public void invokeCallbackMethod(Object[] instances, String methodName, Class<?>[][] signatures, Object[][] parameters) {
+        m_component.invokeCallbackMethod(instances, methodName, signatures, parameters);
     }
         
     public DependencyManager getDependencyManager() {
@@ -277,11 +277,6 @@ public class FilterComponent implements 
     public BundleContext getBundleContext() {
         return m_component.getBundleContext();
     }
-
-    @Override
-    public Executor getExecutor() {
-        return m_component.getExecutor();
-    }
         
     @Override
     public boolean isActive() {

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ResourceDependencyImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ResourceDependencyImpl.java?rev=1640052&r1=1640051&r2=1640052&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ResourceDependencyImpl.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ResourceDependencyImpl.java Sun Nov 16 23:38:48 2014
@@ -81,47 +81,67 @@ public class ResourceDependencyImpl exte
 
     public void added(URL resource) {
         if (m_trackedResource == null || m_trackedResource.equals(resource)) {
-            add(new ResourceEventImpl(resource, null));
+            getComponentContext().handleAdded(this, new ResourceEventImpl(resource, null));
         }
     }
     
     public void added(URL resource, Dictionary<String, ?> resourceProperties) {
         if (m_trackedResource == null || m_trackedResource.equals(resource)) {
-            add(new ResourceEventImpl(resource, resourceProperties));
+            getComponentContext().handleAdded(this, new ResourceEventImpl(resource, resourceProperties));
         }
     }
         
     public void changed(URL resource) {
         if (m_trackedResource == null || m_trackedResource.equals(resource)) {
-            change(new ResourceEventImpl(resource, null));
+            m_component.handleChanged(this, new ResourceEventImpl(resource, null));
         }
     }
     
     public void changed(URL resource, Dictionary<String, ?> resourceProperties) {
         if (m_trackedResource == null || m_trackedResource.equals(resource)) {
-            change(new ResourceEventImpl(resource, resourceProperties));
+            m_component.handleChanged(this, new ResourceEventImpl(resource, resourceProperties));
         }
     }
 
     public void removed(URL resource) {
         if (m_trackedResource == null || m_trackedResource.equals(resource)) {
-            remove(new ResourceEventImpl(resource, null));
+            m_component.handleRemoved(this, new ResourceEventImpl(resource, null));
         }
     }
     
     public void removed(URL resource, Dictionary<String, ?> resourceProperties) {
         if (m_trackedResource == null || m_trackedResource.equals(resource)) {
-            remove(new ResourceEventImpl(resource, resourceProperties));
+            m_component.handleRemoved(this, new ResourceEventImpl(resource, resourceProperties));
         }
     }
     
     @Override
-    public boolean invoke(String method, Event e) {
+    public void invokeAdd(Event e) {
+        if (m_add != null) {
+            invoke(m_add, e);
+        }
+    }
+
+    @Override
+    public void invokeChange(Event e) {
+        if (m_change != null) {
+            invoke (m_change, e);
+        }
+    }
+
+    @Override
+    public void invokeRemove(Event e) {
+        if (m_remove != null) {
+            invoke (m_remove, e);
+        }
+    }
+    
+    private void invoke(String method, Event e) {
         ResourceEventImpl re = (ResourceEventImpl) e;
         URL serviceInstance = re.getResource();
         Dictionary<?,?> resourceProperties = re.getProperties();
        
-        return m_component.invokeCallbackMethod(getInstances(), method,
+        m_component.invokeCallbackMethod(getInstances(), method,
             new Class[][] {
                     { Component.class, URL.class, Dictionary.class }, 
                     { Component.class, URL.class },

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ServiceDependencyImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ServiceDependencyImpl.java?rev=1640052&r1=1640051&r2=1640052&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ServiceDependencyImpl.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ServiceDependencyImpl.java Sun Nov 16 23:38:48 2014
@@ -36,7 +36,6 @@ import org.apache.felix.dm.context.Depen
 import org.apache.felix.dm.context.Event;
 import org.apache.felix.dm.tracker.ServiceTracker;
 import org.apache.felix.dm.tracker.ServiceTrackerCustomizer;
-import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
 import org.osgi.framework.InvalidSyntaxException;
@@ -249,65 +248,49 @@ public class ServiceDependencyImpl exten
 		if (debug) {
 			System.out.println(debugKey + " addedService: ref=" + reference + ", service=" + service);
 		}
-		add(new ServiceEventImpl(m_bundle, m_context, reference, service));
+		m_component.handleAdded(this, new ServiceEventImpl(m_bundle, m_context, reference, service));
 	}
 
 	@Override
 	public void modifiedService(ServiceReference reference, Object service) {
-		change(new ServiceEventImpl(m_bundle, m_context, reference, service));
+	    m_component.handleChanged(this, new ServiceEventImpl(m_bundle, m_context, reference, service));
 	}
 
 	@Override
 	public void removedService(ServiceReference reference, Object service) {
-		remove(new ServiceEventImpl(m_bundle, m_context, reference, service));
+	    m_component.handleRemoved(this, new ServiceEventImpl(m_bundle, m_context, reference, service));
 	}
 	
 	@Override
-	public boolean invoke(String method, Event e, Object[] instances) {
-		ServiceEventImpl se = (ServiceEventImpl) e;
-		ServicePropertiesMap propertiesMap = new ServicePropertiesMap(se.getReference());
-		Dictionary<?,?> properties = se.getProperties();
-		return m_component.invokeCallbackMethod(instances, method,
-		    new Class[][]{
-                {Component.class, ServiceReference.class, m_trackedServiceName},
-                {Component.class, ServiceReference.class, Object.class}, 
-                {Component.class, ServiceReference.class},
-                {Component.class, m_trackedServiceName}, 
-                {Component.class, Object.class}, 
-                {Component.class},
-                {Component.class, Map.class, m_trackedServiceName},
-                {ServiceReference.class, m_trackedServiceName},
-                {ServiceReference.class, Object.class}, 
-                {ServiceReference.class},
-                {m_trackedServiceName}, 
-                {m_trackedServiceName, Map.class}, 
-                {Map.class, m_trackedServiceName}, 
-                {m_trackedServiceName, Dictionary.class}, 
-                {Dictionary.class, m_trackedServiceName}, 
-                {Object.class}, 
-                {}},
-            
-            new Object[][]{
-		        {m_component, se.getReference(), se.getEvent()},
-		        {m_component, se.getReference(), se.getEvent()}, 
-		        {m_component, se.getReference()}, 
-		        {m_component, se.getEvent()},
-		        {m_component, se.getEvent()},
-		        {m_component},
-		        {m_component, propertiesMap, se.getEvent()},
-		        {se.getReference(), se.getEvent()},
-		        {se.getReference(), se.getEvent()}, 
-		        {se.getReference()}, 
-		        {se.getEvent()}, 
-		        {se.getEvent(), propertiesMap},
-		        {propertiesMap, se.getEvent()},
-                {se.getEvent(), properties},
-                {properties, se.getEvent()},
-                {se.getEvent()}, 
-		        {}}
-		);
+    public void invokeAdd(Event e) {
+        if (m_add != null) {
+            invoke (m_add, e, getInstances());
+        }
+    }
+	
+	@Override
+	public void invokeChange(Event e) {
+	    if (m_change != null) {
+	        invoke (m_change, e, getInstances());
+	    }
 	}
-		
+
+	@Override
+	public void invokeRemove(Event e) {
+	    if (m_remove != null) {
+	        invoke (m_remove, e, getInstances());
+	    }
+	}
+	
+    @Override   
+    public void invokeSwap(Event event, Event newEvent) {
+        if (m_swap != null) {
+            ServiceEventImpl oldE = (ServiceEventImpl) event;
+            ServiceEventImpl newE = (ServiceEventImpl) newEvent;
+            invokeSwap(m_swap, oldE.getReference(), oldE.getEvent(), newE.getReference(), newE.getEvent(), getInstances());
+        }
+    }
+
 	@Override
     public Class<?> getAutoConfigType() {
         return m_trackedServiceName;
@@ -481,13 +464,51 @@ public class ServiceDependencyImpl exten
         return m_defaultImplementationInstance;
     }
 
-    @Override   
-    public void invokeSwap(Event event, Event newEvent) {
-        ServiceEventImpl oldE = (ServiceEventImpl) event;
-        ServiceEventImpl newE = (ServiceEventImpl) newEvent;
-        invokeSwap(m_swap, oldE.getReference(), oldE.getEvent(), newE.getReference(), newE.getEvent(), getInstances());
+    public void invoke(String method, Event e, Object[] instances) {
+        ServiceEventImpl se = (ServiceEventImpl) e;
+        ServicePropertiesMap propertiesMap = new ServicePropertiesMap(se.getReference());
+        Dictionary<?,?> properties = se.getProperties();
+        m_component.invokeCallbackMethod(instances, method,
+            new Class[][]{
+                {Component.class, ServiceReference.class, m_trackedServiceName},
+                {Component.class, ServiceReference.class, Object.class}, 
+                {Component.class, ServiceReference.class},
+                {Component.class, m_trackedServiceName}, 
+                {Component.class, Object.class}, 
+                {Component.class},
+                {Component.class, Map.class, m_trackedServiceName},
+                {ServiceReference.class, m_trackedServiceName},
+                {ServiceReference.class, Object.class}, 
+                {ServiceReference.class},
+                {m_trackedServiceName}, 
+                {m_trackedServiceName, Map.class}, 
+                {Map.class, m_trackedServiceName}, 
+                {m_trackedServiceName, Dictionary.class}, 
+                {Dictionary.class, m_trackedServiceName}, 
+                {Object.class}, 
+                {}},
+            
+            new Object[][]{
+                {m_component, se.getReference(), se.getEvent()},
+                {m_component, se.getReference(), se.getEvent()}, 
+                {m_component, se.getReference()}, 
+                {m_component, se.getEvent()},
+                {m_component, se.getEvent()},
+                {m_component},
+                {m_component, propertiesMap, se.getEvent()},
+                {se.getReference(), se.getEvent()},
+                {se.getReference(), se.getEvent()}, 
+                {se.getReference()}, 
+                {se.getEvent()}, 
+                {se.getEvent(), propertiesMap},
+                {propertiesMap, se.getEvent()},
+                {se.getEvent(), properties},
+                {properties, se.getEvent()},
+                {se.getEvent()}, 
+                {}}
+        );
     }
-
+        
     public void invokeSwap(String swapMethod, ServiceReference previousReference, Object previous,
 			ServiceReference currentReference, Object current, Object[] instances) {
     	if (debug) {
@@ -526,7 +547,7 @@ public class ServiceDependencyImpl exten
 			// getting out of order.		    		    
 		    // We delegate the swap handling to the ComponentImpl, which is the class responsible for state management.
 		    // The ComponentImpl will first check if the component is in the proper state so the swap method can be invoked.		    
-		    swap(new ServiceEventImpl(m_bundle, m_context, reference, service), new ServiceEventImpl(m_bundle, m_context, newReference, newService));
+		    m_component.handleSwapped(this, new ServiceEventImpl(m_bundle, m_context, reference, service), new ServiceEventImpl(m_bundle, m_context, newReference, newService));
 		} else {
 			addedService(newReference, newService);
 			removedService(reference, service);

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/TemporalServiceDependencyImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/TemporalServiceDependencyImpl.java?rev=1640052&r1=1640051&r2=1640052&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/TemporalServiceDependencyImpl.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/TemporalServiceDependencyImpl.java Sun Nov 16 23:38:48 2014
@@ -95,7 +95,7 @@ public class TemporalServiceDependencyIm
             }
         }
         if (makeAvailable) {
-            add(new ServiceEventImpl(m_bundle, m_context, ref, m_serviceInstance));
+            getComponentContext().handleAdded(this, new ServiceEventImpl(m_bundle, m_context, ref, m_serviceInstance));
         } else {
             // This added will possibly unblock our invoke() method (if it's blocked in m_tracker.waitForService method).
         }
@@ -130,7 +130,7 @@ public class TemporalServiceDependencyIm
                 }
             }
             if (makeUnavailable) {
-                remove(new ServiceEventImpl(m_bundle, m_context, ref, m_serviceInstance)); // will unget the service ref
+                m_component.handleRemoved(this, new ServiceEventImpl(m_bundle, m_context, ref, m_serviceInstance)); // will unget the service ref
             }
         } else {
             // Unget what we got in addingService (see ServiceTracker 701.4.1)

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/test/test/SimpleServiceDependency.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/test/test/SimpleServiceDependency.java?rev=1640052&r1=1640051&r2=1640052&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/test/test/SimpleServiceDependency.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager/test/test/SimpleServiceDependency.java Sun Nov 16 23:38:48 2014
@@ -3,6 +3,7 @@ package test;
 import org.apache.felix.dm.Dependency;
 import org.apache.felix.dm.context.AbstractDependency;
 import org.apache.felix.dm.context.DependencyContext;
+import org.apache.felix.dm.context.Event;
 
 public class SimpleServiceDependency extends AbstractDependency<Dependency> {
     @Override
@@ -19,4 +20,46 @@ public class SimpleServiceDependency ext
     public DependencyContext createCopy() {
         return new SimpleServiceDependency();
     }
+    
+    @Override
+    public void invokeAdd(Event e) {
+        if (m_add != null) {
+            invoke (m_add, e, getInstances());
+        }
+    }
+    
+    @Override
+    public void invokeChange(Event e) {
+        if (m_change != null) {
+            invoke (m_change, e, getInstances());
+        }
+    }
+
+    @Override
+    public void invokeRemove(Event e) {
+        if (m_remove != null) {
+            invoke (m_remove, e, getInstances());
+        }
+    }
+
+    public void invoke(String method, Event e, Object[] instances) {
+        // specific for this type of dependency
+        m_component.invokeCallbackMethod(instances, method, new Class[][] { {} }, new Object[][] { {} });
+    }
+
+    public void add(final Event e) {
+        m_component.handleAdded(this, e);
+    }
+    
+    public void change(final Event e) {
+        m_component.handleChanged(this, e);
+    }
+
+    public void remove(final Event e) {
+        m_component.handleRemoved(this, e);
+    }
+    
+    public void swap(final Event event, final Event newEvent) {
+        m_component.handleSwapped(this, event, newEvent);
+    }
 }



Mime
View raw message