Engine.restart
restart the kernel
Calling Sequence
Description
Examples
void restart() throws MapleException
The restart method causes the Maple session represented by the Engine object to clear its internal memory so that Maple acts (almost) as if just started.
Any Algebraic objects will have their dispose method called. These objects can no longer be used to reference the values they represented before restart was called.
The restart method of Engine performs the same function as the restart function in Maple.
In the event of an error, restart raises a MapleException.
import com.maplesoft.openmaple.*;
import com.maplesoft.externalcall.MapleException;
class Example
{
public static void main( String notused[] ) throws MapleException
String[] mapleArgs = { "java" };
Engine engine = new Engine( mapleArgs, new EngineCallBacksDefault(), null, null );
Numeric n = engine.newNumeric( 1000 );
List l = (List)engine.evaluate( "[1,2,3,4]:" );
RTable r = (RTable)engine.evaluate( "Array( 1..10, 1..10 ):" );
engine.evaluate( "a := 10;" );
System.out.println( n.isDisposed() );
System.out.println( l.isDisposed() );
System.out.println( r.isDisposed() );
engine.restart();
engine.evaluate( "a;" );
}
Executing this code produces the following output.
a := 10
false
a
true
See Also
ExternalCalling/Java/MapleException
OpenMaple
OpenMaple/Java/API
OpenMaple/Java/Engine
restart
Download Help Document