1
package com.eucalyptus.component.event;
4
import java.net.URISyntaxException;
5
import org.apache.log4j.Logger;
6
import com.eucalyptus.component.Component;
7
import com.eucalyptus.component.ServiceConfiguration;
8
import com.eucalyptus.config.LocalConfiguration;
10
public class StartComponentEvent extends LifecycleEvent {
11
private static Logger LOG = Logger.getLogger( StartComponentEvent.class );
12
public static StartComponentEvent getLocal( ServiceConfiguration config ) {
15
uri = new URI( config.getUri( ) );
16
} catch ( URISyntaxException e ) {
17
LOG.fatal( "Failed to construct a valid URL from a component configuration", e );
19
return new StartComponentEvent( new LocalConfiguration( config.getComponent( ), uri ), config.getComponent(), true );
21
public static StartComponentEvent getLocal( com.eucalyptus.bootstrap.Component c ) {
22
return new StartComponentEvent( new LocalConfiguration( c, c.getLocalUri( ) ), c, true );
24
public static StartComponentEvent getLocal( Component c ) {
25
return new StartComponentEvent( new LocalConfiguration( c.getPeer( ), c.getConfiguration( ).getLocalUri( ) ), c.getPeer( ), true );
27
public static StartComponentEvent getRemote( ServiceConfiguration config ) {
28
return new StartComponentEvent( config, config.getComponent( ), false );
31
private StartComponentEvent( ServiceConfiguration configuration, com.eucalyptus.bootstrap.Component component, boolean local ) {
32
super( configuration, component.name( ), local );
35
public String toString( ) {
36
return "Start" + super.toString( );