felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r548724 - in /felix/trunk/dependencymanager/src/main/java/org/apache/felix/dependencymanager: ConfigurationDependency.java SerialExecutor.java ServiceImpl.java
Date Tue, 19 Jun 2007 13:41:25 GMT
Author: marrs
Date: Tue Jun 19 06:41:23 2007
New Revision: 548724

URL: http://svn.apache.org/viewvc?view=rev&rev=548724
Log:
Removed a couple of print statements from the code.

Modified:
    felix/trunk/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ConfigurationDependency.java
    felix/trunk/dependencymanager/src/main/java/org/apache/felix/dependencymanager/SerialExecutor.java
    felix/trunk/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ServiceImpl.java

Modified: felix/trunk/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ConfigurationDependency.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ConfigurationDependency.java?view=diff&rev=548724&r1=548723&r2=548724
==============================================================================
--- felix/trunk/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ConfigurationDependency.java
(original)
+++ felix/trunk/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ConfigurationDependency.java
Tue Jun 19 06:41:23 2007
@@ -79,7 +79,6 @@
 	}
 
 	public void updated(Dictionary settings) throws ConfigurationException {
-		System.out.println("Updating " + settings);
 		// if non-null settings come in, we have to instantiate the service and
 		// apply these settings
 		((ServiceImpl) m_service).initService();

Modified: felix/trunk/dependencymanager/src/main/java/org/apache/felix/dependencymanager/SerialExecutor.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/src/main/java/org/apache/felix/dependencymanager/SerialExecutor.java?view=diff&rev=548724&r1=548723&r2=548724
==============================================================================
--- felix/trunk/dependencymanager/src/main/java/org/apache/felix/dependencymanager/SerialExecutor.java
(original)
+++ felix/trunk/dependencymanager/src/main/java/org/apache/felix/dependencymanager/SerialExecutor.java
Tue Jun 19 06:41:23 2007
@@ -66,83 +66,4 @@
             active.run();
         }
     }
-    
-    /*
-    class SerialExecutor implements Executor {
-        final Queue<Runnable> tasks = new LinkedBlockingQueue<Runnable>();
-        final Executor executor;
-        Runnable active;
-
-        SerialExecutor(Executor executor) {
-            this.executor = executor;
-        }
-
-        public synchronized void execute(final Runnable r) {
-            tasks.offer(new Runnable() {
-                public void run() {
-                    try {
-                        r.run();
-                    } finally {
-                        scheduleNext();
-                    }
-                }
-            });
-            if (active == null) {
-                scheduleNext();
-            }
-        }
-
-        protected synchronized void scheduleNext() {
-            if ((active = tasks.poll()) != null) {
-                executor.execute(active);
-            }
-        }
-    }
-    */
-
-
-    // just some test code ;)
-    public static void main(String[] args) {
-    	final SerialExecutor se = new SerialExecutor();
-    	(new Thread("T1") { public void run() {
-    		for (int i = 0; i < 100; i++) {
-    			final int nr = i;
-	    		se.enqueue(new Runnable() { public void run() {
-	    			System.out.println("A" + nr + ":" + Thread.currentThread().getName());
-	    			if (nr % 10 == 5) {
-	    	    		try { Thread.sleep(10); } catch (InterruptedException ie) {}
-	    			}
-	    		}});
-	    		try { Thread.sleep(1); } catch (InterruptedException ie) {}
-	    		se.execute();
-    		}
-    		System.out.println("A is done");
-    	}}).start();
-		try { Thread.sleep(5); } catch (InterruptedException ie) {}
-    	(new Thread("T2") { public void run() {
-    		for (int i = 0; i < 100; i++) {
-    			final int nr = i;
-	    		se.enqueue(new Runnable() { public void run() {
-	    			System.out.println("B" + nr + ":" + Thread.currentThread().getName());
-	    			if (nr % 19 == 6) {
-	    	    		try { Thread.sleep(20); } catch (InterruptedException ie) {}
-	    			}
-	    		}});
-	    		try { Thread.sleep(1); } catch (InterruptedException ie) {}
-	    		se.execute();
-    		}
-    		System.out.println("B is done");
-    	}}).start();
-		try { Thread.sleep(5); } catch (InterruptedException ie) {}
-    	(new Thread("T3") { public void run() {
-    		for (int i = 0; i < 100; i++) {
-    			final int nr = i;
-	    		se.enqueue(new Runnable() { public void run() {
-	    			System.out.println("C" + nr + ":" + Thread.currentThread().getName());
-	    		}});
-	    		se.execute();
-    		}
-    		System.out.println("C is done");
-    	}}).start();
-    }
 }

Modified: felix/trunk/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ServiceImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ServiceImpl.java?view=diff&rev=548724&r1=548723&r2=548724
==============================================================================
--- felix/trunk/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ServiceImpl.java
(original)
+++ felix/trunk/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ServiceImpl.java
Tue Jun 19 06:41:23 2007
@@ -470,7 +470,6 @@
 	}
 
 	private void activateService(State state) {
-		System.out.println("!!!!! activateService: " + this + " " + state);
 		String init, start;
 		synchronized (this) {
 			init = m_callbackInit;
@@ -541,24 +540,10 @@
                 }
             }
             catch (Exception e) {
-                // TODO handle this exception
-                // e.printStackTrace();
-                // TODO remove line below!!!
                 throw new RuntimeException(e);
             }
         }
     }
-    
-//    private boolean allRequiredDependenciesAvailable() {
-//        Iterator i = getDependencies().iterator();
-//        while (i.hasNext()) {
-//            Dependency dependency = (Dependency) i.next();
-//            if (dependency.isRequired() && !dependency.isAvailable()) {
-//                return false;
-//            }
-//        }
-//        return true;
-//    }
     
     private void startTrackingOptional(State state) {
         Iterator i = state.getDependencies().iterator();



Mime
View raw message