|
|||||||||||
| 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.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 | |
|---|---|
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 |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
static String |
CL_AL_DEBUG
Command line switch - B See the parameters' usage. |
static String |
CL_CONFIG
Command line switch - c See the parameters' usage. |
static String |
CL_CONFIG_DRIVER
Command line switch - Y See the parameters' usage. |
static String |
CL_CONFIG_ENCODING
Command line switch - n See the parameters' usage. |
static String |
CL_CONFIG_STDIN
Command line switch - S See the parameters' usage. |
static String |
CL_CREATE_SOLDIR
Command line switch - g See the parameter's usage. |
static String |
CL_DEBUG_OPTIONS
Command line switch - b See the parameters' usage. |
static String |
CL_DEBUG_PORT
Command line switch - Q See the parameters' usage. |
static String |
CL_DISABLE_REMOTE_API
Command line switch - R See the parameters' usage. |
static String |
CL_DUMP_PERFPROPS
Command line switch - T See the parameters' usage. |
static String |
CL_DUMP_PROPS
Command line switch - p See the parameters' usage. |
static String |
CL_EXECUTE_SCRIPT
Command line switch - x See the parameters' usage. |
static String |
CL_EXT_PROP_FILE
Command line switch - f See the parameters' usage. |
static 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 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. |
static 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 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 String |
CL_LOGFILE
Command line switch - l See the parameters' usage. |
static String |
CL_NO_AUTOSTART
Command line switch - D See the parameters' usage. |
static String |
CL_NO_TERMINATE
Command line switch - W See the parameters' usage. |
static String |
CL_PASSWORD
Command line switch - P See the parameters' usage. |
static String |
CL_RUN_DAEMON
Command line switch - d See the parameters' usage. |
static String |
CL_RUN_MODE
Command line switch - q See the parameters' usage. |
static String |
CL_SECURE_MODE
Command line switch - e See the parameters' usage. |
static String |
CL_SIMULATION_MODE
Command line switch - M See the parameters' usage. |
static String |
CL_START_AL
Command line switch - r See the parameters' usage. |
static String |
CL_USAGE
Command line switch - ? See the parameters' usage. |
static String |
CL_VERSION_INFO
Command line switch - v See the parameters' usage. |
static 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 |
Hashtable<String,Object> |
params
This table holds startup parameters. |
static String |
PROP_CONFIG_ENCODING
System property that specifies the encoding to be used when reading/writing configuration files. |
static String |
PROP_SECURE_MODE
System property that specifies whether the Server is run in secure mode. |
static String |
PROPERTY_JVM_SHUTDOWN_HOOK
The server will look for a property with this name when registering a shutdown hook. |
static String |
PROTECT_PREFIX
This is the prefix of a property in the global.properties or solution.properties files. |
static 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(String[] args)
|
protected |
RS(ThreadGroup group,
String name)
|
| Method Summary | |
|---|---|
void |
addListener(ConfigInstanceListener listener)
This method is for internal use only. |
void |
assemblyLineCycleEnded(AssemblyLine al,
Entry work)
An AssemblyLine cycle (iteration) is complete. |
void |
assemblyLineTerminated(AssemblyLine al)
The AssemblyLine terminated. |
static void |
checkLUM()
This function checks if a valid license to run the application exists in the nodelock file. |
void |
checkTask(String name)
Check for existence of "AssemblyLine" name, or throw an exception |
String |
commandLineParam(String param)
Returns the value for a command line parameter |
static RS |
createConfigInstance(String groupName,
Hashtable<String,Object> params)
Create a new config instance but do not start it. |
void |
dump(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(String path,
Log log)
Loads the properties from the specified file and sets them as system properties. |
AttributeMapConfig |
getAttributeMap(String name)
Returns the the "Attribute Map" for a named connector |
String |
getCommandLineConfigId()
|
static RS.ConfigInstanceNamingPolicy |
getConfigInstanceNamingPolicy()
|
String |
getConfigPath()
This method returns the current configuration file path |
Object |
getConfiguration(String key)
Returns the entire table or a sub-section of the configuration file. |
ConnectorConfig |
getConnector(String name)
Returns the "Connector" entry for name |
ConnectorPool |
getConnectorPool(String connName)
|
String[] |
getConnectorPoolNames()
|
Throwable |
getExitError()
Returns the exit error of the instance |
int |
getExitStatus()
Gets the exit code of the instance |
FunctionConfig |
getFunction(String name)
Returns the "FunctionConfig" entry for name |
LibraryConfig |
getLibraries()
Returns all "Libraries" |
Object |
getLibrary(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 |
String |
getLogDirectory(Object owner)
This method returns the default directory path where log files are stored. |
MetamergeConfig |
getMetamergeConfig()
Returns the config object for this instance. |
String |
getNullBehavior()
Return the null behavior string from the System.props |
String |
getNullBehaviorValue()
Gets the null behavior value. |
String |
getNullDefinition()
Return the null definition string from the System.props |
String |
getNullDefinitionValue()
Gets the null definition value. |
ParserConfig |
getParser(String name)
Returns the the "Parser" entry for name |
static ReconnectRuleEngine |
getReconnectRuleEngine()
Gets the reconnect engine. |
ScriptConfig |
getScript(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(String name)
Returns a named RS instance |
static RS |
getServerByConfig(MetamergeConfig aConfig)
Gets the server instance that uses the specified by the aConfig configuration. |
ServerSocketFactory |
getServerSocketFactory(boolean useSSL)
Gets a Server Socket Factory for creating Server Sockets. |
String |
getSysProp(String name)
Returns the value of a system property. |
AssemblyLineConfig |
getTask(String name)
Returns the "AssemblyLine" entry |
Object |
invokeServerHook(String name,
Object caller,
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(String msg)
Writes an error message to the system log file. |
void |
logerror(String msg,
Throwable error)
Prints a message to the log, marked as an Error. |
void |
logmsg(String msg)
Writes a message to the system log file. |
void |
logmsg(String level,
String msg)
This method logs a message with the specified level to the log. |
static void |
main(String[] args)
The main methods creates the Log object and kicks off the main thread. |
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. |
void |
removeListener(ConfigInstanceListener listener)
This method is for internal use only. |
AssemblyLine |
restartAL(String assemblyLine,
String checkpointID)
Deprecated. |
void |
run()
Thread main |
int |
runServer()
Used when starting the server instance. |
static void |
setConfigInstanceNamingPolicy(RS.ConfigInstanceNamingPolicy newPolicy)
|
void |
setConfigPath(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. |
static void |
shutdownAllServers(int exitCode,
boolean master,
boolean async)
This method shuts down all Config Instances. |
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. |
void |
shutdownServer(int exitCode,
boolean async)
Raise the shutdown request flag. |
AssemblyLine |
startAL(String assemblyLine)
Start a named AssemblyLine. |
AssemblyLine |
startAL(String assemblyLine,
Connector connector,
Entry work)
Start named AssemblyLine providing an initial work entry and a connector |
AssemblyLine |
startAL(String assemblyLine,
int runMode)
Start named AssemblyLine by providing the run mode. |
AssemblyLine |
startAL(String assemblyLine,
Object io)
Start a named AssemblyLine providing various objects. |
AssemblyLine |
startAL(String assemblyLine,
Object io,
LogInterface logAppender)
Start named AssemblyLine providing a parameter |
AssemblyLine |
startAL(TaskCallBlock tcb)
Start the AssemblyLine named in the TCB |
AssemblyLine |
startALDebug(String assemblyLine,
int port)
Start named AssemblyLine in debug mode. |
static RS |
startServer(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(String groupName,
Hashtable<String,Object> params)
Starts a new server instance. |
static RS |
startServer(String config,
String assemblyLines)
Starts server using null for the unique name of the server
instance. |
static RS |
startServer(String config,
String assemblyLines,
String passw)
Starts server using null for the unique name of the server
instance. |
static RS |
startServer(String config,
String assemblyLines,
String passw,
boolean dontTerminate)
Starts server using null for the unique name of the server
instance. |
static RS |
startServer(String config,
String assemblyLines,
String passw,
boolean dontTerminate,
Hashtable<String,Object> userParams)
Starts server using null for the unique name of the server
instance. |
static int |
stopAL(String name)
Stop named AssemblyLine in all Config Instances. |
static void |
stopAssemblyLines(String name,
int hashCode,
boolean recurse,
boolean async,
RS rs)
Stops specified running AssemblyLines. |
static void |
stopChildAssemblyLines(AssemblyLine al,
boolean async)
Recursively stop all children of one 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 String CL_USAGE
public static final String CL_START_AL
public static final String CL_NO_AUTOSTART
public static final String CL_CONFIG
public static final String CL_WAIT
public static final String CL_PASSWORD
public static final String CL_DUMP_PROPS
public static final String CL_VERSION_INFO
public static final String CL_EXECUTE_SCRIPT
public static final String CL_RUN_DAEMON
public static final String CL_SECURE_MODE
public static final String CL_EXT_PROP_FILE
public static final String CL_DEBUG_OPTIONS
public static final String CL_AL_DEBUG
public static final String CL_DEBUG_PORT
public static final String CL_CONFIG_STDIN
public static final String CL_RUN_MODE
public static final String CL_CONFIG_DRIVER
public static final String CL_LOGFILE
public static final String CL_NO_TERMINATE
public static final String CL_DISABLE_REMOTE_API
public static final String CL_CONFIG_ENCODING
public static final String CL_DUMP_PERFPROPS
public static final String CL_SIMULATION_MODE
public static final String CL_CREATE_SOLDIR
public static final String CL_IGNORE_GLOBAL_PROPERTIES
public static final String CL_INTERNAL_CONFIG_NSTANCE_NAME
public static final String CL_INTERNAL_CONFIG_AS_STRING
public static final String CL_INTERNAL_ADD_LISTENER
com.ibm.di.server.ConfigInstanceListener
interface.
public static final String PROPERTY_JVM_SHUTDOWN_HOOK
public static final String PROTECT_PREFIX
public static final String PROTECT_VAL_PREFIX
public static final String PROP_CONFIG_ENCODING
public static final String PROP_SECURE_MODE
public static final int EXIT_CODE_REST_FAILED
public static MetamergeConfig gSysConfig
public Hashtable<String,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(String[] args)
protected RS(ThreadGroup group,
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 Exception
Exception - if the ITLM toolkit initialization fails.
public static void main(String[] args)
throws Exception
args - an array of the command line arguments
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 Object getConfiguration(String key)
getConfiguration in interface RSInterfacekey - Name of subsection or null
public Object getLibrary(String name)
getLibrary in interface RSInterfacename - The java library name
public FunctionConfig getFunction(String name)
throws Exception
getFunction in interface RSInterfacename - The name of the function
Exception - if a lookup error occurs.public LibraryConfig getLibraries()
getLibraries in interface RSInterfacepublic ScriptConfig getScript(String name)
getScript in interface RSInterfacename - The script library name
public ConnectorConfig getConnector(String name)
getConnector in interface RSInterfacename - The connector name
public ParserConfig getParser(String name)
getParser in interface RSInterfacename - The parser name
public AttributeMapConfig getAttributeMap(String name)
getAttributeMap in interface RSInterfacename - The connector name
public AssemblyLineConfig getTask(String name)
getTask in interface RSInterfacename - The AssemblyLine name
public void checkTask(String name)
throws Exception
name - The AssemblyLine name
Exception - in case the AssemblyLine referred by the provided name
could not be found.public String getSysProp(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(String assemblyLine,
String checkpointID)
throws Exception
restartAL in interface RSInterfaceassemblyLine - The name identifying the AssemblyLine to startcheckpointID - The checkpoint identifier
Exception - if assemblyLine is an unknown AssemblyLine or if
any of the connectors cannot be re-initialized
public AssemblyLine startAL(String assemblyLine)
throws 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
Exception - if assemblyLine is an unknown AssemblyLine or if
any of the connectors cannot be initialized
public AssemblyLine startAL(String assemblyLine,
int runMode)
throws Exception
assemblyLine - Name of AssemblyLine to startrunMode - the run mode in which the AssemblyLine should start
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(String assemblyLine,
int port)
throws Exception
assemblyLine - Name of AssemblyLine to startport - the port which the debug console will connect to.
Exception - if the AssemblyLine initialization fails.
public AssemblyLine startAL(String assemblyLine,
Connector connector,
Entry work)
throws 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
Exception - if assemblyLine is an unknown AssemblyLine or if
any of the connectors cannot be initialized
public AssemblyLine startAL(TaskCallBlock tcb)
throws 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
Exception - if the AssemblyLine initialization fails.
public AssemblyLine startAL(String assemblyLine,
Object io)
throws 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
Exception - if assemblyLine is an unknown AssemblyLine or if
any of the connectors cannot be initialized
public AssemblyLine startAL(String assemblyLine,
Object io,
LogInterface logAppender)
throws 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
Exception - if an error while starting the AL thread occurs.public static int stopAL(String name)
name - Name of AssemblyLine to stop
public void logmsg(String msg)
Example:
main.logmsg("Conn object: ");
main.dumpEntry(conn);
logmsg in interface RSInterfacemsg - The message to be output.
public void logmsg(String level,
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(String msg,
Throwable error)
Throwable class which information is also put in
the log.
msg - the String messageerror - the exception objectpublic void logerror(String msg)
logerror in interface RSInterfacemsg - The message to outputpublic void dump(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 Exception
reload in interface RSInterfaceException - if the operation fails.public String getConfigPath()
getConfigPath in interface RSInterfacepublic void setConfigPath(String path)
setConfigPath in interface RSInterfacepath - The new configuration path
public void persistConfiguration()
throws Exception
persistConfiguration in interface RSInterfaceException - if an error while persisting the configuration occurs.public static void showLogHeader(Log log)
log - The log output objectpublic String getLogDirectory(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 void shutdownServer(int exitCode,
boolean async)
exitCode - the code to return when the application exits.async - If true, crate new Threads to wait for the AssemblyLines to
stop
public static void stopAssemblyLines(String name,
int hashCode,
boolean recurse,
boolean async,
RS rs)
throws AbortALException
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.
AbortALException - if this method stops the AssemblyLine that called it.
public static void stopChildAssemblyLines(AssemblyLine al,
boolean async)
throws AbortALException
al - The Assemblyline whose children are to be stopped.async - If true, crate new Threads to wait for the AssemblyLines to
stop
AbortALException - if this method shuts down the AssemblyLine that called it.public String getNullBehavior()
getNullBehavior in interface RSInterfacepublic String getNullBehaviorValue()
getNullBehaviorValue in interface RSInterfacepublic String getNullDefinition()
getNullDefinition in interface RSInterfacepublic String getNullDefinitionValue()
getNullDefinitionValue in interface RSInterfacepublic ServerSocketFactory getServerSocketFactory(boolean useSSL)
useSSL determines whether a SSL Server Socket
Factory is returned or non-SSL one.
getServerSocketFactory in interface RSInterfaceuseSSL - Determines if SSL or non-SSL Server Socket Factory is returns
for use.
public 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 Exception
log - the log object to log in.
Exception - if I/O error occurs while working with files.
public static void encryptPropertiesfile(String path,
Log log)
path - a properties filelog - loggerpublic void run()
run in interface Runnablerun in class Threadpublic String commandLineParam(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()
getLog in interface RSInterfacepublic int getExitStatus()
public 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(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(String[] args)
throws 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
Exception - if an error occurs.
public static RS startServer(String config,
String assemblyLines)
throws 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
Exception - if the server initialization fails
public static RS startServer(String config,
String assemblyLines,
String passw)
throws 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
Exception - if the server initialization fails
public static RS startServer(String config,
String assemblyLines,
String passw,
boolean dontTerminate)
throws 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
Exception - if the server initialization fails
public static RS startServer(String config,
String assemblyLines,
String passw,
boolean dontTerminate,
Hashtable<String,Object> userParams)
throws 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
Exception - if the server initialization fails
public static RS startServer(String groupName,
Hashtable<String,Object> params)
throws 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
Exception - if there is another instance using the same groupName
public static RS createConfigInstance(String groupName,
Hashtable<String,Object> params)
throws Exception
groupName - The unique name for the server instanceparams - Hashtable of assembly lines to start (same syntax as command
line)
RS instance object
Exception - if there is another instance using the same groupNamepublic String getCommandLineConfigId()
public Object invokeServerHook(String name,
Object caller,
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 String[] getConnectorPoolNames()
ConnectorPoolspublic ConnectorPool getConnectorPool(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 static void checkLUM()
public boolean waitForInitializationToComplete(long milliseconds)
throws 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.
InterruptedException - If the calling thread is interrupted while waiting for
initialization status.
public void assemblyLineCycleEnded(AssemblyLine al,
Entry work)
throws Exception
assemblyLineCycleEnded in interface AssemblyLine.AssemblyLineListeneral - The AssemblyLine.work - The work Entry.
Exception - Will stop the AssemblyLine, so be careful.public void assemblyLineTerminated(AssemblyLine al)
assemblyLineTerminated in interface AssemblyLine.AssemblyLineListeneral - The AssemblyLine.public void addListener(ConfigInstanceListener listener)
This method is for internal use only. Users must not rely on it.
Register listener to this configuration instance.
addListener in interface Listenable<ConfigInstanceListener>listener - Listener for configuration instance notifications.public void removeListener(ConfigInstanceListener listener)
This method is for internal use only. Users must not rely on it.
Unregister listener from this configuration instance.
removeListener in interface Listenable<ConfigInstanceListener>listener - Registered listener.
public static void shutdownAllServers(int exitCode,
boolean master,
boolean async)
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
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||