S-PLUS Connect/Java v1.0

com.insightful.splus
Interface SplusSession

All Superinterfaces:
Remote
All Known Implementing Classes:
SplusSessionImpl

public interface SplusSession
extends Remote

Primary connection between Java and the S-PLUS engine. All communication with the S-PLUS engine goes through this interface.


Method Summary
 SplusDataResult evalDataQuery(String cmd)
          Evaluate an S-PLUS expression in the S-PLUS engine and retrieve the result as an SplusDataResult.
 SplusDataResult evalDataQuery(String cmd, boolean pingEngine, boolean parseTest)
          Evaluate an S-PLUS expression in the S-PLUS engine and retrieve the result as an SplusDataResult.
 SplusDataResult evalDataQuery(String cmd, boolean Output, boolean Result, boolean Errors, boolean Warnings, boolean Expr)
          Evaluate an S-PLUS expression in the S-PLUS engine and retrieve the result as an SplusDataResult.
 SplusDataResult evalDataQuery(String cmd, boolean Output, boolean Result, boolean Errors, boolean Warnings, boolean Expr, boolean pingEngine, boolean parseTest)
          Evaluate an S-PLUS expression in the S-PLUS engine and retrieve the result as an SplusDataResult.
 SplusDataResult evalDataQuery(String cmd, boolean Output, boolean Result, boolean Errors, boolean Warnings, boolean Expr, int timeout)
          Evaluate an S-PLUS expression in the S-PLUS engine and retrieve the result as an SplusDataResult.
 SplusDataResult evalDataQuery(String cmd, boolean Output, boolean Result, boolean Errors, boolean Warnings, boolean Expr, int timeout, boolean pingEngine, boolean parseTest)
          Evaluate an S-PLUS expression in the S-PLUS engine and retrieve the result as an SplusDataResult.
 SplusDataResult evalDataQuery(String cmd, int timeout)
          Evaluate an S-PLUS expression in the S-PLUS engine and retrieve the result as an SplusDataResult.
 SplusDataResult evalDataQuery(String cmd, int timeout, boolean pingEngine, boolean parseTest)
          Evaluate an S-PLUS expression in the S-PLUS engine and retrieve the result as an SplusDataResult.
 char[] getCertAccess()
          Method allowing clients to get the password to a certificate file on the server.
 String getCertFilename()
          Method allowing clients to get a path to a certificate file on the server.
 ClientUtilities getClientUtilities()
          Method allowing clients access to a server-side object with methods to evaluate general static fields and methods on the server via reflection.
 FileInputStreamProxy getFileInputStream(String filename)
          Get a FileInputStream from the server JVM.
 FileOutputStreamProxy getFileOutputStream(String filename)
          Get a FileOutputStream from the server JVM.
 void Interrupt()
          Send an interrupt signal (SIGINT) to the S-PLUS engine.
 boolean isRemote()
          Test whether the session is remote.
 String readSplusErr()
          Read any pending standard error text from the S-PLUS engine.
 String readSplusOut()
          Read any pending standard output from the S-PLUS engine.
 void sessionExit()
          Shut down the session.
 void sessionExit(boolean killClient)
          Shut down the session.
 void setClientObjectFactory(ClientObjectFactory factory)
          Set a ClientObjectFactory that the server can use to perform operations in the client JVM.
 void startPollOutput(SplusOutputHandler handler)
          Register an SplusOutputHandler to be notified when output is available.
 void writeSplusData(String str)
          Write text to the data channel.
 void writeSplusIn(String str)
          Write text to the S-PLUS engine's standard input.
 

Method Detail

setClientObjectFactory

public void setClientObjectFactory(ClientObjectFactory factory)
                            throws RemoteException
Set a ClientObjectFactory that the server can use to perform operations in the client JVM.

Throws:
RemoteException

writeSplusIn

public void writeSplusIn(String str)
                  throws RemoteException
Write text to the S-PLUS engine's standard input.

Throws:
RemoteException

writeSplusData

public void writeSplusData(String str)
                    throws RemoteException
Write text to the data channel. This is a connection between Java and the S-PLUS engine used by evalDataQuery(). This method is available for use in debugging. Use writeSplusIn() to send a command over standard input, or evalDataQuery() to evaluate an expression through the data channel.

Throws:
RemoteException

readSplusOut

public String readSplusOut()
                    throws RemoteException
Read any pending standard output from the S-PLUS engine.

Throws:
RemoteException

readSplusErr

public String readSplusErr()
                    throws RemoteException
Read any pending standard error text from the S-PLUS engine.

Throws:
RemoteException

evalDataQuery

public SplusDataResult evalDataQuery(String cmd)
                              throws RemoteException,
                                     SplusEngineBusyException,
                                     SplusIncompleteExpressionException
Evaluate an S-PLUS expression in the S-PLUS engine and retrieve the result as an SplusDataResult.

Parameters:
cmd - Expression to evaluate.
Throws:
RemoteException
SplusEngineBusyException
SplusIncompleteExpressionException

evalDataQuery

public SplusDataResult evalDataQuery(String cmd,
                                     int timeout)
                              throws RemoteException,
                                     SplusEngineBusyException,
                                     SplusIncompleteExpressionException
Evaluate an S-PLUS expression in the S-PLUS engine and retrieve the result as an SplusDataResult.

Parameters:
cmd - Expression to evaluate.
timeout - Seconds to wait before generating an Engine Busy error.
Throws:
RemoteException
SplusEngineBusyException
SplusIncompleteExpressionException

evalDataQuery

public SplusDataResult evalDataQuery(String cmd,
                                     boolean pingEngine,
                                     boolean parseTest)
                              throws RemoteException,
                                     SplusEngineBusyException,
                                     SplusIncompleteExpressionException
Evaluate an S-PLUS expression in the S-PLUS engine and retrieve the result as an SplusDataResult.

Additional flags are available to avert the checking for engine availability and command completeness. This is generally unsafe. If, however, one is certain that the command is correct and the engine is not busy with a previous command or with requests from some other thread, it will speed up the method call by about 150 ms.

Parameters:
cmd - Expression to evaluate.
pingEngine - Perform a check to see if the S-PLUS engine is responsive.
parseTest - Perform a check to see if the command parses before attempting to evaluate it.
Throws:
RemoteException
SplusEngineBusyException
SplusIncompleteExpressionException

evalDataQuery

public SplusDataResult evalDataQuery(String cmd,
                                     int timeout,
                                     boolean pingEngine,
                                     boolean parseTest)
                              throws RemoteException,
                                     SplusEngineBusyException,
                                     SplusIncompleteExpressionException
Evaluate an S-PLUS expression in the S-PLUS engine and retrieve the result as an SplusDataResult.

Additional flags are available to avert the checking for engine availability and command completeness. This is generally unsafe. If, however, one is certain that the command is correct and the engine is not busy with a previous command or with requests from some other thread, it will speed up the method call by about 150 ms.

Parameters:
cmd - Expression to evaluate.
timeout - Seconds to wait before generating an Engine Busy error.
pingEngine - Perform a check to see if the S-PLUS engine is responsive.
parseTest - Perform a check to see if the command parses before attempting to evaluate it.
Throws:
RemoteException
SplusEngineBusyException
SplusIncompleteExpressionException

evalDataQuery

public SplusDataResult evalDataQuery(String cmd,
                                     boolean Output,
                                     boolean Result,
                                     boolean Errors,
                                     boolean Warnings,
                                     boolean Expr)
                              throws RemoteException,
                                     SplusEngineBusyException,
                                     SplusIncompleteExpressionException
Evaluate an S-PLUS expression in the S-PLUS engine and retrieve the result as an SplusDataResult.

This version of the method has boolean flags to indicate which elements to include in the SplusDataResult. Set specific flags to false to avoid shipping over unnecessary information.

Parameters:
cmd - Expression to evaluate.
Output - Include output in the SplusDataResult.
Result - Include data in the SplusDataResult.
Errors - Include errors in the SplusDataResult.
Warnings - Include warnings in the SplusDataResult.
Expr - Include the expression (cmd) reformatted to match the width of the output.
Throws:
RemoteException
SplusEngineBusyException
SplusIncompleteExpressionException

evalDataQuery

public SplusDataResult evalDataQuery(String cmd,
                                     boolean Output,
                                     boolean Result,
                                     boolean Errors,
                                     boolean Warnings,
                                     boolean Expr,
                                     boolean pingEngine,
                                     boolean parseTest)
                              throws RemoteException,
                                     SplusEngineBusyException,
                                     SplusIncompleteExpressionException
Evaluate an S-PLUS expression in the S-PLUS engine and retrieve the result as an SplusDataResult.

This version of the method has boolean flags to indicate which elements to include in the SplusDataResult. Set specific flags to false to avoid shipping over unnecessary information.

Additional flags are available to defeat the checking for engine availability and command completeness. This is generally unsafe. If, however, one is certain that the command is correct and the engine is not busy with a previous command or with requests from some other thread, it will speed up the method call by about 150 ms.

Parameters:
cmd - Expression to evaluate.
Output - Include output in the SplusDataResult.
Result - Include data in the SplusDataResult.
Errors - Include errors in the SplusDataResult.
Warnings - Include warnings in the SplusDataResult.
Expr - Include the expression (cmd) reformatted to match the width of the output.
pingEngine - Perform a check to see if the S-PLUS engine is responsive.
parseTest - Perform a check to see if the command parses before attempting to evaluate it.
Throws:
RemoteException
SplusEngineBusyException
SplusIncompleteExpressionException

evalDataQuery

public SplusDataResult evalDataQuery(String cmd,
                                     boolean Output,
                                     boolean Result,
                                     boolean Errors,
                                     boolean Warnings,
                                     boolean Expr,
                                     int timeout)
                              throws RemoteException,
                                     SplusEngineBusyException,
                                     SplusIncompleteExpressionException
Evaluate an S-PLUS expression in the S-PLUS engine and retrieve the result as an SplusDataResult.

This version of the method has boolean flags to indicate which elements to include in the SplusDataResult. Set specific flags to false to avoid shipping over unnecessary information.

Parameters:
cmd - Expression to evaluate.
Output - Include output in the SplusDataResult.
Result - Include data in the SplusDataResult.
Errors - Include errors in the SplusDataResult.
Warnings - Include warnings in the SplusDataResult.
Expr - Include the expression (cmd) reformatted to match the width of the output.
timeout - Seconds to wait before generating an Engine Busy error.
Throws:
RemoteException
SplusEngineBusyException
SplusIncompleteExpressionException

evalDataQuery

public SplusDataResult evalDataQuery(String cmd,
                                     boolean Output,
                                     boolean Result,
                                     boolean Errors,
                                     boolean Warnings,
                                     boolean Expr,
                                     int timeout,
                                     boolean pingEngine,
                                     boolean parseTest)
                              throws RemoteException,
                                     SplusEngineBusyException,
                                     SplusIncompleteExpressionException
Evaluate an S-PLUS expression in the S-PLUS engine and retrieve the result as an SplusDataResult.

This version of the method has boolean flags to indicate which elements to include in the SplusDataResult. Set specific flags to false to avoid shipping over unnecessary information.

Additional flags are available to defeat the checking for engine availability and command completeness. This is generally unsafe. If, however, one is certain that the command is correct and the engine is not busy with a previous command or with requests from some other thread, it will speed up the method call by about 150 ms.

Parameters:
cmd - Expression to evaluate.
Output - Include output in the SplusDataResult.
Result - Include data in the SplusDataResult.
Errors - Include errors in the SplusDataResult.
Warnings - Include warnings in the SplusDataResult.
Expr - Include the expression (cmd) reformatted to match the width of the output.
timeout - Seconds to wait before generating an Engine Busy error.
pingEngine - Perform a check to see if the S-PLUS engine is responsive.
parseTest - Perform a check to see if the command parses before attempting to evaluate it.
Throws:
RemoteException
SplusEngineBusyException
SplusIncompleteExpressionException

Interrupt

public void Interrupt()
               throws RemoteException
Send an interrupt signal (SIGINT) to the S-PLUS engine.

Throws:
RemoteException

getFileInputStream

public FileInputStreamProxy getFileInputStream(String filename)
                                        throws FileNotFoundException,
                                               RemoteException
Get a FileInputStream from the server JVM.

Throws:
FileNotFoundException
RemoteException

getFileOutputStream

public FileOutputStreamProxy getFileOutputStream(String filename)
                                          throws FileNotFoundException,
                                                 RemoteException
Get a FileOutputStream from the server JVM.

Throws:
FileNotFoundException
RemoteException

isRemote

public boolean isRemote()
                 throws RemoteException
Test whether the session is remote. This is true in client/server mode.

Throws:
RemoteException

sessionExit

public void sessionExit()
                 throws RemoteException
Shut down the session. As part of shutdown, the session will tell the client to shut itself down.

Throws:
RemoteException

sessionExit

public void sessionExit(boolean killClient)
                 throws RemoteException
Shut down the session. Call this with killClient set to true to shut down the session from a client. Call this with killClient set to false to shut down both the session and the related client from the server.

Parameters:
killClient - true to tell the client to shut itself down.
Throws:
RemoteException

startPollOutput

public void startPollOutput(SplusOutputHandler handler)
                     throws RemoteException
Register an SplusOutputHandler to be notified when output is available. If an output handler is registered, text will automatically be written to the output handler as it is generated. Alternately, text will be buffered until it is retrieved via calls to readSplusOut() and readSplusErr().

Throws:
RemoteException

getCertFilename

public String getCertFilename()
                       throws RemoteException
Method allowing clients to get a path to a certificate file on the server. This allows the client to use the same SSL encryption credentials as the server when instancing client-side remote objects.

Throws:
RemoteException

getCertAccess

public char[] getCertAccess()
                     throws RemoteException
Method allowing clients to get the password to a certificate file on the server. This allows the client to use the same SSL encryption credentials as the server when instancing client-side remote objects.

Throws:
RemoteException

getClientUtilities

public ClientUtilities getClientUtilities()
                                   throws RemoteException
Method allowing clients access to a server-side object with methods to evaluate general static fields and methods on the server via reflection. Although the result is of class "ClientUtilities", in this case it is a server-side object.

Throws:
RemoteException

S-PLUS Connect/Java v1.0

Copyright © 2000, 2002 Insightful Corporation
Warning: Classes not documented in the S-PLUS Programmer's Guide may change in future releases.