Class RS
- java.lang.Object
-
- java.lang.Thread
-
- com.ibm.di.server.RS
-
- All Implemented Interfaces:
AssemblyLine.AssemblyLineListener,Listenable<ConfigInstanceListener>,RSInterface,java.lang.Runnable
public class RS extends java.lang.Thread implements RSInterface, AssemblyLine.AssemblyLineListener, Listenable<ConfigInstanceListener>
This is the main class for the TDI Server, and represents the primary thread from which all others are launched, including AssemblyLines and Server mode listeners. The pre-registered script variable main gives you JavaScript access to the server-level methods available in this class. For example, if you want to launch a new AssemblyLine then you use the main variable to do so:// Start my AL var al = main.startAL("myAssemblyLine"); // Wait for the AL to complete al.join();Just like com.ibm.di.server.AssemblyLine (the task variable in JavaScript), RS also provides a logmsg() method. Note also that in order to load a Connector Interface, like JDBC or LDAP Connector, you use the loadConnector() of the AssemblyLine class:task.loadConnector(connectorConfig)
. To get the Connector Config, use the getConnector() method in RS. The same goes for Parsers and Function components. RS also provides the commandLineParam() method for retrieving commandline arguments, including the user-defined ones (-0 through -9), that were specified when the TDI Server was started.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceRS.ConfigInstanceNamingPolicyA policy which defines how configuration instances are named.static classRS.DefaultConfigInstanceNamingPolicyThe default naming policy.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCL_AL_DEBUGCommand line switch - B See the parameters' usage.static java.lang.StringCL_CONFIGCommand line switch - c See the parameters' usage.static java.lang.StringCL_CONFIG_DRIVERCommand line switch - Y See the parameters' usage.static java.lang.StringCL_CONFIG_ENCODINGCommand line switch - n See the parameters' usage.static java.lang.StringCL_CONFIG_STDINCommand line switch - S See the parameters' usage.static java.lang.StringCL_CREATE_SOLDIRCommand line switch - g See the parameter's usage.static java.lang.StringCL_DEBUG_OPTIONSCommand line switch - b See the parameters' usage.static java.lang.StringCL_DEBUG_PORTCommand line switch - Q See the parameters' usage.static java.lang.StringCL_DISABLE_REMOTE_APICommand line switch - R See the parameters' usage.static java.lang.StringCL_DUMP_PERFPROPSCommand line switch - T See the parameters' usage.static java.lang.StringCL_DUMP_PROPSCommand line switch - p See the parameters' usage.static java.lang.StringCL_EXECUTE_SCRIPTCommand line switch - x See the parameters' usage.static java.lang.StringCL_EXT_PROP_FILECommand line switch - f See the parameters' usage.static java.lang.StringCL_IGNORE_GLOBAL_PROPERTIESCommand line switch - i
if this option is specified, the server will not read global.properties; solution.properties will still be read if presentstatic java.lang.StringCL_INTERNAL_ADD_LISTENERThis is not a command line option but an internal parameter that lets you specify an additional config instance listener.static java.lang.StringCL_INTERNAL_CONFIG_AS_STRINGThis is not a command line option but an internal parameter that lets you start a Config Instance by providing the configuration XML as a string.static java.lang.StringCL_INTERNAL_CONFIG_NSTANCE_NAMEThis is not a command line option but an internal parameter that lets you start a Config Instance with a name different than the config file name.static java.lang.StringCL_LOGFILECommand line switch - l See the parameters' usage.static java.lang.StringCL_NO_AUTOSTARTCommand line switch - D See the parameters' usage.static java.lang.StringCL_NO_TERMINATECommand line switch - W See the parameters' usage.static java.lang.StringCL_PASSWORDCommand line switch - P See the parameters' usage.static java.lang.StringCL_READ_REGRESSIONCommand line switch - j
if this option is specified, the AssemblyLine will read regression info from a file with that name.static java.lang.StringCL_REGRESSION_IGNORE_WORKCommand line switch - k
If this option is specified, the work Entry will be ignored when reading or writing regression info.static java.lang.StringCL_RUN_DAEMONCommand line switch - d See the parameters' usage.static java.lang.StringCL_RUN_MODECommand line switch - q See the parameters' usage.static java.lang.StringCL_SECURE_MODECommand line switch - e See the parameters' usage.static java.lang.StringCL_SIMULATION_MODECommand line switch - M See the parameters' usage.static java.lang.StringCL_START_ALCommand line switch - r See the parameters' usage.static java.lang.StringCL_START_DERBYCommand line switch -X
If this option is specified, Derby will be started and the server will exit.static java.lang.StringCL_STOP_DERBYCommand line switch -Y
If this option is specified, Derby will be stopped and the server will exit.static java.lang.StringCL_USAGECommand line switch - ? See the parameters' usage.static java.lang.StringCL_VERSION_INFOCommand line switch - v See the parameters' usage.static java.lang.StringCL_WAITCommand line switch - w See the parameters' usage.static java.lang.StringCL_WRITE_REGRESSIONCommand line switch - J
if this option is specified, the AssemblyLine will write regression info to a file with that name.static intEXIT_CODE_REST_FAILEDThe exit code returned when REST fails.static RSgRSGlobal static reference to the master RS object (non-threaded)static MetamergeConfiggSysConfigThis is the templates configuration file loaded from the rs.jar filelongmmReloadedTime when thereload()method was called.longmmServerStartedTime when the masterRSstartedlongmmStartedTime when the threadedRSstartedjava.util.Hashtable<java.lang.String,java.lang.Object>paramsThis table holds startup parameters.static java.lang.StringPROP_CONFIG_ENCODINGSystem property that specifies the encoding to be used when reading/writing configuration files.static java.lang.StringPROP_SECURE_MODESystem property that specifies whether the Server is run in secure mode.static java.lang.StringPROPERTY_JVM_SHUTDOWN_HOOKThe server will look for a property with this name when registering a shutdown hook.static java.lang.StringPROTECT_PREFIXThis is the prefix of a property in the global.properties or solution.properties files.static java.lang.StringPROTECT_VAL_PREFIXThis is the prefix of the value of a protected property in the global.properties or solution.properties files.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddListener(ConfigInstanceListener listener)This method is for internal use only.voidassemblyLineCycleEnded(AssemblyLine al, Entry work)An AssemblyLine cycle (iteration) is complete.voidassemblyLineStarted(AssemblyLine al)The AssemblyLine started.voidassemblyLineTerminated(AssemblyLine al)The AssemblyLine terminated.static voidcheckLUM()This function checks if a valid license to run the application exists in the nodelock file.voidcheckTask(java.lang.String name)Check for existence of "AssemblyLine" name, or throw an exceptionjava.lang.StringcommandLineParam(java.lang.String param)Returns the value for a command line parameterstatic RScreateConfigInstance(java.lang.String groupName, java.util.Hashtable<java.lang.String,java.lang.Object> params)Create a new config instance but do not start it.voiddump(java.lang.Object o)Dumps the class and contents of an object to the log file.voiddumpEntry(Entry e)Dumps the contents of an Entry to the log file.static voidencryptPropertiesfile(java.lang.String path, Log log)Loads the properties from the specified file and sets them as system properties.AttributeMapConfiggetAttributeMap(java.lang.String name)Returns the the "Attribute Map" for a named connectorjava.lang.StringgetCommandLineConfigId()static RS.ConfigInstanceNamingPolicygetConfigInstanceNamingPolicy()java.lang.StringgetConfigPath()This method returns the current configuration file pathjava.lang.ObjectgetConfiguration(java.lang.String key)Returns the entire table or a sub-section of the configuration file.ConnectorConfiggetConnector(java.lang.String name)Returns the "Connector" entry for nameConnectorPoolgetConnectorPool(java.lang.String connName)java.lang.String[]getConnectorPoolNames()java.lang.ThrowablegetExitError()Returns the exit error of the instanceintgetExitStatus()Gets the exit code of the instanceFunctionConfiggetFunction(java.lang.String name)Returns the "FunctionConfig" entry for nameLibraryConfiggetLibraries()Returns all "Libraries"java.lang.ObjectgetLibrary(java.lang.String name)Returns the the "Java Library" entry for nameLoggetLog()Returns the Log for the current instancejava.lang.StringgetLogDirectory(java.lang.Object owner)This method returns the default directory path where log files are stored.MetamergeConfiggetMetamergeConfig()Returns the config object for this instance.java.lang.StringgetNullBehavior()Return the null behavior string from the System.propsjava.lang.StringgetNullBehaviorValue()Gets the null behavior value.java.lang.StringgetNullDefinition()Return the null definition string from the System.propsjava.lang.StringgetNullDefinitionValue()Gets the null definition value.ParserConfiggetParser(java.lang.String name)Returns the the "Parser" entry for namestatic ReconnectRuleEnginegetReconnectRuleEngine()Gets the reconnect engine.SchedulergetScheduler(java.lang.String name)Returns the Scheduler with the given name.java.util.Map<java.lang.String,java.lang.Object>getSchedulerInfo(java.lang.String name)Returns information about the named Scheduler.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>getSchedulersInfo()Returns information about all Schedulers in this RS.ScriptConfiggetScript(java.lang.String name)Returns the the "Script Library" entry for namestatic RSgetServer()Returns the RS instance associated with the current ThreadGroup.static RSgetServer(java.lang.String name)Returns a namedRSinstancestatic RSgetServerByConfig(MetamergeConfig aConfig)Gets the server instance that uses the specified by theaConfigconfiguration.javax.net.ServerSocketFactorygetServerSocketFactory(boolean useSSL)Gets a Server Socket Factory for creating Server Sockets.java.lang.StringgetSysProp(java.lang.String name)Returns the value of a system property.AssemblyLineConfiggetTask(java.lang.String name)Returns the "AssemblyLine" entryjava.lang.ObjectinvokeServerHook(java.lang.String name, java.lang.Object caller, java.lang.Object userInfo)Invokes a server hook.static booleanisSecured()Check if the server is running in secured mode.voidlimitNumberOfThreads()This method is called by thestartAL(String, Object, LogInterface)method to check whether a limit of the maximum running threads exists.voidlogerror(java.lang.String msg)Writes an error message to the system log file.voidlogerror(java.lang.String msg, java.lang.Throwable error)Prints a message to the log, marked as an Error.voidlogmsg(java.lang.String msg)Writes a message to the system log file.voidlogmsg(java.lang.String level, java.lang.String msg)This method logs a message with the specified level to the log.static voidmain(java.lang.String[] args)The main methods creates the Log object and kicks off the main thread.voidpauseScheduler(java.lang.String name)Pauses the Scheduler with the given namevoidpersistConfiguration()This method saves the current configuration to disk.static voidprepareSolutionDirectory(Log log)Prepare the solution directory (working directory) by ensuring solution.properties is present.static voidregisterServer(RS server)Registers the config object to be associated with the current ThreadGroupvoidreload()This method reloads the configuration file.ConfigInstanceListenerremoveListener(ConfigInstanceListener listener)This method is for internal use only.AssemblyLinerestartAL(java.lang.String assemblyLine, java.lang.String checkpointID)Deprecated.voidresumeScheduler(java.lang.String name)Resumes the Scheduler with the given namevoidrun()Thread mainintrunServer()Used when starting the server instance.static voidsetConfigInstanceNamingPolicy(RS.ConfigInstanceNamingPolicy newPolicy)voidsetConfigPath(java.lang.String path)This method sets the current configuration file path.voidsetConfiguration(MetamergeConfig config)Sets the configuration that will be used by the server.static voidsetGlobalProperties()This method loads the global.properties/solution.properties and parses their content.voidsetMetamergeConfig(MetamergeConfig config)Sets the given configuration to this instance.static booleanshouldCreateSolutionProps()Checks if the solution.properties file should be created.static voidshowLogHeader(Log log)This method writes a log header to the Log object.static voidshutdownAllServers(int exitCode, boolean master, boolean async)This method shuts down all Config Instances.voidshutdownScheduler(java.lang.String name)Shuts down the Scheduler with the given namevoidshutdownServer()Raise the shutdown request flag and set the exit code to 0.voidshutdownServer(int aExitCode)Raise the shutdown request flag and specify an exit code.voidshutdownServer(int exitCode, boolean async)Raise the shutdown request flag.AssemblyLinestartAL(TaskCallBlock tcb)Start the AssemblyLine named in the TCBAssemblyLinestartAL(java.lang.String assemblyLine)Start a named AssemblyLine.AssemblyLinestartAL(java.lang.String assemblyLine, int runMode)Start named AssemblyLine by providing the run mode.AssemblyLinestartAL(java.lang.String assemblyLine, Connector connector, Entry work)Start named AssemblyLine providing an initial work entry and a connectorAssemblyLinestartAL(java.lang.String assemblyLine, java.lang.Object io)Start a named AssemblyLine providing various objects.AssemblyLinestartAL(java.lang.String assemblyLine, java.lang.Object io, LogInterface logAppender)Start named AssemblyLine providing a parameterAssemblyLinestartAL(java.lang.String assemblyLine, java.lang.Object io, LogInterface logAppender, AssemblyLineConfig alc)Start named AssemblyLine providing parametersAssemblyLinestartALDebug(java.lang.String assemblyLine, int port)Start named AssemblyLine in debug mode.voidstartScheduler(java.lang.String name)Starts the Scheduler with the given name.SequencestartSequence(java.lang.String name)Starts the Sequence with the given nameSequencestartSequence(java.lang.String name, java.lang.Object io)Starts the Sequence with the given nameSequencestartSequence(java.lang.String name, java.lang.Object io, LogInterface logger)Starts the Sequence with the given namestatic RSstartServer(java.lang.String[] args)Starts server usingnullfor the unique name of the server instance and command line parameters parsed to params table.static RSstartServer(java.lang.String config, java.lang.String assemblyLines)Starts server usingnullfor the unique name of the server instance.static RSstartServer(java.lang.String config, java.lang.String assemblyLines, java.lang.String passw)Starts server usingnullfor the unique name of the server instance.static RSstartServer(java.lang.String config, java.lang.String assemblyLines, java.lang.String passw, boolean dontTerminate)Starts server usingnullfor the unique name of the server instance.static RSstartServer(java.lang.String config, java.lang.String assemblyLines, java.lang.String passw, boolean dontTerminate, java.util.Hashtable<java.lang.String,java.lang.Object> userParams)Starts server usingnullfor the unique name of the server instance.static RSstartServer(java.lang.String groupName, java.util.Hashtable<java.lang.String,java.lang.Object> params)Starts a new server instance.static intstopAL(java.lang.String name)Stop named AssemblyLine in all Config Instances.static voidstopAssemblyLines(java.lang.String name, int hashCode, boolean recurse, boolean async, RS rs)Stops specified running AssemblyLines.static voidstopChildAssemblyLines(AssemblyLine al, boolean async)Recursively stop all children of one AssemblyLine.voidstopSchedulers()Stops all Schedulers belonging to this RS.static voidunregisterServer(RS server)Registers the config object to be associated with the current ThreadGroupbooleanwaitForInitializationToComplete(long milliseconds)This method is for internal use only.-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.ibm.di.server.RSInterface
getName
-
-
-
-
Field Detail
-
CL_USAGE
public static final java.lang.String CL_USAGE
Command line switch - ? See the parameters' usage.- See Also:
- Constant Field Values
-
CL_START_AL
public static final java.lang.String CL_START_AL
Command line switch - r See the parameters' usage.- See Also:
- Constant Field Values
-
CL_NO_AUTOSTART
public static final java.lang.String CL_NO_AUTOSTART
Command line switch - D See the parameters' usage.- See Also:
- Constant Field Values
-
CL_CONFIG
public static final java.lang.String CL_CONFIG
Command line switch - c See the parameters' usage.- See Also:
- Constant Field Values
-
CL_WAIT
public static final java.lang.String CL_WAIT
Command line switch - w See the parameters' usage.- See Also:
- Constant Field Values
-
CL_PASSWORD
public static final java.lang.String CL_PASSWORD
Command line switch - P See the parameters' usage.- See Also:
- Constant Field Values
-
CL_DUMP_PROPS
public static final java.lang.String CL_DUMP_PROPS
Command line switch - p See the parameters' usage.- See Also:
- Constant Field Values
-
CL_VERSION_INFO
public static final java.lang.String CL_VERSION_INFO
Command line switch - v See the parameters' usage.- See Also:
- Constant Field Values
-
CL_EXECUTE_SCRIPT
public static final java.lang.String CL_EXECUTE_SCRIPT
Command line switch - x See the parameters' usage.- See Also:
- Constant Field Values
-
CL_RUN_DAEMON
public static final java.lang.String CL_RUN_DAEMON
Command line switch - d See the parameters' usage.- See Also:
- Constant Field Values
-
CL_SECURE_MODE
public static final java.lang.String CL_SECURE_MODE
Command line switch - e See the parameters' usage.- See Also:
- Constant Field Values
-
CL_EXT_PROP_FILE
public static final java.lang.String CL_EXT_PROP_FILE
Command line switch - f See the parameters' usage.- See Also:
- Constant Field Values
-
CL_DEBUG_OPTIONS
public static final java.lang.String CL_DEBUG_OPTIONS
Command line switch - b See the parameters' usage.- See Also:
- Constant Field Values
-
CL_AL_DEBUG
public static final java.lang.String CL_AL_DEBUG
Command line switch - B See the parameters' usage.- See Also:
- Constant Field Values
-
CL_DEBUG_PORT
public static final java.lang.String CL_DEBUG_PORT
Command line switch - Q See the parameters' usage.- See Also:
- Constant Field Values
-
CL_CONFIG_STDIN
public static final java.lang.String CL_CONFIG_STDIN
Command line switch - S See the parameters' usage.- See Also:
- Constant Field Values
-
CL_RUN_MODE
public static final java.lang.String CL_RUN_MODE
Command line switch - q See the parameters' usage.- See Also:
- Constant Field Values
-
CL_CONFIG_DRIVER
public static final java.lang.String CL_CONFIG_DRIVER
Command line switch - Y See the parameters' usage.- See Also:
- Constant Field Values
-
CL_LOGFILE
public static final java.lang.String CL_LOGFILE
Command line switch - l See the parameters' usage.- See Also:
- Constant Field Values
-
CL_NO_TERMINATE
public static final java.lang.String CL_NO_TERMINATE
Command line switch - W See the parameters' usage.- See Also:
- Constant Field Values
-
CL_DISABLE_REMOTE_API
public static final java.lang.String CL_DISABLE_REMOTE_API
Command line switch - R See the parameters' usage.- See Also:
- Constant Field Values
-
CL_CONFIG_ENCODING
public static final java.lang.String CL_CONFIG_ENCODING
Command line switch - n See the parameters' usage.- See Also:
- Constant Field Values
-
CL_DUMP_PERFPROPS
public static final java.lang.String CL_DUMP_PERFPROPS
Command line switch - T See the parameters' usage.- See Also:
- Constant Field Values
-
CL_SIMULATION_MODE
public static final java.lang.String CL_SIMULATION_MODE
Command line switch - M See the parameters' usage.- See Also:
- Constant Field Values
-
CL_CREATE_SOLDIR
public static final java.lang.String CL_CREATE_SOLDIR
Command line switch - g See the parameter's usage.- See Also:
- Constant Field Values
-
CL_IGNORE_GLOBAL_PROPERTIES
public static final java.lang.String CL_IGNORE_GLOBAL_PROPERTIES
Command line switch - i
if this option is specified, the server will not read global.properties; solution.properties will still be read if present- See Also:
- Constant Field Values
-
CL_READ_REGRESSION
public static final java.lang.String CL_READ_REGRESSION
Command line switch - j
if this option is specified, the AssemblyLine will read regression info from a file with that name.- See Also:
- Constant Field Values
-
CL_WRITE_REGRESSION
public static final java.lang.String CL_WRITE_REGRESSION
Command line switch - J
if this option is specified, the AssemblyLine will write regression info to a file with that name.- See Also:
- Constant Field Values
-
CL_REGRESSION_IGNORE_WORK
public static final java.lang.String CL_REGRESSION_IGNORE_WORK
Command line switch - k
If this option is specified, the work Entry will be ignored when reading or writing regression info.- See Also:
- Constant Field Values
-
CL_START_DERBY
public static final java.lang.String CL_START_DERBY
Command line switch -X
If this option is specified, Derby will be started and the server will exit.- See Also:
- Constant Field Values
-
CL_STOP_DERBY
public static final java.lang.String CL_STOP_DERBY
Command line switch -Y
If this option is specified, Derby will be stopped and the server will exit.- See Also:
- Constant Field Values
-
CL_INTERNAL_CONFIG_NSTANCE_NAME
public static final java.lang.String CL_INTERNAL_CONFIG_NSTANCE_NAME
This is not a command line option but an internal parameter that lets you start a Config Instance with a name different than the config file name. It is used for starting temporary Config Instances on load for editing.- See Also:
- Constant Field Values
-
CL_INTERNAL_CONFIG_AS_STRING
public static final java.lang.String CL_INTERNAL_CONFIG_AS_STRING
This is not a command line option but an internal parameter that lets you start a Config Instance by providing the configuration XML as a string.- See Also:
- Constant Field Values
-
CL_INTERNAL_ADD_LISTENER
public static final java.lang.String CL_INTERNAL_ADD_LISTENER
This is not a command line option but an internal parameter that lets you specify an additional config instance listener. The listener must implement thecom.ibm.di.server.ConfigInstanceListenerinterface.- See Also:
- Constant Field Values
-
PROPERTY_JVM_SHUTDOWN_HOOK
public static final java.lang.String PROPERTY_JVM_SHUTDOWN_HOOK
The server will look for a property with this name when registering a shutdown hook. A System property with that name could hold a path the an executable file which will be executed when the server shuts down.- See Also:
- Constant Field Values
-
PROTECT_PREFIX
public static final java.lang.String PROTECT_PREFIX
This is the prefix of a property in the global.properties or solution.properties files.- See Also:
- Constant Field Values
-
PROTECT_VAL_PREFIX
public static final java.lang.String PROTECT_VAL_PREFIX
This is the prefix of the value of a protected property in the global.properties or solution.properties files.- See Also:
- Constant Field Values
-
PROP_CONFIG_ENCODING
public static final java.lang.String PROP_CONFIG_ENCODING
System property that specifies the encoding to be used when reading/writing configuration files.- See Also:
- Constant Field Values
-
PROP_SECURE_MODE
public static final java.lang.String PROP_SECURE_MODE
System property that specifies whether the Server is run in secure mode.- See Also:
- Constant Field Values
-
EXIT_CODE_REST_FAILED
public static final int EXIT_CODE_REST_FAILED
The exit code returned when REST fails.- See Also:
- Constant Field Values
-
gSysConfig
public static MetamergeConfig gSysConfig
This is the templates configuration file loaded from the rs.jar file
-
params
public java.util.Hashtable<java.lang.String,java.lang.Object> params
This table holds startup parameters.
-
mmServerStarted
public long mmServerStarted
Time when the masterRSstarted
-
mmStarted
public long mmStarted
Time when the threadedRSstarted
-
mmReloaded
public long mmReloaded
Time when thereload()method was called.
-
gRS
public static RS gRS
Global static reference to the master RS object (non-threaded)
-
-
Method Detail
-
main
public static void main(java.lang.String[] args) throws java.lang.ExceptionThe main methods creates the Log object and kicks off the main thread.- Parameters:
args- an array of the command line arguments- Throws:
java.lang.Exception- if error while preparing the solution directory occurs.
-
isSecured
public static boolean isSecured()
Check if the server is running in secured mode.- Returns:
- true if the server is in secure mode, false otherwise.
-
getReconnectRuleEngine
public static ReconnectRuleEngine getReconnectRuleEngine()
Gets the reconnect engine.- Returns:
ReconnectRuleEngineobject responsible for handling errors.
-
setConfiguration
public void setConfiguration(MetamergeConfig config)
Sets the configuration that will be used by the server.- Parameters:
config- the configuration object.
-
getConfiguration
public java.lang.Object getConfiguration(java.lang.String key)
Returns the entire table or a sub-section of the configuration file.- Specified by:
getConfigurationin interfaceRSInterface- Parameters:
key- Name of subsection or null- Returns:
- The entire table (name == null) or section in table
-
getLibrary
public java.lang.Object getLibrary(java.lang.String name)
Returns the the "Java Library" entry for name- Specified by:
getLibraryin interfaceRSInterface- Parameters:
name- The java library name- Returns:
- The section for name
-
getFunction
public FunctionConfig getFunction(java.lang.String name) throws java.lang.Exception
Returns the "FunctionConfig" entry for name- Specified by:
getFunctionin interfaceRSInterface- Parameters:
name- The name of the function- Returns:
- The function config object
- Throws:
java.lang.Exception- if a lookup error occurs.
-
getLibraries
public LibraryConfig getLibraries()
Returns all "Libraries"- Specified by:
getLibrariesin interfaceRSInterface- Returns:
- The entire list of Libraries
-
getScript
public ScriptConfig getScript(java.lang.String name)
Returns the the "Script Library" entry for name- Specified by:
getScriptin interfaceRSInterface- Parameters:
name- The script library name- Returns:
- The section for name
-
getConnector
public ConnectorConfig getConnector(java.lang.String name)
Returns the "Connector" entry for name- Specified by:
getConnectorin interfaceRSInterface- Parameters:
name- The connector name- Returns:
- The section from either the file configuration or the templates configuration
-
getParser
public ParserConfig getParser(java.lang.String name)
Returns the the "Parser" entry for name- Specified by:
getParserin interfaceRSInterface- Parameters:
name- The parser name- Returns:
- The section either the file configuration or the templates configuration
-
getAttributeMap
public AttributeMapConfig getAttributeMap(java.lang.String name)
Returns the the "Attribute Map" for a named connector- Specified by:
getAttributeMapin interfaceRSInterface- Parameters:
name- The connector name- Returns:
- The attribute map section
-
getTask
public AssemblyLineConfig getTask(java.lang.String name)
Returns the "AssemblyLine" entry- Specified by:
getTaskin interfaceRSInterface- Parameters:
name- The AssemblyLine name- Returns:
- The configuration for the AssemblyLine
-
checkTask
public void checkTask(java.lang.String name) throws java.lang.ExceptionCheck for existence of "AssemblyLine" name, or throw an exception- Parameters:
name- The AssemblyLine name- Throws:
java.lang.Exception- in case the AssemblyLine referred by the provided name could not be found.
-
getSysProp
public java.lang.String getSysProp(java.lang.String name)
Returns the value of a system property. The system properties include all Java system properties as well as TDI's own properties.- Specified by:
getSysPropin interfaceRSInterface- Parameters:
name- The system property name, ornullif there is no property with that name- Returns:
- The value for the property
-
runServer
public int runServer()
Used when starting the server instance.- Returns:
- the exit code the server ended with.
-
restartAL
@Deprecated public AssemblyLine restartAL(java.lang.String assemblyLine, java.lang.String checkpointID) throws java.lang.Exception
Deprecated.Restart the AssemblyLine given by the parameter.- Specified by:
restartALin interfaceRSInterface- Parameters:
assemblyLine- The name identifying the AssemblyLine to startcheckpointID- The checkpoint identifier- Returns:
- The AssemblyLine Thread object
- Throws:
java.lang.Exception- ifassemblyLineis an unknown AssemblyLine or if any of the connectors cannot be re-initialized
-
startAL
public AssemblyLine startAL(java.lang.String assemblyLine) throws java.lang.Exception
Start a named AssemblyLine. See also the introduction to AssemblyLines.Example:
var al = main.startAL("ALName"); var tcb = al.getTCB(); main.logmsg("AL run mode: " + tcb.getRunMode()); main.logmsg("AL operation: " + tcb.getALOperation()); main.logmsg("AL settings: "); main.dumpEntry(tcb.getALSettings());- Specified by:
startALin interfaceRSInterface- Parameters:
assemblyLine- The name identifying the AssemblyLine to start- Returns:
- The AssemblyLine Thread object
- Throws:
java.lang.Exception- ifassemblyLineis an unknown AssemblyLine or if any of the connectors cannot be initialized
-
startAL
public AssemblyLine startAL(java.lang.String assemblyLine, int runMode) throws java.lang.Exception
Start named AssemblyLine by providing the run mode.- Parameters:
assemblyLine- Name of AssemblyLine to startrunMode- the run mode in which the AssemblyLine should start- Returns:
- The AssemblyLine Thread object
- Throws:
java.lang.Exception- in case the AssemblyLine initialization fails.- See Also:
AssemblyLine.RUNMODE_I_NORMAL,AssemblyLine.RUNMODE_I_RECORD,AssemblyLine.RUNMODE_I_PLAYBACK,AssemblyLine.RUNMODE_I_MANUAL
-
startALDebug
public AssemblyLine startALDebug(java.lang.String assemblyLine, int port) throws java.lang.Exception
Start named AssemblyLine in debug mode.- Parameters:
assemblyLine- Name of AssemblyLine to startport- the port which the debug console will connect to.- Returns:
- The AssemblyLine Thread object
- Throws:
java.lang.Exception- if the AssemblyLine initialization fails.
-
startAL
public AssemblyLine startAL(java.lang.String assemblyLine, Connector connector, Entry work) throws java.lang.Exception
Start named AssemblyLine providing an initial work entry and a connectorExample:
var iwe = new com.ibm.di.entry.Entry(); iwe.setAttribute("linenumber", "1"); iwe.setAttribute("line", "Some line with text"); var c = main.getConnector("ConnectorName"); var al = main.startAL("ALName", c, iwe); var tcb = al.getTCB(); main.logmsg("AL run mode: " + tcb.getRunMode()); main.logmsg("AL initial work entry: "); main.dumpEntry(tcb.getInitialWorkEntry());- Specified by:
startALin interfaceRSInterface- Parameters:
assemblyLine- The name identifying the AssemblyLine to startconnector- The runtime-provided Connectorwork- The initial work entry- Returns:
- The AssemblyLine Thread object
- Throws:
java.lang.Exception- ifassemblyLineis an unknown AssemblyLine or if any of the connectors cannot be initialized
-
startAL
public AssemblyLine startAL(TaskCallBlock tcb) throws java.lang.Exception
Start the AssemblyLine named in the TCBExample:
var tcb = system.newTCB(); tcb.setAssemblyLineName("ALName"); tcb.setRunMode(com.ibm.di.server.AssemblyLine.RUNMODE_NORMAL); // "normal" var al = main.startAL(tcb); al.join(); // Wait for called AL to complete- Parameters:
tcb- The TaskCallBlock- Returns:
- The AssemblyLine Thread object
- Throws:
java.lang.Exception- if the AssemblyLine initialization fails.
-
startAL
public AssemblyLine startAL(java.lang.String assemblyLine, java.lang.Object io) throws java.lang.Exception
Start a named AssemblyLine providing various objects.Example:
var iwe = new com.ibm.di.entry.Entry(); iwe.setAttribute("linenumber", "1"); iwe.setAttribute("", "Some line with text"); var c = new com.ibm.di.connectors.FileConnector(); var al = main.startAL("ALName", iwe); var tcb = al.getTCB(); main.logmsg("AL run mode: " + tcb.getRunMode()); main.logmsg("AL connector 'debug' parameter: " + tcb.getConnectorParameter("ConnectorName", "debug")); main.logmsg("AL initial work entry: "); main.dumpEntry(tcb.getInitialWorkEntry());- Specified by:
startALin interfaceRSInterface- Parameters:
assemblyLine- The name identifying the AssemblyLine to startio- This Object could either be- an Entry, used as the initial work entry
- a Connector, used as a runtime-provided Connector
- a Vector that could contain Entry, Connector(s), TCB or a Log objects, used for configuring the AssemblyLine instance.
- a TCB, that holds some special configuration fields read by the AssemblyLine
- Returns:
- The AssemblyLine Thread object
- Throws:
java.lang.Exception- ifassemblyLineis an unknown AssemblyLine or if any of the connectors cannot be initialized
-
startAL
public AssemblyLine startAL(java.lang.String assemblyLine, java.lang.Object io, LogInterface logAppender) throws java.lang.Exception
Start named AssemblyLine providing a parameter- Parameters:
assemblyLine- Name of AssemblyLine to startio- Parameter to AssemblyLine (Work Entry, Connector or Vector with both )logAppender- An additional logger to use with the AssemblyLine- Returns:
- The AssemblyLine Thread object
- Throws:
java.lang.Exception- if an error while starting the AL thread occurs.
-
startAL
public AssemblyLine startAL(java.lang.String assemblyLine, java.lang.Object io, LogInterface logAppender, AssemblyLineConfig alc) throws java.lang.Exception
Start named AssemblyLine providing parameters- Parameters:
assemblyLine- Name of AssemblyLine to startio- Parameter to AssemblyLine (Work Entry, Connector or Vector with both )logAppender- An additional logger to use with the AssemblyLinealc- The AssemblyLineConfig to use. Note that when an AssemblyLineConfig is specified, it will not be cloned. Therefore the same object should not be used in multiple calls to this method, since each AssemblyLine needs a unique AssemblyLineConfig.- Returns:
- The AssemblyLine Thread object
- Throws:
java.lang.Exception- if an error while starting the AL thread occurs.
-
startSequence
public Sequence startSequence(java.lang.String name) throws java.lang.Exception
Starts the Sequence with the given name- Parameters:
name- Name of the Sequence- Returns:
- The Sequence that was started
- Throws:
java.lang.Exception- Since:
- 7.2
-
startSequence
public Sequence startSequence(java.lang.String name, java.lang.Object io) throws java.lang.Exception
Starts the Sequence with the given name- Parameters:
name- Name of the Sequenceio- Parameters to the Sequence, e.g a ScriptEngine or a Vector of parameters. These will be passed to all AssemblyLines in the Sequence.- Returns:
- The Sequence that was started
- Throws:
java.lang.Exception- Since:
- 7.2
-
startSequence
public Sequence startSequence(java.lang.String name, java.lang.Object io, LogInterface logger) throws java.lang.Exception
Starts the Sequence with the given name- Parameters:
name- Name of the Sequenceio- Parameters to the Sequence, e.g a ScriptEngine or a Vector of parameters. These will be passed to all AssemblyLines in the Sequence.logger- A LogInterface that will be used for logging.- Returns:
- The Sequence that was started
- Throws:
java.lang.Exception- Since:
- 7.2
-
stopAL
public static int stopAL(java.lang.String name)
Stop named AssemblyLine in all Config Instances.- Parameters:
name- Name of AssemblyLine to stop- Returns:
- The number of AssemblyLines we tried to stop
-
logmsg
public void logmsg(java.lang.String msg)
Writes a message to the system log file.Example:
main.logmsg("Conn object: "); main.dumpEntry(conn);- Specified by:
logmsgin interfaceRSInterface- Parameters:
msg- The message to be output.
-
logmsg
public void logmsg(java.lang.String level, java.lang.String msg)This method logs a message with the specified level to the log.Example:
main.logmsg("INFO", "Reading entry..."); var entry = input.getConnector().getNextEntry();- Specified by:
logmsgin interfaceRSInterface- Parameters:
level- Level of log. Legal values are FATAL, ERROR, WARN, INFO, DEBUG. Unrecognized keyword means DEBUG.msg- The message
-
logerror
public void logerror(java.lang.String msg, java.lang.Throwable error)Prints a message to the log, marked as an Error. This method accepts an instance of theThrowableclass which information is also put in the log.- Parameters:
msg- the String messageerror- the exception object
-
logerror
public void logerror(java.lang.String msg)
Writes an error message to the system log file.- Specified by:
logerrorin interfaceRSInterface- Parameters:
msg- The message to output
-
dump
public void dump(java.lang.Object o)
Dumps the class and contents of an object to the log file. If this is an Entry, use theRSInterface.dumpEntry(Entry)method instead.- Specified by:
dumpin interfaceRSInterface- Parameters:
o- The object to dump- See Also:
RSInterface.dumpEntry(Entry)
-
dumpEntry
public void dumpEntry(Entry e)
Dumps the contents of an Entry to the log file.Example:
var ctor = input.getConnector(); for (;;) { var entry = ctor.getNextEntry(); if (entry != null) { main.logmsg("Read entry: "); main.dumpEntry(entry); } else break; }- Specified by:
dumpEntryin interfaceRSInterface- Parameters:
e- The Entry object to dump- See Also:
Entry
-
reload
public void reload() throws java.lang.ExceptionThis method reloads the configuration file.- Specified by:
reloadin interfaceRSInterface- Throws:
java.lang.Exception- if the operation fails.
-
getConfigPath
public java.lang.String getConfigPath()
This method returns the current configuration file path- Specified by:
getConfigPathin interfaceRSInterface- Returns:
- The configuration file path as a string
-
setConfigPath
public void setConfigPath(java.lang.String path)
This method sets the current configuration file path. This will be used when a persistConfiguration is requested.- Specified by:
setConfigPathin interfaceRSInterface- Parameters:
path- The new configuration path
-
persistConfiguration
public void persistConfiguration() throws java.lang.ExceptionThis method saves the current configuration to disk.- Specified by:
persistConfigurationin interfaceRSInterface- Throws:
java.lang.Exception- if an error while persisting the configuration occurs.
-
showLogHeader
public static void showLogHeader(Log log)
This method writes a log header to the Log object.- Parameters:
log- The log output object
-
getLogDirectory
public java.lang.String getLogDirectory(java.lang.Object owner)
This method returns the default directory path where log files are stored. TODO: implement this- Parameters:
owner- The Java class or string denoting the type (e.g. AssemblyLine)- Returns:
- The log file directory
-
shutdownServer
public void shutdownServer()
Raise the shutdown request flag and set the exit code to 0. This method requests controlled shutdown of all assembly lines running on the server at the time of calling.- Specified by:
shutdownServerin interfaceRSInterface
-
shutdownServer
public void shutdownServer(int aExitCode)
Raise the shutdown request flag and specify an exit code.- Specified by:
shutdownServerin interfaceRSInterface- Parameters:
aExitCode- the code to return when the application exits.
-
shutdownServer
public void shutdownServer(int exitCode, boolean async)Raise the shutdown request flag. This method requests controlled shutdown of all AssemblyLines running on the server at the time of calling, and waits for the AssemblyLines to stop.- Parameters:
exitCode- the code to return when the application exits.async- If true, crate new Threads to wait for the AssemblyLines to stop- Since:
- 7.1
-
stopAssemblyLines
public static void stopAssemblyLines(java.lang.String name, int hashCode, boolean recurse, boolean async, RS rs) throws AbortALExceptionStops specified running AssemblyLines.- Parameters:
name- The name of the AssemblyLine, or null for any name.hashCode- The hashCode for the AssemblyLine, as seen in the log files. -1 is any hashCode.recurse- If true, recursively stop any AssemblyLines started by the AssemblyLine(s) to stop.async- If true, crate new Threads to wait for the AssemblyLines to stoprs- If null, stop AssemblyLines in any RS. If non-null, only stop AssemblyLines in that RS.- Throws:
AbortALException- if this method stops the AssemblyLine that called it.- Since:
- 7.1
-
stopChildAssemblyLines
public static void stopChildAssemblyLines(AssemblyLine al, boolean async) throws AbortALException
Recursively stop all children of one AssemblyLine. Only the children are stopped, not the AssemblyLine itself.- Parameters:
al- The Assemblyline whose children are to be stopped.async- If true, crate new Threads to wait for the AssemblyLines to stop- Throws:
AbortALException- if this method shuts down the AssemblyLine that called it.- Since:
- 7.1
-
getNullBehavior
public java.lang.String getNullBehavior()
Return the null behavior string from the System.props- Specified by:
getNullBehaviorin interfaceRSInterface- Returns:
- the null behavior string
-
getNullBehaviorValue
public java.lang.String getNullBehaviorValue()
Gets the null behavior value.- Specified by:
getNullBehaviorValuein interfaceRSInterface- Returns:
- the null behavior value string or null if it have not been set yet.
-
getNullDefinition
public java.lang.String getNullDefinition()
Return the null definition string from the System.props- Specified by:
getNullDefinitionin interfaceRSInterface- Returns:
- the null Definition string
-
getNullDefinitionValue
public java.lang.String getNullDefinitionValue()
Gets the null definition value.- Specified by:
getNullDefinitionValuein interfaceRSInterface- Returns:
- the null definition value string or null if it have not been set yet.
-
getServerSocketFactory
public javax.net.ServerSocketFactory getServerSocketFactory(boolean useSSL)
Gets a Server Socket Factory for creating Server Sockets. The boolean parameteruseSSLdetermines whether a SSL Server Socket Factory is returned or non-SSL one.
This method returns a new instance each time when it is called. The reason for this is that the implementation of the caller may be different. Sometimes SSL Factory may be needed while some other times NOT.
This method is for internal use only and you should not rely on it for any other purpose.- Specified by:
getServerSocketFactoryin interfaceRSInterface- Parameters:
useSSL- Determines if SSL or non-SSL Server Socket Factory is returns for use.- Returns:
- Server Socket Factory for obtaining Server Sockets.
-
limitNumberOfThreads
public void limitNumberOfThreads()
This method is called by thestartAL(String, Object, LogInterface)method to check whether a limit of the maximum running threads exists.The limit is set using the Java property "com.ibm.di.server.maxThreadsRunning". If there is such a property and its value is greater than 3 then the thread that calls this method (usually an AssemblyLine thread) will have to wait until another thread ends. If the value of the Java property is not a string representation of an
intthen the maximum running threads limit check is not done.If the thread calling this method is waiting for one of the running threads to end is unable to start in timely fashion then a warning for possible deadlock will be output to the log. In that case the calling thread will start.
-
setGlobalProperties
public static void setGlobalProperties()
This method loads the global.properties/solution.properties and parses their content.
-
shouldCreateSolutionProps
public static boolean shouldCreateSolutionProps()
Checks if the solution.properties file should be created.- Returns:
- false if the solution.properties file exists, true if the file does not exist and should be created
-
prepareSolutionDirectory
public static void prepareSolutionDirectory(Log log) throws java.lang.Exception
Prepare the solution directory (working directory) by ensuring solution.properties is present.- Parameters:
log- the log object to log in.- Throws:
java.lang.Exception- if I/O error occurs while working with files.
-
encryptPropertiesfile
public static void encryptPropertiesfile(java.lang.String path, Log log)Loads the properties from the specified file and sets them as system properties. If the properties file references other properties files, those will be loaded too. Decrypts encrypted properties. If decryption fails, an error message is logged and operation continues. After loading, the method overwrites the file to ensure that all protected properties are encrypted. The file will not be overwritten, if all its protected properties are already encrypted. The file will also not be overwritten, if there is no write-access to it. The method does not throw - all errors are logged in the specified logger.- Parameters:
path- a properties filelog- logger
-
run
public void run()
Thread main- Specified by:
runin interfacejava.lang.Runnable- Overrides:
runin classjava.lang.Thread
-
commandLineParam
public java.lang.String commandLineParam(java.lang.String param)
Returns the value for a command line parameter- Parameters:
param- is switch which value to look for.- Returns:
- the value of a switch, or
nullif it does not exist in the map.
-
getMetamergeConfig
public MetamergeConfig getMetamergeConfig()
Returns the config object for this instance.- Specified by:
getMetamergeConfigin interfaceRSInterface- Returns:
- the configuration object of this instance.
-
setMetamergeConfig
public void setMetamergeConfig(MetamergeConfig config)
Sets the given configuration to this instance.- Specified by:
setMetamergeConfigin interfaceRSInterface- Parameters:
config- The configuration object to assign to the instance.
-
getLog
public Log getLog()
Returns the Log for the current instance- Specified by:
getLogin interfaceRSInterface- Returns:
- the main thread's Log object
-
getExitStatus
public int getExitStatus()
Gets the exit code of the instance- Returns:
- the exit code.
-
getExitError
public java.lang.Throwable getExitError()
Returns the exit error of the instance- Returns:
- the exception object of the RS instance (in case it failed)
-
getServerByConfig
public static RS getServerByConfig(MetamergeConfig aConfig)
Gets the server instance that uses the specified by theaConfigconfiguration.- Parameters:
aConfig- the configuration object used by the server instance- Returns:
- The
RSobject that correspond to the provided configuration, or null if it couldn't be found.
-
getServer
public static RS getServer()
Returns the RS instance associated with the current ThreadGroup. Although this method is public, it is meant for internal use. The usual way to get the current RS instance would be to use themainobject in JavaScript.- Returns:
- the
RSinstance ornullif it couldn't be found, e.g. because the current Thread was not created by the TDI framework.
-
getServer
public static RS getServer(java.lang.String name)
Returns a namedRSinstance- Parameters:
name- the name of the instance- Returns:
- the
RSif it is found,nullotherwise.
-
registerServer
public static void registerServer(RS server)
Registers the config object to be associated with the current ThreadGroup- Parameters:
server- the server to be registered, should not benull
-
unregisterServer
public static void unregisterServer(RS server)
Registers the config object to be associated with the current ThreadGroup- Parameters:
server- the server to unregister, should not benull
-
startServer
public static RS startServer(java.lang.String[] args) throws java.lang.Exception
Starts server usingnullfor the unique name of the server instance and command line parameters parsed to params table.Example:
var cmdline = "-"+com.ibm.di.server.RS.CL_CONFIG; cmdline += " test_config.xml -" cmdline += com.ibm.di.server.RS.CL_START_AL+" al1, al2" var srv = main.startServer(cmdline);
- Parameters:
args- the "command line arguments" to use when starting.- Returns:
- The new
RSinstance - Throws:
java.lang.Exception- if an error occurs.
-
startServer
public static RS startServer(java.lang.String config, java.lang.String assemblyLines) throws java.lang.Exception
Starts server usingnullfor the unique name of the server instance. This method starts specified assembly lines from specified configuration.The server started with this method shutdowns after the assembly line has finished and it can only start configurations not protected with passwords.
Example:
var config = "//configs//test_config.xml" var srv = main.startServer(config, "al2", null);
- Parameters:
config- the configuration to loadassemblyLines- the assembly lines to start- Returns:
- the new
RSinstance object - Throws:
java.lang.Exception- if the server initialization fails
-
startServer
public static RS startServer(java.lang.String config, java.lang.String assemblyLines, java.lang.String passw) throws java.lang.Exception
Starts server usingnullfor the unique name of the server instance. This method starts specified assembly lines from specified configuration.The server started with this method shutdowns after the assembly line has finished.
Example:
var config = "/configs/test_config.xml" var pass = "secret"; var srv = main.startServer(config, "al2", null, pass);
- Parameters:
config- the configuration to loadassemblyLines- the assembly lines to startpassw- the password used for the configuration file- Returns:
- the new
RSinstance object - Throws:
java.lang.Exception- if the server initialization fails
-
startServer
public static RS startServer(java.lang.String config, java.lang.String assemblyLines, java.lang.String passw, boolean dontTerminate) throws java.lang.Exception
Starts server usingnullfor the unique name of the server instance. This method starts specified assembly lines from specified configuration.Example:
var config = "/configs/test_config.xml" var pass = "secret"; var srv = main.startServer(config, "al1", null, pass, true); srv.startAL("al2");- Parameters:
config- the configuration to loadassemblyLines- the assembly lines to startpassw- the password used for the configuration filedontTerminate- whether to wait instead of shutting down the server after it has finished- Returns:
- the new
RSinstance object - Throws:
java.lang.Exception- if the server initialization fails
-
startServer
public static RS startServer(java.lang.String config, java.lang.String assemblyLines, java.lang.String passw, boolean dontTerminate, java.util.Hashtable<java.lang.String,java.lang.Object> userParams) throws java.lang.Exception
Starts server usingnullfor the unique name of the server instance. This method includes -D option for autostarting if user has specified it.Example:
var config = "/configs/test_config.xml" var pass = "secret"; var userParam = new java.util.Hashtable(); userParam.put(com.ibm.di.server.CL_NO_AUTOSTART, "true"); var srv = main.startServer(config, "al1", null, pass, true, userParam); srv.startAL("al2");- Parameters:
config- the configuration to loadassemblyLines- the assembly lines to startpassw- the password used for the configuration filedontTerminate- whether to wait instead of shutting down the server after it has finisheduserParams- checks this map if theCL_NO_AUTOSTARTexists.- Returns:
- the new
RSinstance object - Throws:
java.lang.Exception- if the server initialization fails
-
startServer
public static RS startServer(java.lang.String groupName, java.util.Hashtable<java.lang.String,java.lang.Object> params) throws java.lang.Exception
Starts a new server instance.Example:
var par = new java.util.Hashtable(); par.put(com.ibm.di.server.RS.CL_CONFIG, "tast_config.xml"); par.put(com.ibm.di.server.RS.CL_START_AL, "al1"); par.put(com.ibm.di.server.RS.CL_AL_DEBUG, "true"); var srv = main.startServer(null, par);
- Parameters:
groupName- The unique name for the server instanceparams- Hashtable of assembly lines to start (same syntax as command line)- Returns:
- the new
RSinstance object - Throws:
java.lang.Exception- if there is another instance using the same groupName
-
createConfigInstance
public static RS createConfigInstance(java.lang.String groupName, java.util.Hashtable<java.lang.String,java.lang.Object> params) throws java.lang.Exception
Create a new config instance but do not start it.- Parameters:
groupName- The unique name for the server instanceparams- Hashtable of assembly lines to start (same syntax as command line)- Returns:
- the new
RSinstance object - Throws:
java.lang.Exception- if there is another instance using the same groupName
-
getCommandLineConfigId
public java.lang.String getCommandLineConfigId()
- Returns:
- the identifier of the loaded configuration
-
invokeServerHook
public java.lang.Object invokeServerHook(java.lang.String name, java.lang.Object caller, java.lang.Object userInfo)Invokes a server hook.- Parameters:
name- The name of the hookcaller- The object invoking the hookuserInfo- Arbitrary information to the hook from the caller- Returns:
- The result from the function call or
nullif a hook with that name could not be found.
-
getConnectorPoolNames
public java.lang.String[] getConnectorPoolNames()
- Returns:
- an Array of String objects containing the names of the
ConnectorPools
-
getConnectorPool
public ConnectorPool getConnectorPool(java.lang.String connName)
- Parameters:
connName- the name of theConnectorPoolobject- Returns:
- the
ConnectorPoolinstance that corresponds of the provided name, if the name is not foundnullis returned.
-
getConfigInstanceNamingPolicy
public static RS.ConfigInstanceNamingPolicy getConfigInstanceNamingPolicy()
- Returns:
- The configuration instance naming policy of the Server.
- Since:
- 7.0
-
setConfigInstanceNamingPolicy
public static void setConfigInstanceNamingPolicy(RS.ConfigInstanceNamingPolicy newPolicy)
- Parameters:
newPolicy- A new configuration instance naming policy for the Server.- Since:
- 7.0
-
checkLUM
public static void checkLUM()
This function checks if a valid license to run the application exists in the nodelock file. If no license exists, the license has expired, or an error is encountered, the server will exit.- Since:
- 7.0
-
waitForInitializationToComplete
public boolean waitForInitializationToComplete(long milliseconds) throws java.lang.InterruptedExceptionThis method is for internal use only. Users must not rely on it.
Wait for the configuration instance (a.k.a
RSinstance) to complete its initialization. Normally the initialization procedure of a config instance involves activities such as parsing the configuration xml file and preparing internal structures like Connector Pools. You may care about initialization status, because it is not a good idea to start AssemblyLines on the RS instance before initialization is complete. Note that when initialization is complete theRSinstance might be in error state.- Parameters:
milliseconds- Timeout in milliseconds to wait for the initialization completion. If the time is less than or equal to zero, the method will not wait at all.- Returns:
trueif the count reached zero andfalseif the waiting time elapsed before the count reached zero.- Throws:
java.lang.InterruptedException- If the calling thread is interrupted while waiting for initialization status.- Since:
- 7.0
-
assemblyLineStarted
public void assemblyLineStarted(AssemblyLine al)
The AssemblyLine started.- Specified by:
assemblyLineStartedin interfaceAssemblyLine.AssemblyLineListener- Parameters:
al- The AssemblyLine.
-
assemblyLineCycleEnded
public void assemblyLineCycleEnded(AssemblyLine al, Entry work) throws java.lang.Exception
An AssemblyLine cycle (iteration) is complete.- Specified by:
assemblyLineCycleEndedin interfaceAssemblyLine.AssemblyLineListener- Parameters:
al- The AssemblyLine.work- The work Entry.- Throws:
java.lang.Exception- Will stop the AssemblyLine, so be careful.
-
assemblyLineTerminated
public void assemblyLineTerminated(AssemblyLine al)
The AssemblyLine terminated.- Specified by:
assemblyLineTerminatedin interfaceAssemblyLine.AssemblyLineListener- Parameters:
al- The AssemblyLine.
-
addListener
public void addListener(ConfigInstanceListener listener)
This method is for internal use only. Users must not rely on it.
Register listener to this configuration instance.
- Specified by:
addListenerin interfaceListenable<ConfigInstanceListener>- Parameters:
listener- Listener for configuration instance notifications.- Since:
- 7.0
-
removeListener
public ConfigInstanceListener removeListener(ConfigInstanceListener listener)
This method is for internal use only. Users must not rely on it.
Unregister listener from this configuration instance.
- Specified by:
removeListenerin interfaceListenable<ConfigInstanceListener>- Parameters:
listener- Registered listener.- Returns:
- the actual listener being removed. Note this might differ from the passed in which is only used for identification. This makes it easy to properly close the actual listener.
- Since:
- 7.0
-
shutdownAllServers
public static void shutdownAllServers(int exitCode, boolean master, boolean async)This method shuts down all Config Instances.- Parameters:
exitCode- The exit code to usemaster- If true, also stop the master serverasync- If true, crate new Threads to wait for the AssemblyLines to stop- Since:
- 7.1
-
shutdownScheduler
public void shutdownScheduler(java.lang.String name)
Shuts down the Scheduler with the given name- Parameters:
name- Name of the Scheduler- Since:
- 7.2
-
pauseScheduler
public void pauseScheduler(java.lang.String name)
Pauses the Scheduler with the given name- Parameters:
name- Name of the Scheduler- Since:
- 7.2
-
resumeScheduler
public void resumeScheduler(java.lang.String name)
Resumes the Scheduler with the given name- Parameters:
name- Name of the Scheduler- Since:
- 7.2
-
startScheduler
public void startScheduler(java.lang.String name) throws java.lang.ExceptionStarts the Scheduler with the given name. This may be useful if the Scheduler has been stopped.- Parameters:
name- Name of the Scheduler- Throws:
java.lang.Exception- If the Scheduler cannot be found.- Since:
- 7.2
-
stopSchedulers
public void stopSchedulers()
Stops all Schedulers belonging to this RS.- Since:
- 7.2
-
getScheduler
public Scheduler getScheduler(java.lang.String name)
Returns the Scheduler with the given name.- Parameters:
name- The name- Returns:
- The Scheduler with the given name
-
getSchedulerInfo
public java.util.Map<java.lang.String,java.lang.Object> getSchedulerInfo(java.lang.String name)
Returns information about the named Scheduler. If the Scheduler is not found, returns null.- Parameters:
name- - Name of Scheduler- Returns:
-
getSchedulersInfo
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getSchedulersInfo()
Returns information about all Schedulers in this RS. If no Schedulers are found, returns an empty List.- Returns:
-
-