fr.umlv.corosol.component
Interface JVirtualMachine

All Superinterfaces:
JObject
All Known Implementing Classes:
DefaultJVirtualMachine

public interface JVirtualMachine
extends JObject

This is the Corosol Java Virtual Machine interface. The JVM contains a set of components. A component can be added or replaced at run-time in the Corosol JVM.

Author:
Christophe Deleray

Method Summary
 JProxy addComponent(JVMComponent component)
          Adds the specified component into the JVM.
 boolean containsComponent(java.lang.Class type)
          Determines if this jvm contains a component of the specified type.
 JProxy getComponent(java.lang.Class type)
          Returns the JVM component of the specified type.
 JVMComponent[] getComponents()
          Returns an array containing all the JVM components.
 void replaceComponent(JVMComponent component)
          Replaces a component into the JVM.
 void startUp(java.lang.String className, java.lang.String[] args)
          Executes the class asociated with the given string name.
 

Method Detail

addComponent

JProxy addComponent(JVMComponent component)
Adds the specified component into the JVM.

Parameters:
component - a component
Returns:
a proxy of the added component

replaceComponent

void replaceComponent(JVMComponent component)
Replaces a component into the JVM.

Parameters:
component - a component

containsComponent

boolean containsComponent(java.lang.Class type)
Determines if this jvm contains a component of the specified type.

Parameters:
type - the type of a JVM component
Returns:
true if this jvm contains an component of the specified type, or false otherwise

getComponent

JProxy getComponent(java.lang.Class type)
Returns the JVM component of the specified type.

Parameters:
type - the type of a JVM component
Returns:
the component of the specified type
Throws:
java.lang.IllegalArgumentException - if the component doesn't exist in the virtual machine

getComponents

JVMComponent[] getComponents()
Returns an array containing all the JVM components.

Returns:
an array containing all the JVM components.

startUp

void startUp(java.lang.String className,
             java.lang.String[] args)
             throws java.lang.Throwable
Executes the class asociated with the given string name.

Parameters:
className - the fully qualified name of the desired class
args - the command line arguments
Throws:
java.lang.Throwable - if an exception occurs during execution