1 package org.codehaus.plexus.component.registry;
2
3 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Startable;
4 import org.codehaus.plexus.personality.plexus.lifecycle.phase.StartingException;
5 import org.codehaus.plexus.personality.plexus.lifecycle.phase.StoppingException;
6
7 public class TestSynchronizedComponent implements Startable {
8
9 private Thread lookupThread;
10
11 public synchronized void start() throws StartingException {}
12
13 public synchronized void stop() throws StoppingException {
14 lookupThread.start();
15 try {
16 lookupThread.join();
17 } catch (InterruptedException e) {
18 throw new StoppingException("Can't stop lookupThread", e);
19 }
20 }
21
22 public synchronized void setLookupThread(Thread lookupThread) {
23 this.lookupThread = lookupThread;
24 }
25 }