~tritone-team/tritone/eucalyptus

« back to all changes in this revision

Viewing changes to clc/modules/www/src/main/java/com/eucalyptus/bootstrap/HttpServerBootstrapper.java

  • Committer: Bazaar Package Importer
  • Author(s): Dustin Kirkland
  • Date: 2009-12-01 21:09:28 UTC
  • mto: This revision was merged to the branch mainline in revision 75.
  • Revision ID: james.westby@ubuntu.com-20091201210928-o2dvg0ubljhb0ft6
Tags: upstream-1.6.1~bzr1083
ImportĀ upstreamĀ versionĀ 1.6.1~bzr1083

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
package com.eucalyptus.bootstrap;
62
62
 
63
63
import java.net.URL;
 
64
import java.util.concurrent.Executor;
64
65
 
65
66
import org.apache.log4j.Logger;
66
67
import org.mortbay.jetty.Server;
67
68
import org.mortbay.xml.XmlConfiguration;
68
69
 
 
70
import java.util.concurrent.ExecutorService;
 
71
import java.util.concurrent.Executors;
 
72
 
69
73
@Provides( component = Component.jetty )
70
74
@Depends( local=Component.eucalyptus )
71
75
public class HttpServerBootstrapper extends Bootstrapper {
72
76
  private static Logger                   LOG = Logger.getLogger( HttpServerBootstrapper.class );
73
77
  private static Server jettyServer;
74
 
 
 
78
  private ExecutorService exec;
75
79
  @Override
76
80
  public boolean load( Resource current ) throws Exception {
77
81
    jettyServer = new org.mortbay.jetty.Server( );
84
88
  @Override
85
89
  public boolean start( ) throws Exception {
86
90
    LOG.info( "Starting admin interface." );
87
 
    jettyServer.start( );
88
 
    return false;
 
91
    exec = Executors.newFixedThreadPool( 1 );
 
92
    exec.execute( new Runnable( ) {
 
93
      @Override
 
94
      public void run( ) {
 
95
        try {
 
96
          jettyServer.start( );
 
97
        } catch ( Exception e ) {
 
98
          LOG.debug( e, e );
 
99
        }
 
100
      }
 
101
    });
 
102
    return true;
89
103
  }
90
104
 
91
105
}