class JVM(object):
    """
    Base class for JVMs.

    Inheriting classes must implement:
      - ``get_commandline(*args, **options)`` to return a commandline that
          contains the options and runs the JVM
    """
    def get_commandline(self, *args, **options):
        """
        Return a commandline that can be executed by ``subprocess.Popen``.

        :param args: positional arguments, will be at the end
        :param options: options which should be presend in the command line
        :returns: commandline suitable for ``subprocess.Popen``
        :rtype: list
        """
        raise NotImplementedError("get_commandline has to be implemented by actual jvms")

class OpenJDK(JVM):
    #TODO
    pass

class J9(JVM):
    #TODO
    pass

class Jikes(JVM):
    #TODO
    pass

class SunClient(JVM):
    #TODO
    pass

class SunServer(JVM):
    #TODO
    pass

class JVM(object):
    """
    This class represents a JVM.
    """

    def __init__(self, path, options=""):
        """
        :param path: path to jvm executable relative to basepath
        :param options: string of options that will be passed to jvm
        """

        self.basepath = '/'
        self.path = path
        # XXX: a passed classpath must be filtered and readded before run
        self.options = options

    def configure(self, *args):
        """
        Configure jvm options that allows `args` to run

        :param *args: :class:`Tool` or :class:`Program` instances that should be run.
        """
        #TODO
        pass

    def run(self):
        """
        Run the jvm with the current configuration.
        """
        #TODO
        pass

    @property
    def cmdline(self):
        #TODO
        pass

class WrappedJVM(JVM):
    """
    This class is an abstract base class for a JVM that is wrapped by another
    Program.

    Inheriting classes must expose this attributes:

      - ``out``: dictionary that maps logical output names to paths of output
        files
      - ``exports``: set of logical outputs (valid keys for ``out``)
    """
    def __init__(self):
        """
        Inheriting classes must:

          - have compatible arguments with JVM.__init__
          - call JVM.__init__
        """
        raise NotImplementedError("must be implemented")

    def run(self):
        """
        Run with wrapping.
        """
        raise NotImplementedError("must be implemented")

class ValgrindJVM(WrappedJVM):
    """
    This class represents a JVM which is called by valgrind.
    """
    #TODO
    pass
Move to new jvm specification.