co.cask.tigon.app.program
Class DefaultProgram

java.lang.Object
  extended by co.cask.tigon.app.program.DefaultProgram
All Implemented Interfaces:
Program

public final class DefaultProgram
extends Object
implements Program

Default implementation of program.


Constructor Summary
DefaultProgram(org.apache.twill.filesystem.Location programJarLocation, ClassLoader classLoader)
           
 
Method Summary
 ClassLoader getClassLoader()
          Returns the class loader for loading classes inside this program.
 String getId()
          Returns the program ID.
 org.apache.twill.filesystem.Location getJarLocation()
          Returns the location of the jar file of this program.
<T> Class<T>
getMainClass()
          Loads and returns the main class of the program
 String getMainClassName()
          Returns the name of the main class in the program.
 String getName()
          Returns name of the program.
 co.cask.tigon.api.flow.FlowSpecification getSpecification()
          Returns the flow specification.
 ProgramType getType()
          Returns the program type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultProgram

public DefaultProgram(org.apache.twill.filesystem.Location programJarLocation,
                      ClassLoader classLoader)
               throws IOException
Throws:
IOException
Method Detail

getMainClassName

public String getMainClassName()
Description copied from interface: Program
Returns the name of the main class in the program.

Specified by:
getMainClassName in interface Program

getMainClass

public <T> Class<T> getMainClass()
                      throws ClassNotFoundException
Description copied from interface: Program
Loads and returns the main class of the program

Specified by:
getMainClass in interface Program
Throws:
ClassNotFoundException - If fails to load the class.

getType

public ProgramType getType()
Description copied from interface: Program
Returns the program type.

Specified by:
getType in interface Program

getId

public String getId()
Description copied from interface: Program
Returns the program ID.

Specified by:
getId in interface Program

getName

public String getName()
Description copied from interface: Program
Returns name of the program.

Specified by:
getName in interface Program

getSpecification

public co.cask.tigon.api.flow.FlowSpecification getSpecification()
Description copied from interface: Program
Returns the flow specification.

Specified by:
getSpecification in interface Program

getJarLocation

public org.apache.twill.filesystem.Location getJarLocation()
Description copied from interface: Program
Returns the location of the jar file of this program.

Specified by:
getJarLocation in interface Program

getClassLoader

public ClassLoader getClassLoader()
Description copied from interface: Program
Returns the class loader for loading classes inside this program.

Specified by:
getClassLoader in interface Program


Copyright © 2014 Cask Data, Inc. Licensed under the Apache License, Version 2.0.