View Javadoc
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
8       implements Startable
9   {
10  
11      private Thread lookupThread;
12  
13      public synchronized void start()
14          throws StartingException
15      {
16      }
17  
18      public synchronized void stop()
19          throws StoppingException
20      {
21          lookupThread.start();
22          try
23          {
24              lookupThread.join();
25          }
26          catch ( InterruptedException e )
27          {
28              throw new StoppingException( "Can't stop lookupThread", e );
29          }
30      }
31  
32      public synchronized void setLookupThread( Thread lookupThread )
33      {
34          this.lookupThread = lookupThread;
35      }
36  
37  }