Engine.stop - Maple Programming Help

Online Help

All Products    Maple    MapleSim


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

Engine.stop

shutdown the kernel

 

Calling Sequence

Description

Examples

Calling Sequence

void stop() throws MapleException

Description

• 

The stop method shuts down the Maple session represented by the Engine object.

• 

Any Algebraic objects will have their dispose method called.  These objects can no longer be used to reference the values they represented before stop was called.

• 

Even after stopping the current Engine object, new Engine objects cannot be created.

• 

In the event of an error, stop 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 ):" );

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

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

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

    engine.stop();

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

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

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

    try

    {

        engine.evaluate( "1+1;" );

    }

    catch ( MapleException me )

    {

        System.out.println( "Error: "+me.getMessage() );

    }

    }

}

Executing this code produces the following output.

false

false

false

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