|
S-PLUS Connect/Java v1.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.insightful.splus.SplusWinSessionImpl
Implementation of SplusSession that connects to the S-PLUS engine using Connect/C++. This was initially developed as the Windows equivalent of SplusSessionImpl. It has been extended to support a Connect/C++ based connection on either Windows or UNIX.
Remote operation is not currently supported. This class assumes that the Java client and the S-PLUS engine are running in a single process. This does not support accessing an S-PLUS engine from another machine via RMI.
Currently we only support a single S-PLUS engine connection within a Java process.
Constructor Summary | |
SplusWinSessionImpl()
|
|
SplusWinSessionImpl(String[] args)
args are used to initialize the S-PLUS engine. |
Method Summary | |
void |
addListener(com.insightful.splus.SplusWinSessionListener listener)
|
static String |
checkoutLicenseFeature(String feature)
|
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 expression and get the output 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. |
static void |
flushOutputBuffer()
public entry to explicitly flush any output in the output buffer. |
char[] |
getCertAccess()
Method allowing clients to get the password to a certificate file on the server. |
String |
getCertFilename()
These "Cert" methods are additions to the interface to support RMI over SSL in Analytic Server. |
static ClientObjectFactory |
getClientObjectFactory()
|
ClientUtilities |
getClientUtilities()
This method is used to call server-side methods in SplusSessionImpl under remote operation. |
FileInputStreamProxy |
getFileInputStream(String filename)
Get a new FileInputStream. |
FileOutputStreamProxy |
getFileOutputStream(String filename)
Get a new FileOutputStream. |
String |
getPendingInputString()
|
protected String[] |
getSessionSpecificArgs(String[] args)
Method used to add session specific args. |
void |
Interrupt()
Interrupt the engine. |
boolean |
isRemote()
Always returns "false" since remote operation is not implemented. |
static boolean |
isWindowsGUIClosing()
|
static boolean |
isWindowsGUILoaded()
code to handle calls to Splus windows gui fns |
int |
parseSplusString(String str)
|
String |
readSplusErr()
Not supported, use startPollOutput() instead. |
String |
readSplusOut()
Not supported, use startPollOutput() instead. |
void |
removeListener(com.insightful.splus.SplusWinSessionListener listener)
|
void |
sessionExit()
Shut down the session. |
void |
sessionExit(boolean killClient)
Shut down the session. |
void |
setClientObjectFactory(ClientObjectFactory factory)
Since remote operation is not supported, it's unlikely that the setClientObjectFactory() and getClientObjectFactory() methods will be used. |
static void |
setDialogActivated(int hwnd,
boolean on)
|
static void |
setDialogRegister(int hwnd,
boolean on)
|
static void |
setExecutingScriptThreaded(boolean val)
|
void |
setPromptFlag(boolean prompt)
Set whether prompts should be printed. |
void |
startPollOutput(SplusOutputHandler handler)
Register an SplusOutputHandler to be notified when output is available. |
void |
writeSplusData(String str)
Evaluates a String in the engine without returning a result. |
void |
writeSplusIn(String str)
Write text to the S-PLUS engine's standard input. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SplusWinSessionImpl(String[] args) throws RemoteException, SplusLicenseException
public SplusWinSessionImpl() throws RemoteException, SplusLicenseException
Method Detail |
public static String checkoutLicenseFeature(String feature)
protected String[] getSessionSpecificArgs(String[] args)
args
- String array of arguments passed to the engine
connection.public int parseSplusString(String str)
parseSplusString
in interface com.insightful.splus.SplusWinSession
public void writeSplusIn(String str) throws RemoteException
SplusSession
writeSplusIn
in interface SplusSession
RemoteException
public void writeSplusData(String str) throws RemoteException
In SplusSessionImpl this method is provided as a way to try and clear the data channel, but that isn't relevant here.
writeSplusData
in interface SplusSession
RemoteException
public String readSplusOut() throws RemoteException
readSplusOut
in interface SplusSession
RemoteException
public String readSplusErr() throws RemoteException
readSplusErr
in interface SplusSession
RemoteException
public SplusDataResult evalDataQuery(String cmd, boolean Output, boolean Result, boolean Errors, boolean Warnings, boolean Expr) throws RemoteException, SplusEngineBusyException, SplusIncompleteExpressionException
The pingEngine and parseTest arguments are currently ignored. They are used to suppress operations that are not performed on Windows.
evalDataQuery
in interface SplusSession
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.
RemoteException
SplusEngineBusyException
SplusIncompleteExpressionException
public SplusDataResult evalDataQuery(String cmd) throws RemoteException, SplusEngineBusyException, SplusIncompleteExpressionException
SplusSession
evalDataQuery
in interface SplusSession
cmd
- Expression to evaluate.
RemoteException
SplusEngineBusyException
SplusIncompleteExpressionException
public SplusDataResult evalDataQuery(String cmd, int timeout) throws RemoteException, SplusEngineBusyException, SplusIncompleteExpressionException
SplusSession
evalDataQuery
in interface SplusSession
cmd
- Expression to evaluate.timeout
- Seconds to wait before generating an Engine Busy error.
RemoteException
SplusEngineBusyException
SplusIncompleteExpressionException
public SplusDataResult evalDataQuery(String cmd, boolean pingEngine, boolean parseTest) throws RemoteException, SplusEngineBusyException, SplusIncompleteExpressionException
SplusSession
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.
evalDataQuery
in interface SplusSession
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.
RemoteException
SplusEngineBusyException
SplusIncompleteExpressionException
public SplusDataResult evalDataQuery(String cmd, int timeout, boolean pingEngine, boolean parseTest) throws RemoteException, SplusEngineBusyException, SplusIncompleteExpressionException
SplusSession
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.
evalDataQuery
in interface SplusSession
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.
RemoteException
SplusEngineBusyException
SplusIncompleteExpressionException
public SplusDataResult evalDataQuery(String cmd, boolean Output, boolean Result, boolean Errors, boolean Warnings, boolean Expr, int timeout) throws RemoteException, SplusEngineBusyException, SplusIncompleteExpressionException
SplusSession
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.
evalDataQuery
in interface SplusSession
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.
RemoteException
SplusEngineBusyException
SplusIncompleteExpressionException
public SplusDataResult evalDataQuery(String cmd, boolean Output, boolean Result, boolean Errors, boolean Warnings, boolean Expr, boolean pingEngine, boolean parseTest) throws RemoteException, SplusEngineBusyException, SplusIncompleteExpressionException
SplusSession
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.
evalDataQuery
in interface SplusSession
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.
RemoteException
SplusEngineBusyException
SplusIncompleteExpressionException
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
SplusSession
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.
evalDataQuery
in interface SplusSession
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.
RemoteException
SplusEngineBusyException
SplusIncompleteExpressionException
public void Interrupt() throws RemoteException
Interrupt
in interface SplusSession
RemoteException
public void setClientObjectFactory(ClientObjectFactory factory) throws RemoteException
setClientObjectFactory
in interface SplusSession
RemoteException
public static ClientObjectFactory getClientObjectFactory()
public FileInputStreamProxy getFileInputStream(String filename) throws FileNotFoundException, RemoteException
getFileInputStream
in interface SplusSession
FileNotFoundException
RemoteException
public FileOutputStreamProxy getFileOutputStream(String filename) throws FileNotFoundException, RemoteException
getFileOutputStream
in interface SplusSession
FileNotFoundException
RemoteException
public boolean isRemote()
isRemote
in interface com.insightful.splus.SplusWinSession
public void sessionExit()
SplusSession
sessionExit
in interface com.insightful.splus.SplusWinSession
public void sessionExit(boolean killClient)
SplusSession
sessionExit
in interface com.insightful.splus.SplusWinSession
public void startPollOutput(SplusOutputHandler handler) throws RemoteException
SplusSession
startPollOutput
in interface SplusSession
RemoteException
public void setPromptFlag(boolean prompt)
setPromptFlag
in interface com.insightful.splus.SplusWinSession
public static void flushOutputBuffer() throws RemoteException
RemoteException
public String getPendingInputString()
getPendingInputString
in interface com.insightful.splus.SplusWinSession
public String getCertFilename() throws RemoteException
getCertFilename
in interface SplusSession
RemoteException
public char[] getCertAccess() throws RemoteException
SplusSession
getCertAccess
in interface SplusSession
RemoteException
public ClientUtilities getClientUtilities() throws RemoteException
getClientUtilities
in interface SplusSession
RemoteException
public static boolean isWindowsGUILoaded()
public static boolean isWindowsGUIClosing()
public static void setExecutingScriptThreaded(boolean val)
public static void setDialogRegister(int hwnd, boolean on)
public static void setDialogActivated(int hwnd, boolean on)
public void addListener(com.insightful.splus.SplusWinSessionListener listener)
addListener
in interface com.insightful.splus.SplusWinSession
public void removeListener(com.insightful.splus.SplusWinSessionListener listener)
removeListener
in interface com.insightful.splus.SplusWinSession
|
S-PLUS Connect/Java v1.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |