All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.cdap.cdap.app.program.Program Maven / Gradle / Ivy

There is a newer version: 6.10.1
Show newest version
/*
 * Copyright © 2014-2015 Cask Data, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package io.cdap.cdap.app.program;

import io.cdap.cdap.api.app.ApplicationSpecification;
import io.cdap.cdap.proto.ProgramType;
import io.cdap.cdap.proto.id.ProgramId;
import org.apache.twill.filesystem.Location;

import java.io.Closeable;

/**
 * Abstraction of a executable program.
 */
public interface Program extends Closeable {

  /**
   * Returns the name of the main class in the program.
   */
  String getMainClassName();

  /**
   * Loads and returns the main class of the program
   * @throws ClassNotFoundException If fails to load the class.
   */
   Class getMainClass() throws ClassNotFoundException;

  /**
   * Returns the program type.
   */
  ProgramType getType();

  /**
   * Returns the program ID.
   */
  ProgramId getId();

  /**
   * Returns name of the program.
   */
  String getName();

  /**
   * Returns the ID of the namespace that this program belongs to.
   */
  String getNamespaceId();

  /**
   * Returns the application ID that this program belongs to.
   */
  String getApplicationId();

  /**
   * Returns the complete application specification that contains this program.
   */
  ApplicationSpecification getApplicationSpecification();

  /**
   * Returns the location of the jar file of this program.
   */
  Location getJarLocation();

  /**
   * Returns the class loader for loading classes inside this program.
   */
  ClassLoader getClassLoader();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy