|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
com.ibm.di.server.RS
public class RS
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.logConnector(). However, if you want the Connector Config instead, then use the similarly named method in RS instead. 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 | |
|---|---|
static interface |
RS.ConfigInstanceNamingPolicy
A policy which defines how configuration instances are named. |
static class |
RS.DefaultConfigInstanceNamingPolicy
The default naming policy. |
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
static java.lang.String |
CL_AL_DEBUG
Command line switch - B See the parameters' usage. |
static java.lang.String |
CL_CONFIG
Command line switch - c See the parameters' usage. |
static java.lang.String |
CL_CONFIG_DRIVER
Command line switch - Y See the parameters' usage. |
static java.lang.String |
CL_CONFIG_ENCODING
Command line switch - n See the parameters' usage. |
static java.lang.String |
CL_CONFIG_STDIN
Command line switch - S See the parameters' usage. |
static java.lang.String |
CL_CREATE_SOLDIR
Command line switch - g See the parameter's usage. |
static java.lang.String |
CL_DEBUG_OPTIONS
Command line switch - b See the parameters' usage. |
static java.lang.String |
CL_DEBUG_PORT
Command line switch - Q See the parameters' usage. |
static java.lang.String |
CL_DISABLE_REMOTE_API
Command line switch - R See the parameters' usage. |
static java.lang.String |
CL_DUMP_PERFPROPS
Command line switch - T See the parameters' usage. |
static java.lang.String |
CL_DUMP_PROPS
Command line switch - p See the parameters' usage. |
static java.lang.String |
CL_EXECUTE_SCRIPT
Command line switch - x See the parameters' usage. |
static java.lang.String |
CL_EXT_PROP_FILE
Command line switch - f See the parameters' usage. |
static 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 |
static java.lang.String |
CL_INTERNAL_ADD_LOGGER
This is not a command line option but an internal parameter that lets you specify an additional logger. |
static 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. |
static 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. |
static java.lang.String |
CL_LOGFILE
Command line switch - l See the parameters' usage. |
static java.lang.String |
CL_NO_AUTOSTART
Command line switch - D See the parameters' usage. |
static java.lang.String |
CL_NO_TERMINATE
Command line switch - W See the parameters' usage. |
static java.lang.String |
CL_PASSWORD
Command line switch - P See the parameters' usage. |
static java.lang.String |
CL_RUN_DAEMON
Command line switch - d See the parameters' usage. |
static java.lang.String |
CL_RUN_MODE
Command line switch - q See the parameters' usage. |
static java.lang.String |
CL_SECURE_MODE
Command line switch - e See the parameters' usage. |
static java.lang.String |
CL_SIMULATION_MODE
Command line switch - M See the parameters' usage. |
static java.lang.String |
CL_START_AL
Command line switch - r See the parameters' usage. |
static java.lang.String |
CL_USAGE
Command line switch - ? See the parameters' usage. |
static java.lang.String |
CL_VERSION_INFO
Command line switch - v See the parameters' usage. |
static java.lang.String |
CL_WAIT
Command line switch - w See the parameters' usage. |
static int |
EXIT_CODE_REST_FAILED
The exit code returned when REST fails. |
static RS |
gRS
Global static reference to the master RS object (non-threaded) |
static MetamergeConfig |
gSysConfig
This is the templates configuration file loaded from the rs.jar file |
long |
mmReloaded
Time when the reload() method was called. |
long |
mmServerStarted
Time when the master RS started |
long |
mmStarted
Time when the threaded RS started |
java.util.Hashtable<java.lang.String,java.lang.Object> |
params
This table holds startup parameters. |
static java.lang.String |
PROP_CONFIG_ENCODING
System property that specifies the encoding to be used when reading/writing configuration files. |
static java.lang.String |
PROP_SECURE_MODE
System property that specifies whether the Server is run in secure mode. |
static java.lang.String |
PROPERTY_JVM_SHUTDOWN_HOOK
The server will look for a property with this name when registering a shutdown hook. |
static java.lang.String |
PROTECT_PREFIX
This is the prefix of a property in the global.properties or solution.properties files. |
static 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. |
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
|
RS()
Default constructor |
protected |
RS(java.lang.String[] args)
|
protected |
RS(java.lang.ThreadGroup group,
java.lang.String name)
|
| Method Summary | |
|---|---|
static void |
checkLUM()
This function checks if a valid license to run the application exists in the nodelock file. |
void |
checkTask(java.lang.String name)
Check for existence of "AssemblyLine" name, or throw an exception |
java.lang.String |
commandLineParam(java.lang.String param)
Returns the value for a command line parameter |
void |
dump(java.lang.Object o)
Dumps the class and contents of an object to the log file. |
void |
dumpEntry(Entry e)
Dumps the contents of an Entry to the log file. |
static void |
encryptPropertiesfile(java.lang.String path,
Log log)
Loads the properties from the specified file and sets them as system properties. |
AttributeMapConfig |
getAttributeMap(java.lang.String name)
Returns the the "Attribute Map" for a named connector |
java.lang.String |
getCommandLineConfigId()
|
static RS.ConfigInstanceNamingPolicy |
getConfigInstanceNamingPolicy()
|
java.lang.String |
getConfigPath()
This method returns the current configuration file path |
java.lang.Object |
getConfiguration(java.lang.String key)
Returns the entire table or a sub-section of the configuration file. |
ConnectorConfig |
getConnector(java.lang.String name)
Returns the "Connector" entry for name |
ConnectorPool |
getConnectorPool(java.lang.String connName)
|
java.lang.String[] |
getConnectorPoolNames()
|
java.lang.Throwable |
getExitError()
Returns the exit error of the instance |
int |
getExitStatus()
Gets the exit code of the instance |
FunctionConfig |
getFunction(java.lang.String name)
Returns the "FunctionConfig" entry for name |
LibraryConfig |
getLibraries()
Returns all "Libraries" |
java.lang.Object |
getLibrary(java.lang.String name)
Returns the the "Java Library" entry for name |
static com.ibm.it.rome.xslm.ITLMApplicationLicense |
getLicense()
Function to retrieve license |
Log |
getLog()
Returns the Log for the current instance |
java.lang.String |
getLogDirectory(java.lang.Object owner)
This method returns the default directory path where log files are stored. |
MetamergeConfig |
getMetamergeConfig()
Returns the config object for this instance. |
java.lang.String |
getNullBehavior()
Return the null behavior string from the System.props |
java.lang.String |
getNullBehaviorValue()
Gets the null behavior value. |
java.lang.String |
getNullDefinition()
Return the null definition string from the System.props |
java.lang.String |
getNullDefinitionValue()
Gets the null definition value. |
ParserConfig |
getParser(java.lang.String name)
Returns the the "Parser" entry for name |
static ReconnectRuleEngine |
getReconnectRuleEngine()
Gets the reconnect engine. |
ScriptConfig |
getScript(java.lang.String name)
Returns the the "Script Library" entry for name |
static RS |
getServer()
Returns the RS instance associated with the current ThreadGroup. |
static RS |
getServer(java.lang.String name)
Returns a named RS instance |
static RS |
getServerByConfig(MetamergeConfig aConfig)
Gets the server instance that uses the specified by the aConfig configuration. |
java.lang.String |
getSysProp(java.lang.String name)
Returns the value of a system property. |
AssemblyLineConfig |
getTask(java.lang.String name)
Returns the "AssemblyLine" entry |
java.lang.Object |
invokeServerHook(java.lang.String name,
java.lang.Object caller,
java.lang.Object userInfo)
Invokes a server hook. |
static boolean |
isSecured()
Check if the server is running in secured mode. |
void |
limitNumberOfThreads()
This method is called by the startAL(String, Object, LogInterface) method to check whether a
limit of the maximum running threads exists. |
void |
logerror(java.lang.String msg)
Writes an error message to the system log file. |
void |
logerror(java.lang.String msg,
java.lang.Throwable error)
Prints a message to the log, marked as an Error. |
void |
logmsg(java.lang.String msg)
Writes a message to the system log file. |
void |
logmsg(java.lang.String level,
java.lang.String msg)
This method logs a message with the specified level to the log. |
static void |
main(java.lang.String[] args)
The main methods creates the Log object and kicks off the main thread. |
void |
onAssemblyLineEvent(AssemblyLineEvent e)
This method will be invoked when an AssemblyLine event occurs. |
void |
persistConfiguration()
This method saves the current configuration to disk. |
static void |
prepareSolutionDirectory(Log log)
Prepare the solution directory (working directory) by ensuring solution.properties is present. |
static void |
registerServer(RS server)
Registers the config object to be associated with the current ThreadGroup |
static void |
releaseLicense(com.ibm.it.rome.xslm.ITLMApplicationLicense license)
Function to release license |
void |
reload()
This method reloads the configuration file. |
AssemblyLine |
restartAL(java.lang.String assemblyLine,
java.lang.String checkpointID)
Deprecated. |
void |
run()
Thread main |
int |
runServer()
Used when starting the server instance. |
static void |
setConfigInstanceNamingPolicy(RS.ConfigInstanceNamingPolicy newPolicy)
|
void |
setConfigPath(java.lang.String path)
This method sets the current configuration file path. |
void |
setConfiguration(MetamergeConfig config)
Sets the configuration that will be used by the server. |
static void |
setGlobalProperties()
This method loads the global.properties/solution.properties and parses their content. |
void |
setMetamergeConfig(MetamergeConfig config)
Sets the given configuration to this instance. |
static boolean |
shouldCreateSolutionProps()
Checks if the solution.properties file should be created. |
static void |
showLogHeader(Log log)
This method writes a log header to the Log object. |
void |
shutdownServer()
Raise the shutdown request flag and set the exit code to 0. |
void |
shutdownServer(int aExitCode)
Raise the shutdown request flag and specify an exit code. |
AssemblyLine |
startAL(java.lang.String assemblyLine)
Start a named AssemblyLine. |
AssemblyLine |
startAL(java.lang.String assemblyLine,
Connector connector,
Entry work)
Start named AssemblyLine providing an initial work entry and a connector |
AssemblyLine |
startAL(java.lang.String assemblyLine,
int runMode)
Start named AssemblyLine by providing the run mode. |
AssemblyLine |
startAL(java.lang.String assemblyLine,
java.lang.Object io)
Start a named AssemblyLine providing various objects. |
AssemblyLine |
startAL(java.lang.String assemblyLine,
java.lang.Object io,
LogInterface logAppender)
Start named AssemblyLine providing a parameter |
AssemblyLine |
startAL(TaskCallBlock tcb)
Start the AssemblyLine named in the TCB |
AssemblyLine |
startALDebug(java.lang.String assemblyLine,
int port)
Start named AssemblyLine in debug mode. |
static RS |
startServer(java.lang.String[] args)
Starts server using null for the unique name of the server
instance and command line parameters parsed to params table. |
static RS |
startServer(java.lang.String groupName,
java.util.Hashtable<java.lang.String,java.lang.Object> params)
Starts a new server instance. |
static RS |
startServer(java.lang.String config,
java.lang.String assemblyLines)
Starts server using null for the unique name of the server
instance. |
static RS |
startServer(java.lang.String config,
java.lang.String assemblyLines,
java.lang.String passw)
Starts server using null for the unique name of the server
instance. |
static RS |
startServer(java.lang.String config,
java.lang.String assemblyLines,
java.lang.String passw,
boolean dontTerminate)
Starts server using null for the unique name of the server
instance. |
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)
Starts server using null for the unique name of the server
instance. |
int |
stopAL(java.lang.String name)
Stop named AssemblyLine |
static void |
unregisterServer(RS server)
Registers the config object to be associated with the current ThreadGroup |
boolean |
waitForInitializationToComplete(long milliseconds)
This method is for internal use only. |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.ibm.di.server.RSInterface |
|---|
getName |
| Field Detail |
|---|
public static final java.lang.String CL_USAGE
public static final java.lang.String CL_START_AL
public static final java.lang.String CL_NO_AUTOSTART
public static final java.lang.String CL_CONFIG
public static final java.lang.String CL_WAIT
public static final java.lang.String CL_PASSWORD
public static final java.lang.String CL_DUMP_PROPS
public static final java.lang.String CL_VERSION_INFO
public static final java.lang.String CL_EXECUTE_SCRIPT
public static final java.lang.String CL_RUN_DAEMON
public static final java.lang.String CL_SECURE_MODE
public static final java.lang.String CL_EXT_PROP_FILE
public static final java.lang.String CL_DEBUG_OPTIONS
public static final java.lang.String CL_AL_DEBUG
public static final java.lang.String CL_DEBUG_PORT
public static final java.lang.String CL_CONFIG_STDIN
public static final java.lang.String CL_RUN_MODE
public static final java.lang.String CL_CONFIG_DRIVER
public static final java.lang.String CL_LOGFILE
public static final java.lang.String CL_NO_TERMINATE
public static final java.lang.String CL_DISABLE_REMOTE_API
public static final java.lang.String CL_CONFIG_ENCODING
public static final java.lang.String CL_DUMP_PERFPROPS
public static final java.lang.String CL_SIMULATION_MODE
public static final java.lang.String CL_CREATE_SOLDIR
public static final java.lang.String CL_IGNORE_GLOBAL_PROPERTIES
public static final java.lang.String CL_INTERNAL_CONFIG_NSTANCE_NAME
public static final java.lang.String CL_INTERNAL_CONFIG_AS_STRING
public static final java.lang.String CL_INTERNAL_ADD_LOGGER
com.ibm.di.log.LogInterface interface.
public static final java.lang.String PROPERTY_JVM_SHUTDOWN_HOOK
public static final java.lang.String PROTECT_PREFIX
public static final java.lang.String PROTECT_VAL_PREFIX
public static final java.lang.String PROP_CONFIG_ENCODING
public static final java.lang.String PROP_SECURE_MODE
public static final int EXIT_CODE_REST_FAILED
public static MetamergeConfig gSysConfig
public java.util.Hashtable<java.lang.String,java.lang.Object> params
public long mmServerStarted
RS started
public long mmStarted
RS started
public long mmReloaded
reload() method was called.
public static RS gRS
| Constructor Detail |
|---|
public RS()
protected RS(java.lang.String[] args)
protected RS(java.lang.ThreadGroup group,
java.lang.String name)
| Method Detail |
|---|
public static void releaseLicense(com.ibm.it.rome.xslm.ITLMApplicationLicense license)
license - the license object to release.
public static com.ibm.it.rome.xslm.ITLMApplicationLicense getLicense()
throws java.lang.Exception
java.lang.Exception - if the ITLM toolkit initialization fails.
public static void main(java.lang.String[] args)
throws java.lang.Exception
args - an array of the command line arguments
java.lang.Exception - if error while preparing the solution directory occurs.public static boolean isSecured()
public static ReconnectRuleEngine getReconnectRuleEngine()
ReconnectRuleEngine object responsible for handling
errors.public void setConfiguration(MetamergeConfig config)
config - the configuration object.public java.lang.Object getConfiguration(java.lang.String key)
getConfiguration in interface RSInterfacekey - Name of subsection or null
public java.lang.Object getLibrary(java.lang.String name)
getLibrary in interface RSInterfacename - The java library name
public FunctionConfig getFunction(java.lang.String name)
throws java.lang.Exception
getFunction in interface RSInterfacename - The name of the function
java.lang.Exception - if a lookup error occurs.public LibraryConfig getLibraries()
getLibraries in interface RSInterfacepublic ScriptConfig getScript(java.lang.String name)
getScript in interface RSInterfacename - The script library name
public ConnectorConfig getConnector(java.lang.String name)
getConnector in interface RSInterfacename - The connector name
public ParserConfig getParser(java.lang.String name)
getParser in interface RSInterfacename - The parser name
public AttributeMapConfig getAttributeMap(java.lang.String name)
getAttributeMap in interface RSInterfacename - The connector name
public AssemblyLineConfig getTask(java.lang.String name)
getTask in interface RSInterfacename - The AssemblyLine name
public void checkTask(java.lang.String name)
throws java.lang.Exception
name - The AssemblyLine name
java.lang.Exception - in case the AssemblyLine referred by the provided name
could not be found.public java.lang.String getSysProp(java.lang.String name)
getSysProp in interface RSInterfacename - The system property name, or null if there is
no property with that name
public int runServer()
@Deprecated
public AssemblyLine restartAL(java.lang.String assemblyLine,
java.lang.String checkpointID)
throws java.lang.Exception
restartAL in interface RSInterfaceassemblyLine - The name identifying the AssemblyLine to startcheckpointID - The checkpoint identifier
java.lang.Exception - if assemblyLine is an unknown AssemblyLine or
if any of the connectors cannot be re-initialized
public AssemblyLine startAL(java.lang.String assemblyLine)
throws java.lang.Exception
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());
startAL in interface RSInterfaceassemblyLine - The name identifying the AssemblyLine to start
java.lang.Exception - if assemblyLine is an unknown AssemblyLine or
if any of the connectors cannot be initialized
public AssemblyLine startAL(java.lang.String assemblyLine,
int runMode)
throws java.lang.Exception
assemblyLine - Name of AssemblyLine to startrunMode - the run mode in which the AssemblyLine should start
java.lang.Exception - in case the AssemblyLine initialization fails.AssemblyLine.RUNMODE_I_NORMAL,
AssemblyLine.RUNMODE_I_RECORD,
AssemblyLine.RUNMODE_I_PLAYBACK,
AssemblyLine.RUNMODE_I_MANUAL
public AssemblyLine startALDebug(java.lang.String assemblyLine,
int port)
throws java.lang.Exception
assemblyLine - Name of AssemblyLine to startport - the port which the debug console will connect to.
java.lang.Exception - if the AssemblyLine initialization fails.
public AssemblyLine startAL(java.lang.String assemblyLine,
Connector connector,
Entry work)
throws java.lang.Exception
Example:
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());
startAL in interface RSInterfaceassemblyLine - The name identifying the AssemblyLine to startconnector - The runtime-provided Connectorwork - The initial work entry
java.lang.Exception - if assemblyLine is an unknown AssemblyLine or
if any of the connectors cannot be initialized
public AssemblyLine startAL(TaskCallBlock tcb)
throws java.lang.Exception
Example:
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
tcb - The TaskCallBlock
java.lang.Exception - if the AssemblyLine initialization fails.
public AssemblyLine startAL(java.lang.String assemblyLine,
java.lang.Object io)
throws java.lang.Exception
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());
startAL in interface RSInterfaceassemblyLine - The name identifying the AssemblyLine to startio - This Object could either be
java.lang.Exception - if assemblyLine is an unknown AssemblyLine or
if any of the connectors cannot be initialized
public AssemblyLine startAL(java.lang.String assemblyLine,
java.lang.Object io,
LogInterface logAppender)
throws java.lang.Exception
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
java.lang.Exception - if an error while starting the AL thread occurs.public int stopAL(java.lang.String name)
name - Name of AssemblyLine to stop
public void logmsg(java.lang.String msg)
Example:
main.logmsg("Conn object: ");
main.dumpEntry(conn);
logmsg in interface RSInterfacemsg - The message to be output.
public void logmsg(java.lang.String level,
java.lang.String msg)
Example:
main.logmsg("INFO", "Reading entry...");
var entry = input.getConnector().getNextEntry();
logmsg in interface RSInterfacelevel - Level of log. Legal values are FATAL, ERROR, WARN, INFO,
DEBUG. Unrecognized keyword means DEBUG.msg - The message
public void logerror(java.lang.String msg,
java.lang.Throwable error)
Throwable class which information is also put in
the log.
msg - the String messageerror - the exception objectpublic void logerror(java.lang.String msg)
logerror in interface RSInterfacemsg - The message to outputpublic void dump(java.lang.Object o)
RSInterface.dumpEntry(Entry) method instead.
dump in interface RSInterfaceo - The object to dumpRSInterface.dumpEntry(Entry)public void dumpEntry(Entry e)
Example:
var ctor = input.getConnector();
for (;;) {
var entry = ctor.getNextEntry();
if (entry != null) {
main.logmsg("Read entry: ");
main.dumpEntry(entry);
} else
break;
}
dumpEntry in interface RSInterfacee - The Entry object to dumpEntry
public void reload()
throws java.lang.Exception
reload in interface RSInterfacejava.lang.Exception - if the operation fails.public java.lang.String getConfigPath()
getConfigPath in interface RSInterfacepublic void setConfigPath(java.lang.String path)
setConfigPath in interface RSInterfacepath - The new configuration path
public void persistConfiguration()
throws java.lang.Exception
persistConfiguration in interface RSInterfacejava.lang.Exception - if an error while persisting the configuration occurs.public static void showLogHeader(Log log)
log - The log output objectpublic java.lang.String getLogDirectory(java.lang.Object owner)
owner - The Java class or string denoting the type (e.g. AssemblyLine)
public void shutdownServer()
shutdownServer in interface RSInterfacepublic void shutdownServer(int aExitCode)
shutdownServer in interface RSInterfaceaExitCode - the code to return when the application exits.public java.lang.String getNullBehavior()
getNullBehavior in interface RSInterfacepublic java.lang.String getNullBehaviorValue()
getNullBehaviorValue in interface RSInterfacepublic java.lang.String getNullDefinition()
getNullDefinition in interface RSInterfacepublic java.lang.String getNullDefinitionValue()
getNullDefinitionValue in interface RSInterfacepublic void limitNumberOfThreads()
startAL(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 int then 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.
public static void setGlobalProperties()
public static boolean shouldCreateSolutionProps()
public static void prepareSolutionDirectory(Log log)
throws java.lang.Exception
log - the log object to log in.
java.lang.Exception - if I/O error occurs while working with files.
public static void encryptPropertiesfile(java.lang.String path,
Log log)
path - a properties filelog - loggerpublic void run()
run in interface java.lang.Runnablerun in class java.lang.Threadpublic java.lang.String commandLineParam(java.lang.String param)
param - is switch which value to look for.
null if it does not exist
in the map.public MetamergeConfig getMetamergeConfig()
getMetamergeConfig in interface RSInterfacepublic void setMetamergeConfig(MetamergeConfig config)
setMetamergeConfig in interface RSInterfaceconfig - The configuration object to assign to the instance.public Log getLog()
public int getExitStatus()
public java.lang.Throwable getExitError()
public static RS getServerByConfig(MetamergeConfig aConfig)
aConfig configuration.
aConfig - the configuration object used by the server instance
RS object that correspond to the provided
configuration, or null if it couldn't be found.public static RS getServer()
main object in
JavaScript.
RS instance or null if it couldn't be
found, e.g. because the current Thread was not created by the TDI
framework.public static RS getServer(java.lang.String name)
RS instance
name - the name of the instance
RS if it is found, null otherwise.public static void registerServer(RS server)
server - the server to be registered, should not be nullpublic static void unregisterServer(RS server)
server - the server to unregister, should not be null
public static RS startServer(java.lang.String[] args)
throws java.lang.Exception
null for 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);
args - the "command line arguments" to use when starting.
RS instance
java.lang.Exception - if an error occurs.
public static RS startServer(java.lang.String config,
java.lang.String assemblyLines)
throws java.lang.Exception
null for 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);
config - the configuration to loadassemblyLines - the assembly lines to start
RS instance object
java.lang.Exception - if the server initialization fails
public static RS startServer(java.lang.String config,
java.lang.String assemblyLines,
java.lang.String passw)
throws java.lang.Exception
null for 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);
config - the configuration to loadassemblyLines - the assembly lines to startpassw - the password used for the configuration file
RS instance object
java.lang.Exception - if the server initialization fails
public static RS startServer(java.lang.String config,
java.lang.String assemblyLines,
java.lang.String passw,
boolean dontTerminate)
throws java.lang.Exception
null for 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");
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
RS instance object
java.lang.Exception - if the server initialization fails
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
null for 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");
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 the CL_NO_AUTOSTART exists.
RS instance object
java.lang.Exception - if the server initialization fails
public static RS startServer(java.lang.String groupName,
java.util.Hashtable<java.lang.String,java.lang.Object> params)
throws java.lang.Exception
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);
groupName - The unique name for the server instanceparams - Hashtable of assembly lines to start (same syntax as command
line)
RS instance object
java.lang.Exception - if there is another instance using the same groupNamepublic java.lang.String getCommandLineConfigId()
public java.lang.Object invokeServerHook(java.lang.String name,
java.lang.Object caller,
java.lang.Object userInfo)
name - The name of the hookcaller - The object invoking the hookuserInfo - Arbitrary information to the hook from the caller
null if a hook
with that name could not be found.public java.lang.String[] getConnectorPoolNames()
ConnectorPoolspublic ConnectorPool getConnectorPool(java.lang.String connName)
connName - the name of the ConnectorPool object
ConnectorPool instance that corresponds of the
provided name, if the name is not found null is
returned.public static RS.ConfigInstanceNamingPolicy getConfigInstanceNamingPolicy()
public static void setConfigInstanceNamingPolicy(RS.ConfigInstanceNamingPolicy newPolicy)
newPolicy - A new configuration instance naming policy for the Server.public void onAssemblyLineEvent(AssemblyLineEvent e)
onAssemblyLineEvent in interface AssemblyLine.AssemblyLineListenere - AssemblyLine event object. Will never be null. Listeners
should not use the event object outside of this method. If
you need some data for later use, make a copy.public static void checkLUM()
public boolean waitForInitializationToComplete(long milliseconds)
throws java.lang.InterruptedException
This method is for internal use only. Users must not rely on it.
Wait for the configuration instance (a.k.a RS instance) 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 the RS instance might
be in error state.
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.
true if the count reached zero and
false if the waiting time elapsed before the count
reached zero.
java.lang.InterruptedException - If the calling thread is interrupted while waiting for
initialization status.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||