class SparkRunConfigurationExecutor implements RunConfigurationExecutor {

  @Override public void execute( RunConfiguration runConfiguration, ExecutionConfiguration configuration,
                                 AbstractMeta meta, VariableSpace variableSpace, Repository repository ) {

    // Check to see if the ael-security feature is installed. If it is, then install the jaas capability if it is
    // not already installed
    ICapability securityCapability = capabilityManager.getCapabilityById( AEL_SECURITY_CAPABILITY_ID );
    ICapability jaasCapability = capabilityManager.getCapabilityById( JAAS_CAPABILITY_ID );
    if ( securityCapability != null && securityCapability.isInstalled() ) {
      if ( jaasCapability != null && !jaasCapability.isInstalled() ) {
        jaasCapability.install();
      }
    }

    SparkRunConfiguration sparkRunConfiguration = (SparkRunConfiguration) runConfiguration;

    String runConfigSchema = Const.NVL( sparkRunConfiguration.getSchema(), "" );
    String runConfigURL = Const.NVL( sparkRunConfiguration.getUrl(), "" );
    URI uri = URI.create( runConfigSchema.trim() + runConfigURL.trim() );
    String protocol = uri.getScheme();
    String host = uri.getHost();
    String port = uri.getPort() == -1 ? null : String.valueOf( uri.getPort() );

    // Variables for Websocket spark engine version
    variableSpace.setVariable( "engine.protocol", Const.NVL( protocol, DEFAULT_PROTOCOL ) );
    variableSpace.setVariable( "engine.host", Const.NVL( host, DEFAULT_HOST ) );
    variableSpace.setVariable( "engine.port", Const.NVL( port, DEFAULT_WEBSOCKET_PORT ) );

    // Sets the appropriate variables on the transformation for the spark engine
    variableSpace.setVariable( "engine", "remote" );
    variableSpace.setVariable( "engine.remote", "spark" );
  }

  public  SparkRunConfigurationExecutor( ConfigurationAdmin configurationAdmin );

}