stop - Maple Help

Online Help

All Products    Maple    MapleSim


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 = { "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 ):" );

        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