public class MWApplication
extends java.lang.Object
MWApplication class can be used to initialize the global state of MCR.
This class also provides methods to access this global state.| Constructor and Description |
|---|
MWApplication() |
| Modifier and Type | Method and Description |
|---|---|
static java.util.concurrent.Callable<java.io.PrintStream> |
getDefaultErrorStream()
The current late-bound PrintStream for MCR error text.
|
static java.util.concurrent.Callable<java.io.PrintStream> |
getDefaultOutputStream()
The current late-bound PrintStream for MCR output text.
|
static java.lang.String |
getMCRLogfileName()
Function to get the logfile name used by MCR
|
static void |
initialize(MWMCROption... options)
Initializes the global state of MCR
|
static void |
initializeApplication(MWMCROption... options)
Deprecated.
use initialize instead.
|
static boolean |
isMCRInitialized()
Function to query if MCR has been initialized
|
static boolean |
isMCRJVMEnabled()
Function to check if MCR is initialized with JVM
|
static boolean |
isMCRNoDisplaySet()
Function to check if MCR is initialized with display set *
|
static void |
setDefaultPrintStream(java.io.PrintStream out)
Sets the default PrintStream, where the MCR will write output that otherwise would have been
written to System.out or System.err.
|
static void |
setDefaultPrintStreams(java.util.concurrent.Callable<java.io.PrintStream> out,
java.util.concurrent.Callable<java.io.PrintStream> err)
Sets the default PrintStreams, where the MCR will write output that otherwise would have been
written to System.out or System.err.
|
static void |
setDefaultPrintStreams(java.io.PrintStream out,
java.io.PrintStream err)
Sets the default PrintStreams, where the MCR will write output that otherwise would have been
written to System.out or System.err.
|
static void |
terminate()
Terminates usage of the MCR.
|
@Deprecated public static void initializeApplication(MWMCROption... options)
options - Array of MWMCROption representing MCR optionspublic static void initialize(MWMCROption... options)
options - Array of MWMCROption representing MCR optionspublic static boolean isMCRInitialized()
public static boolean isMCRJVMEnabled()
public static boolean isMCRNoDisplaySet()
public static java.lang.String getMCRLogfileName()
public static void setDefaultPrintStream(java.io.PrintStream out)
public static void setDefaultPrintStreams(java.io.PrintStream out,
java.io.PrintStream err)
public static void setDefaultPrintStreams(java.util.concurrent.Callable<java.io.PrintStream> out,
java.util.concurrent.Callable<java.io.PrintStream> err)
public class MyClass
{
public static PrintStream myOut;
public static PrintStream myErr;
}
...
// Send output and error text to the current value of MyClass.myOut and MyClass.myErr whenever
// text is written (as opposed to their value as of right now):
MWApplication.setDefaultPrintStreams(
new Callable() {
public PrintStream call() {
return MyClass.myOut;
}
},
new Callable() {
public PrintStream call() {
return MyClass.myErr;
}
}
);
out - Callable the returns the PrintStream to which output not associated with any MCR
instance is sent.err - Callable the returns the PrintStream to which error text not associated with any
MCR instance is sent.public static void terminate()
public static java.util.concurrent.Callable<java.io.PrintStream> getDefaultOutputStream()
public static java.util.concurrent.Callable<java.io.PrintStream> getDefaultErrorStream()
© 1994-2008 The MathWorks, Inc. Terms of Use Patents Trademarks