JMACS

org.jmacs.pd
Class StartProgram

java.lang.Object
  extended by org.jmacs.pd.StartProgram
All Implemented Interfaces:
Serializable

public class StartProgram
extends Object
implements Serializable

immutable command to start the specified program.

Version:
$Id: StartProgram.java 2050 2007-08-09 18:58:16Z rob $
Author:
Rob Dickens
See Also:
Serialized Form

Constructor Summary
StartProgram(String classname, URL codebaseUrl)
          creates new instance.
StartProgram(URL url)
          creates new instance.
 
Method Summary
 IProgram createProgram()
          returns a new instance of the program.
static IProgram createProgram(String classname, URL codebaseUrl)
          returns a new instance of the specified program, using a new classloader so as to ensure we get the latest version.
static IProgram createProgram(URL url)
          deserialises and returns a new instance of the specified serialised program.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StartProgram

public StartProgram(URL url)
creates new instance.

Parameters:
url - of serialised program instance.

StartProgram

public StartProgram(String classname,
                    URL codebaseUrl)
creates new instance.

Parameters:
classname - fully qualified, of program
codebaseUrl - from which class should be loaded
Method Detail

createProgram

public static IProgram createProgram(String classname,
                                     URL codebaseUrl)
                              throws ClassNotFoundException,
                                     InstantiationException,
                                     IllegalAccessException
returns a new instance of the specified program, using a new classloader so as to ensure we get the latest version. The classloader's parent will be the context classloader.

Throws:
ClassNotFoundException
InstantiationException
IllegalAccessException

createProgram

public static IProgram createProgram(URL url)
                              throws ClassNotFoundException,
                                     IOException
deserialises and returns a new instance of the specified serialised program.

Throws:
ClassNotFoundException
IOException

createProgram

public IProgram createProgram()
                       throws IOException,
                              ClassNotFoundException,
                              InstantiationException,
                              IllegalAccessException
returns a new instance of the program.

Throws:
IOException
ClassNotFoundException
InstantiationException
IllegalAccessException

JMACS

jmacs.org