Skip to main content
Package: com.phoenix_int.aserver.util.scriptwrapper.api Class Hierarchy

Declaration
This object is passed to Script Wrapper scripts and provides the “wrapper” global object which provides runtime services for the wrapper.

Constructor Summary

Method Summary

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PHXScriptWrapperObject

Constructs a wrapper object from a ScriptWrapper instance.

Method Detail

addMethod

Publicizes a method to our clients. There must be a method defined in the script by this name. Clients of MCRE will be able to call this method Parameters:
  • methodName - The name of the method to publicize
Throws:
  • PHXNameAlreadyInUseException
  • PHXInvalidNameException

addMethod

Publicizes a method to our clients. There must be a method defined in the script by this name. Clients of MCRE will be able to call this method Parameters:
  • methodName - The name of the method to publicize.
  • fullName - A human readable name to show in GUI programs for this method. For example, ModelCenter will show this in the right click menu of a component.
Throws:
  • PHXNameAlreadyInUseException
  • PHXInvalidNameException

addMethod

Publicizes a method to our clients. There must be a method defined in the script by this name. Clients of MCRE will be able to call this method Parameters:
  • methodName - The name of the method to publicize.
  • downloadInputs - Hint passed to the client on whether the inputs should be downloaded after the method is run.
Throws:
  • PHXNameAlreadyInUseException
  • PHXInvalidNameException

addMethod

Publicizes a method to our clients. There must be a method defined in the script by this name. Clients of MCRE will be able to call this method Parameters:
  • methodName - The name of the method to publicize.
  • fullName - A human readable name to show in GUI programs for this method. For example, ModelCenter will show this in the right click menu of a component.
  • downloadInputs - Hint passed to the client on whether the inputs should be downloaded after the method is run.
Throws:
  • PHXNameAlreadyInUseException
  • PHXInvalidNameException

addVariable

Adds a variable to this component. Returns a reference to the new variable. Valid types are: All types except PHXGeometry and PHXRawFile may be made into arrays by adding [] at the end of the type string. In that case, the associated PHX<type>Array class is used to represent a resizable, multi-dimensional array. Parameters:
  • name - The full name of the new variable. May include group specification with ’.’.
  • type - The type of variable to create. Use the same type strings as for the variable: statemensts at the top of the ScriptWrapper.
  • isInput - If true, the variable will be an input, if false, it will be an output.
Throws:
  • PHXNameAlreadyInUseException - Thrown if there is already a variable by that name.
  • PHXInvalidNameException - Thrown if the name uses invalid characters like space.
  • PHXInvalidTypeException - Thrown if the type string is not understood

getVariable

Returns a reference to the named variable. Throws:
  • PHXNoSuchObjectException

removeVariable

Dynamically removes a variable from this component Throws:
  • PHXNoSuchObjectException

addConsoleVariables

Throws:
  • PHXNameAlreadyInUseException
  • PHXInvalidNameException
  • PHXInvalidTypeException

updateConsoleVariables

Throws:
  • PHXNoSuchObjectException

getDirectory

Returns the directory where this component was loaded from

getRunShare

Returns the PHXRunShareContext object used for process control and monitoring with this component

getRunDirectory

Returns the current “run” directory, which is the same as getDirectory() unless run sharing is being used.

sleep

Sleeps for a period of time Parameters:
  • millisecs - the amount of time to sleep

getConnection

Gets the connection object

setConnection

Sets the connection object

getDictionary

Gets context information for the incoming connection that is running this wrapper. Currently only for internal use. Returns:
  • a Map of string/value pairs giving context information about the environment inside which the component is running.

setBinary

Make a given file variable binary Parameters:
  • varName - the name of the file variable
Throws:
  • PHXInvalidTypeException
  • PHXNoSuchObjectException

writeFile

Write the given file variable out to the specified file Parameters:
  • varName - the name of the file variable
  • fileName - the name of the target file
Throws:
  • PHXInvalidTypeException
  • PHXNoSuchObjectException
  • java.io.IOException

parseFile

Read the given file variable from the specified file Parameters:
  • varName - the name of the file variable
  • fileName - the name of the target file
Throws:
  • PHXInvalidTypeException
  • PHXNoSuchObjectException
  • java.io.IOException

deleteFile

Deletes the given file variable’s file Parameters:
  • varName - the name of the file variable
  • fileName - the name of the target file
Throws:
  • PHXInvalidTypeException
  • PHXNoSuchObjectException
  • java.io.IOException

backupFile

Backup the file on disk. File is at the same location with “.bac” appended to the end. If a file by that name already exists, it is deleted prior to moving. Parameters:
  • varName - the name of the file variable
  • fileName - the name of the target file
Throws:
  • PHXInvalidTypeException
  • PHXNoSuchObjectException
  • java.io.IOException

defaultExecutableMapping

trace

Prints a string to the trace window Parameters:
  • msg - the message to print

requireAnalysisServerVersion

Verifies we’re running a compatible version of ModelCenter Remote Execution Parameters:
  • majorVersion - required major version
  • minorVersion - required minor version
Throws:

addAutoClose

Add the opened file to the file Handlers list Parameters:
  • file - the closeable file

removeAutoClose

Remove the file from the file Handlers list Parameters:
  • file - the closeable file

addFileInfo