restart the kernel - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : OpenMaple : Java Application Programming Interface : Engine Class : OpenMaple/Java/Engine/restart

Engine.restart - restart the kernel

Calling Sequence

void restart() throws MapleException

Description

• 

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.

Examples

import com.maplesoft.openmaple.*;

import com.maplesoft.externalcall.MapleException;

class Example

{

    public static void main( String notused[] ) throws MapleException

    {

    String mapleArgs[];

    Engine engine;

    Numeric n;

    List l;

    RTable r;

    mapleArgs = new String[1];

    mapleArgs[0] = "java";

    engine = new Engine( mapleArgs, new EngineCallBacksDefault(),

        null, null );

    n = engine.newNumeric( 1000 );

    l = (List)engine.evaluate( "[1,2,3,4]:" );

    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;" );

    System.out.println( n.isDisposed() );

    System.out.println( l.isDisposed() );

    System.out.println( r.isDisposed() );

    }

}

Executing this code produces the following output.

a := 10

false

false

false

a

true

true

true

See Also

ExternalCalling/Java/MapleException, OpenMaple, OpenMaple/Java/API, OpenMaple/Java/Engine, restart


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam