|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Session
This is the local Session interface which provides various methods which could be used with the started TDI Server.
Method Summary | |
---|---|
void |
addEventListener(ConfigurationFileListener listener)
Registers a Event Listener to monitor for Configuration File changes. |
void |
addEventListener(DIEventListener aListener,
java.lang.String aTypeFilter,
java.lang.String aIdFilter)
Registers an Event Listener with the Session. |
void |
checkInAndLeaveCheckedOut(MetamergeConfig configuration,
java.lang.String relativePathOrSolutionName)
Checks in the specified configuration and leaves it checked out. |
void |
checkInAndLeaveCheckedOut(MetamergeConfig configuration,
java.lang.String relativePathOrSolutionName,
boolean encrypt)
Checks in the specified configuration and leaves it checked out. |
void |
checkInConfiguration(MetamergeConfig configuration,
java.lang.String relativePathOrSolutionName)
Saves the specified configuration and releases the lock. |
void |
checkInConfiguration(MetamergeConfig configuration,
java.lang.String relativePathOrSolutionName,
boolean encrypt)
Encrypts and saves the specified configuration and releases the lock. |
MetamergeConfig |
checkOutConfiguration(java.lang.String relativePathOrSolutionName)
Checks out the specified configuration. |
MetamergeConfig |
checkOutConfiguration(java.lang.String relativePathOrSolutionName,
java.lang.String password)
Checks out the specified password protected configuration. |
ConfigInstance |
checkOutConfigurationAndLoad(java.lang.String relativePathOrSolutionName)
Checks out the specified configuration and starts a temporary Config Instance on the Server. |
ConfigInstance |
checkOutConfigurationAndLoad(java.lang.String relativePathOrSolutionName,
java.lang.String password)
Checks out the specified configuration and starts a temporary Config Instance on the Server. |
ConfigInstance |
createNewConfigInstance(java.lang.String aConfigUrl)
Deprecated. Not supported. Creates and starts a new Config Instance with an empty configuration. |
ConfigInstance |
createNewConfigInstance(java.lang.String aConfigUrl,
java.lang.String aPassword)
Deprecated. Not supported. Creates and starts a new Config Instance with an empty configuration. |
MetamergeConfig |
createNewConfiguration(java.lang.String aRelativePath,
boolean aOverwrite)
Creates a new empty configuration and immediately checks it out. |
ConfigInstance |
createNewConfigurationAndLoad(java.lang.String aRelativePath,
boolean aOverwrite)
Creates a new empty configuration, immediately checks it out and loads a temporary Config Instance on the Server. |
void |
deleteConfiguration(java.lang.String relativePathOrSolutionName)
Delete a file from the configuration codebase folder. |
java.lang.Object |
deletePersistentObject(java.lang.String key)
This method deletes a named object in the default system property store. |
AssemblyLine[] |
getAssemblyLines()
Returns started AssemblyLines corresponding to the currently started configurations. |
java.lang.String |
getConfigFolderPath()
Gets the value of the api.config.folder property as a complete path. |
ConfigInstance |
getConfigInstance(java.lang.String aConfigId)
Returns configuration instance corresponding to a specific configuration ID. |
ConfigInstance[] |
getConfigInstances()
Returns all currently started configuration instances. |
java.util.List<java.lang.String> |
getConfigInstancesIDs()
Returns the IDs of all currently started configuration instances. |
java.lang.String |
getJavaProperty(java.lang.String prop)
Returns the value of a Java System property. |
java.lang.Object |
getPersistentObject(java.lang.String key)
This method retrieves a named object from the default system property store. |
SecurityRegistry |
getSecurityRegistry()
Returns information about the restrictions the current user has. |
ServerInfo |
getServerInfo()
Retrieves the Server information. |
SystemLog |
getSystemLog()
Returns information about the System logging. |
SystemQueue |
getSystemQueue()
Gets the SystemQueue Server API object |
TombstoneManager |
getTombstoneManager()
Returns the TombstoneManager object. |
java.lang.Object |
invokeCustom(java.lang.String aCustomClassName,
java.lang.String aMethodName,
java.lang.Object[] aParams)
Invokes the specified method from the specified class. |
java.lang.Object |
invokeCustom(java.lang.String aCustomClassName,
java.lang.String aMethodName,
java.lang.Object[] aParamsValue,
java.lang.String[] aParamsClass)
Invokes the specified method from the specified class. |
boolean |
isConfigurationCheckedOut(java.lang.String relativePathOrSolutionName)
Checks if the specified configuration is checked out on the Server. |
boolean |
isSSLon()
Checks if current session is over SSL. |
java.util.ArrayList<java.lang.String> |
listAllConfigurations()
Returns a list of all configurations in the directory subtree of the Server configuration codebase folder. |
java.util.ArrayList<java.lang.String> |
listConfigurations(java.lang.String aRelativePath)
Returns a list of all configurations in the specified folder. |
java.util.ArrayList<java.lang.String> |
listFolders(java.lang.String aRelativePath)
Returns a list of the child folders of the specified folder. |
boolean |
releaseConfigurationLock(java.lang.String relativePathOrSolutionName)
Administratively releases the lock of the specified configuration. |
boolean |
removeEventListener(ConfigurationFileListener listener)
Unregisters an Event Listener with the Session. |
boolean |
removeEventListener(DIEventListener aListener)
Unregisters an Event Listener with the Session. |
void |
sendCustomNotification(java.lang.String aType,
java.lang.String aId,
java.lang.Object aData)
Sends a custom, user defined notification to all registered listeners. |
void |
setJavaProperty(java.lang.String prop,
java.lang.String value)
Sets the value of a Java System property. |
java.lang.Object |
setPersistentObject(java.lang.String key,
java.lang.Object value)
This method stores a named object in the default system property store. |
void |
shutDownServer()
Shuts down the TDI server. |
void |
shutDownServer(int aExitCode)
Shuts down the TDI Server with the specified exit code. |
void |
shutDownServer(int aExitCode,
boolean sync)
Shuts down the TDI Server with the specified exit code, after stopping all AssemblyLines and waiting a while for them to finish. |
ConfigInstance |
startConfigInstance(java.lang.String configPathOrSolutionName)
Starts a new Config Instance on the Server with the configuration given. |
ConfigInstance |
startConfigInstance(java.lang.String configPathOrSolutionName,
boolean keepAlive,
java.lang.String password)
Starts a new Config Instance on the Server with the configuration given. |
ConfigInstance |
startConfigInstance(java.lang.String configPathOrSolutionName,
boolean keepAlive,
java.lang.String password,
java.lang.String runName,
java.lang.String overrideProps)
Starts a new Config Instance on the Server with the configuration given. |
ConfigInstance |
startConfigInstance(java.lang.String configPathOrSolutionName,
boolean keepAlive,
java.lang.String password,
java.lang.String runName,
java.lang.String overrideProps,
LogListener logListener)
Starts a new Config Instance on the Server with the configuration given. |
ConfigInstance |
startTempConfigInstance(java.lang.String xmlConfig,
boolean keepAlive,
java.lang.String runName,
java.lang.String overrideProps)
Start a configuration instance which has no associated configuration file. |
ConfigInstance |
startTempConfigInstance(java.lang.String xmlConfig,
boolean keepAlive,
java.lang.String runName,
java.lang.String overrideProps,
LogListener logListener)
Start a configuration instance which has no associated configuration file. |
void |
startTombstoneManager()
Starts the TombstoneManager. |
boolean |
undoCheckOut(java.lang.String relativePathOrSolutionName)
Releases the lock on the specified configuration, thus aborting all changes being done. |
Method Detail |
---|
ServerInfo getServerInfo() throws DIException
DIException
- if an error occurs while retrieving the Server information.ConfigInstance[] getConfigInstances() throws DIException
Example:
var session = (new com.ibm.di.api.local.impl.SessionFactoryImpl).createSession(); var ci = session.getConfigInstances(); for (i=0; i<ci.length; i++) { task.logmsg("Config instance: " + ci[i]); }
DIException
- if an error occurs while retrieving the information about the
currently started configuration instances.java.util.List<java.lang.String> getConfigInstancesIDs() throws DIException
Example:
var session = (new com.ibm.di.api.local.impl.SessionFactoryImpl).createSession(); var ciIds = session.getConfigInstancesIDs(); for (i=0; i<ciIds.length; i++) { task.logmsg("Config instance: " + ciIds[i]); }
DIException
- if an error occurs while retrieving the information about the
currently started configuration instances.ConfigInstance getConfigInstance(java.lang.String aConfigId) throws DIException
Example:
//for Java use APIEngine.getLocalSession() to create new Session instance. var cID = "testconfig.xml"; var ci = session.getConfigInstance(cID); //do something with ci
aConfigId
- the ID of the wanted configuration.
DIException
- if an error occurs while retrieving the information.AssemblyLine[] getAssemblyLines() throws DIException
Example:
//for Java use APIEngine.getLocalSession() to create new Session instance. var assemblyLines = session.getAssemblyLines(); for (i = 0; i < assemblyLines.length; i++) { task.logmsg("AL name: " + assemblyLines[i].getName()); // do someting with assemblyLines[i] }
DIException
- if an error occurs while retrieving the information about the
AssemblyLines.ConfigInstance startConfigInstance(java.lang.String configPathOrSolutionName) throws DIException
Example:
//for Java use APIEngine.getLocalSession() to create new Session instance. session.startConfigInstance("Solution_name");
configPathOrSolutionName
- The URL where the configuration file is loaded from or the
Solution Name of the configuration file. Only configuration
files located in the configuration codebase folder can be
referenced by Solution Name.
DIException
- if an error occurs on starting the new Config Instance.ConfigInstance startConfigInstance(java.lang.String configPathOrSolutionName, boolean keepAlive, java.lang.String password) throws DIException
Example:
//for Java use APIEngine.getLocalSession() to create new Session instance. var pass = "Difficult password"; session.startConfigInstance("Solution_name", false, pass);
configPathOrSolutionName
- The URL where the configuration file is loaded from or the
Solution Name of the configuration file. Only configuration
files located in the configuration codebase folder can be
referenced by Solution Name.keepAlive
- When true
the Config Instance will stay alive
even when no threads are running, when false
the
Config Instance will automatically terminate when its last
thread terminates.password
- Specify the password of the configuration when it is
password-protected; specify null
when the
configuration is not password-protected.
DIException
- if an error occurs on starting the new Config Instance.ConfigInstance startConfigInstance(java.lang.String configPathOrSolutionName, boolean keepAlive, java.lang.String password, java.lang.String runName, java.lang.String overrideProps) throws DIException
Example:
//for Java use APIEngine.getLocalSession() to create new Session instance. var pass = "Difficult password"; session.startConfigInstance("Solution_name", false, pass, "myrunname", "mystore=mynewstore.properties");
configPathOrSolutionName
- The URL where the configuration file is loaded from or the
Solution Name of the configuration file. Only configuration
files located in the configuration codebase folder can be
referenced by Solution Name.keepAlive
- When true
the Config Instance will stay alive
even when no threads are running, when false
the
Config Instance will automatically terminate when its last
thread terminates.password
- Specify the password of the configuration when it is
password-protected; specify null
when therunName
- A name which will be used as the configuration instance id. It
must not coincide with any of the id's of running
configuration instances. It must not contain forward or back
slashes or colons. This is an optional parameter that can be
null.overrideProps
- Use to redirect property stores to load their contents from
files different from the ones specified in the configuration
file. Property stores and their corresponding files are
specified as key-value pairs separated with spaces, e.g.:
"mystore1=file1.properties mystore2=file2.properties". You
cannot override a property store from an included
configuration file, because its property stores are not
directly accessible in the including file. This is an optional
parameter that can be null.
DIException
- if an error occurs on starting the new Config Instance or if
the run name is not a valid file name.ConfigInstance startConfigInstance(java.lang.String configPathOrSolutionName, boolean keepAlive, java.lang.String password, java.lang.String runName, java.lang.String overrideProps, LogListener logListener) throws DIException
Example:
//for Java use APIEngine.getLocalSession() to create new Session instance. var pass = "Difficult password"; session.startConfigInstance("Solution_name", false, pass, "myrunname", "mystore=mynewstore.properties", null);
configPathOrSolutionName
- The URL where the configuration file is loaded from or the
Solution Name of the configuration file. Only configuration
files located in the configuration codebase folder can be
referenced by Solution Name.keepAlive
- When true
the Config Instance will stay alive
even when no threads are running, when false
the
Config Instance will automatically terminate when its last
thread terminates.password
- Specify the password of the configuration when it is
password-protected; specify null
when therunName
- A name which will be used as the configuration instance id. It
must not coincide with any of the id's of running
configuration instances. It must not contain forward or back
slashes or colons. This is an optional parameter that can be
null.overrideProps
- Use to redirect property stores to load their contents from
files different from the ones specified in the configuration
file. Property stores and their corresponding files are
specified as key-value pairs separated with spaces, e.g.:
"mystore1=file1.properties mystore2=file2.properties". You
cannot override a property store from an included
configuration file, because its property stores are not
directly accessible in the including file. This is an optional
parameter that can be null.logListener
- Listener for messages logged by the configuration instance.
DIException
- if an error occurs on starting the new Config Instance or if
the run name is not a valid file name.@Deprecated ConfigInstance createNewConfigInstance(java.lang.String aConfigUrl) throws DIException
aConfigUrl
- The URL of the new configuration file to be created.
DIException
- if an error occurs while creating the new Config Instance.@Deprecated ConfigInstance createNewConfigInstance(java.lang.String aConfigUrl, java.lang.String aPassword) throws DIException
aConfigUrl
- The URL of the new configuration file to be created.aPassword
- If this parameter is not null
, the new
configuration will be protected with the given password.
DIException
- if an error occurs while creating the new Config Instance.void shutDownServer() throws DIException
Example:
//for Java use APIEngine.getLocalSession() to create new Session instance. session.shutDownServer();
DIException
- if an error occurs while shutting down the server.void shutDownServer(int aExitCode) throws DIException
Example:
//for Java use APIEngine.getLocalSession() to create new Session instance. session.shutDownServer(2);
aExitCode
- the exit code used to shut down TDI Server.
DIException
- if an error occurs while shutting down the server.void shutDownServer(int aExitCode, boolean sync) throws DIException
Example:
//for Java use APIEngine.getLocalSession() to create new Session instance. session.shutDownServer(0, false);
aExitCode
- the exit code used to shut down TDI Server.sync
- If true, do the waiting in separate Threads.
DIException
- if an error occurs while shutting down the server.SecurityRegistry getSecurityRegistry() throws DIException
DIException
- if an error occurs while retrieving security information.SystemLog getSystemLog() throws DIException
DIException
- if an error occurs while retrieving the System logging
information.void addEventListener(DIEventListener aListener, java.lang.String aTypeFilter, java.lang.String aIdFilter) throws DIException
aListener
- The Event Listener to register with the Session.aTypeFilter
- A filter for the type of events.aIdFilter
- A filter for the id of events.
DIException
- if an error occurs while registering the listener.boolean removeEventListener(DIEventListener aListener) throws DIException
aListener
- The Event Listener to unregister.
DIException
- if an error occurs while unregistering the listener.void addEventListener(ConfigurationFileListener listener) throws DIException
listener
- the listener to register
DIException
- if an error occurs while registering the listener.boolean removeEventListener(ConfigurationFileListener listener) throws DIException
listener
- the listener to unregister.
DIException
- if an error occurs while unregistering the listener.TombstoneManager getTombstoneManager() throws DIException
DIException
- If an error occurs while getting the TombstoneManager.boolean isSSLon() throws DIException
DIException
- if an error occurs while retrieving the information.boolean releaseConfigurationLock(java.lang.String relativePathOrSolutionName) throws DIException
relativePathOrSolutionName
- The path to the configuration relative to the Server
configuration codebase folder or the Solution Name of the
configuration (the configuration must be inside the
configuration codebase folder).
DIException
- If an error occurs during releasing the lock.boolean undoCheckOut(java.lang.String relativePathOrSolutionName) throws DIException
relativePathOrSolutionName
- The path to the configuration relative to the Server
configuration codebase folder or the Solution Name of the
configuration (the configuration must be inside the
configuration codebase folder).
DIException
- If an error occurs during releasing the lock.java.util.ArrayList<java.lang.String> listConfigurations(java.lang.String aRelativePath) throws DIException
Example:
//for Java use APIEngine.getLocalSession() to create new Session instance. for(alcfg in session.listConfigurations("test_folder")){ task.logmsg("getting name"); task.logmsg("Conf: " + alcfg); }
aRelativePath
- A folder relative to the Server configuration codebase folder.
DIException
- If an error occurs while retrieving configurations.java.util.ArrayList<java.lang.String> listFolders(java.lang.String aRelativePath) throws DIException
Example:
//for Java use APIEngine.getLocalSession() to create new Session instance. for(p in session.listFolders("test_folder")){ task.logmsg("getting name"); task.logmsg("Folder: " + p); }
aRelativePath
- A folder relative to the Server configuration codebase folder.
DIException
- If an error occurs while retrieving child folder.java.util.ArrayList<java.lang.String> listAllConfigurations() throws DIException
Example:
//for Java use APIEngine.getLocalSession() to create new Session instance. for(alcfg in session.listAllConfigurations()){ task.logmsg("getting name:"); task.logmsg("Conf: " + alcfg); }
DIException
- If an error occurs while retrieving configurations.MetamergeConfig checkOutConfiguration(java.lang.String relativePathOrSolutionName) throws DIException
relativePathOrSolutionName
- The path to the configuration relative to the Server
configuration codebase folder or the Solution Name of the
configuration (the configuration must be inside the
configuration codebase folder).
DIException
- If an error occurs while checking out the configuration.MetamergeConfig checkOutConfiguration(java.lang.String relativePathOrSolutionName, java.lang.String password) throws DIException
relativePathOrSolutionName
- The path to the configuration relative to the Server
configuration codebase folder or the Solution Name of the
configuration (the configuration must be inside the
configuration codebase folder).password
- Specify the password for password protected configurations.
DIException
- If an error occurs while checking out the configuration.ConfigInstance checkOutConfigurationAndLoad(java.lang.String relativePathOrSolutionName) throws DIException
relativePathOrSolutionName
- The path to the configuration relative to the Server
configuration codebase folder or the Solution Name of the
configuration (the configuration must be inside the
configuration codebase folder).
DIException
- If an error occurs while checking out the configuration.ConfigInstance checkOutConfigurationAndLoad(java.lang.String relativePathOrSolutionName, java.lang.String password) throws DIException
relativePathOrSolutionName
- The path to the configuration relative to the Server
configuration codebase folder or the Solution Name of the
configuration (the configuration must be inside the
configuration codebase folder).password
- Specify the password for password protected configurations.
DIException
- If an error occurs while checking out the configuration.void checkInConfiguration(MetamergeConfig configuration, java.lang.String relativePathOrSolutionName) throws DIException
configuration
- The MetamergeConfig object representing the configuration to
be checked in.relativePathOrSolutionName
- The path to the configuration relative to the Server
configuration codebase folder or the Solution Name of the
configuration (the configuration must be inside the
configuration codebase folder).
DIException
- If an error occurs while checking in the configuration.void checkInAndLeaveCheckedOut(MetamergeConfig configuration, java.lang.String relativePathOrSolutionName) throws DIException
configuration
- The MetamergeConfig object representing the configuration to
be checked in.relativePathOrSolutionName
- The path to the configuration relative to the Server
configuration codebase folder or the Solution Name of the
configuration (the configuration must be inside the
configuration codebase folder).
DIException
- If an error occurs while checking in the configuration.void checkInConfiguration(MetamergeConfig configuration, java.lang.String relativePathOrSolutionName, boolean encrypt) throws DIException
configuration
- The MetamergeConfig object representing the configuration to
be checked in.relativePathOrSolutionName
- The path to the configuration relative to the Server
configuration codebase folder or the Solution Name of the
configuration (the configuration must be inside the
configuration codebase folder).encrypt
- If set to true, the configuration will be encrypted on the
Server.
DIException
- If an error occurs while checking in the configuration.void checkInAndLeaveCheckedOut(MetamergeConfig configuration, java.lang.String relativePathOrSolutionName, boolean encrypt) throws DIException
configuration
- The MetamergeConfig object representing the configuration to
be checked in.relativePathOrSolutionName
- The path to the configuration relative to the Server
configuration codebase folder or the Solution Name of the
configuration (the configuration must be inside the
configuration codebase folder).encrypt
- If set to true, the configuration will be encrypted on the
Server.
DIException
- If an error occurs while checking in the configuration.MetamergeConfig createNewConfiguration(java.lang.String aRelativePath, boolean aOverwrite) throws DIException
aRelativePath
- The path of the new configuration file relative to the Server
configuration codebase folder.aOverwrite
- Specify whether to overwrite or not an already existing
configuration file.
DIException
- If an error occurs while creating the new configuration.ConfigInstance createNewConfigurationAndLoad(java.lang.String aRelativePath, boolean aOverwrite) throws DIException
aRelativePath
- The path of the new configuration file relative to the Server
configuration codebase folder.aOverwrite
- Specify whether to overwrite or not an already existing
configuration file.
DIException
- If an error occurs while creating the new configuration.boolean isConfigurationCheckedOut(java.lang.String relativePathOrSolutionName) throws DIException
relativePathOrSolutionName
- The path to the configuration relative to the Server
configuration codebase folder or the Solution Name of the
configuration (the configuration must be inside the
configuration codebase folder).
DIException
- If an error occurs while checking the configuration.void sendCustomNotification(java.lang.String aType, java.lang.String aId, java.lang.Object aData) throws DIException
Example:
//for Java use APIEngine.getLocalSession() to create new Session instance. var t = work.getAttribute("event.type"); var id = work.getAttribute("event.id"); var data = work.getAttribute("event.userData"); session.sendCustomNotification(t, id, data);
aType
- Notification type, will be automatically prefixed with "user."aId
- Notification ID, usually identifies the object this event
originated from.aData
- Custom user data. Make sure the object passed is serializable
if you want to send this event notification in a remote
context.
DIException
- If an error occurs while sending the notification.SystemQueue getSystemQueue() throws DIException
DIException
- if the System Queue is turned off or the System Queue cannot
be initializedjava.lang.String getConfigFolderPath()
Example:
//for Java use APIEngine.getLocalSession() to create new Session instance. var p = session.getConfigFolderPath(); var f = new java.io.File(p); if (f.exists()) task.logmsg("Folder path: " + p);
java.lang.Object invokeCustom(java.lang.String aCustomClassName, java.lang.String aMethodName, java.lang.Object[] aParams) throws DIException
invokeCustom
method. The usage of this method can be turned
on/off. There is a property in the global.properties file called
api.custom.method.invoke.on. If this property is set to true then this
method can be invoked, otherwise an exception is thrown if this method is
invoked. There is a restriction on the classes which can be directly
invoked. The allowed classes are described in another property in the
global.properties file called api.custom.method.invoke.allowed.classes.
Only classes listed in this property can be directly invoked by this
method. If a user tries to invoke a class which is not in this list then
an exception is thrown.
Example: Suppose the following class is packaged in a jar file,
which is then placed in the 'jars' folder of TDI:
public class MyClass {
Suppose the global.properties TDI configuration file
contains the following lines:
public static Integer multiply(Integer a , Integer b){
return new Integer(a.intValue() * b.intValue());
}
}
api.custom.method.invoke.on=true
api.custom.method.invoke.allowed.classes=MyClass
Now we can do the following:
//for Java use APIEngine.getLocalSession() to create new Session instance. var result = session.invokeCustom("MyClass", "multiply", new Array(3, 5));
aCustomClassName
- The class containing the method to be invoked.aMethodName
- The name of the method to be invoked.aParams
- Array of parameters used by the invoked method.
DIException
- If an error occurs while invoking the method.java.lang.Object invokeCustom(java.lang.String aCustomClassName, java.lang.String aMethodName, java.lang.Object[] aParamsValue, java.lang.String[] aParamsClass) throws DIException
invokeCustom
methods is that when using this method the user
MUST specify the parameters' type. The usage of this method can be turned
on/off. There is a property in the global.properties file called
api.custom.method.invoke.on. If this property is set to true then this
method can be invoked, otherwise an exception is thrown if this method is
invoked. There is a restriction on the classes which can be directly
invoked. The allowed classes are described in another property in the
global.properties file called api.custom.method.invoke.allowed.classes.
Only classes listed in this property can be directly invoked by this
method. If the user tries to invoke a class which is not in this list
then an exception is thrown.
Example: Suppose the following class is packaged in a jar file,
which is then placed in the 'jars' folder of TDI:
public class MyClass {
Suppose the global.properties TDI configuration file
contains the following lines:
public static Integer multiply(Integer a , Integer b){
return new Integer(a.intValue() * b.intValue());
}
}
api.custom.method.invoke.on=true
api.custom.method.invoke.allowed.classes=MyClass
Now we can do the following:
//for Java use APIEngine.getLocalSession() to create new Session instance. var result = session.invokeCustom("MyClass", "multiply", new Array(3, 5), new Array("java.lang.Integer", "java.lang.Integer"));
aCustomClassName
- The class containing the method to be invoked.aMethodName
- The name of the method to be invoked.aParamsValue
- Array of parameters used by the invoked method.aParamsClass
- The type of the parameters used by the invoked method.
DIException
- If an error occurs while invoking the method.void deleteConfiguration(java.lang.String relativePathOrSolutionName) throws DIException
relativePathOrSolutionName
- The path to the configuration relative to the Server
configuration codebase folder or the Solution Name of the
configuration (the configuration must be inside the
configuration codebase folder).
DIException
- The file is currently checked-out or deletion failed (e.g.
the file does not exist).ConfigInstance startTempConfigInstance(java.lang.String xmlConfig, boolean keepAlive, java.lang.String runName, java.lang.String overrideProps) throws DIException
xmlConfig
- A configuration as a XML string.keepAlive
- When true
the Config Instance will stay alive
even when no threads are running, when false
the
Config Instance will automatically terminate when its last
thread terminates.runName
- A name which will be used as the configuration instance id. It
must not coincide with any of the id's of running
configuration instances. It must not contain forward or back
slashes or colons. This is an optional parameter that can be
null.overrideProps
- Use to redirect property stores to load their contents from
files different from the ones specified in the configuration.
Property stores and their corresponding files are specified as
key-value pairs separated with spaces, e.g.:
"mystore1=file1.properties mystore2=file2.properties". You
cannot override a property store from an included
configuration, because its property stores are not directly
accessible. This is an optional parameter that can be null.
DIException
- If an error occurs on starting the new Config Instance or if
the run name is not a valid file name.ConfigInstance startTempConfigInstance(java.lang.String xmlConfig, boolean keepAlive, java.lang.String runName, java.lang.String overrideProps, LogListener logListener) throws DIException
xmlConfig
- A configuration as a XML string.keepAlive
- When true
the Config Instance will stay alive
even when no threads are running, when false
the
Config Instance will automatically terminate when its last
thread terminates.runName
- A name which will be used as the configuration instance id. It
must not coincide with any of the id's of running
configuration instances. It must not contain forward or back
slashes or colons. This is an optional parameter that can be
null.overrideProps
- Use to redirect property stores to load their contents from
files different from the ones specified in the configuration.
Property stores and their corresponding files are specified as
key-value pairs separated with spaces, e.g.:
"mystore1=file1.properties mystore2=file2.properties". You
cannot override a property store from an included
configuration, because its property stores are not directly
accessible. This is an optional parameter that can be null.logListener
- Listener for messages logged by this configuration instance.
DIException
- If an error occurs on starting the new Config Instance or if
the run name is not a valid file name.void startTombstoneManager() throws DIException
DIException
java.lang.Object getPersistentObject(java.lang.String key) throws DIException
key
- The unique key
java.lang.Exception
DIException
java.lang.Object setPersistentObject(java.lang.String key, java.lang.Object value) throws DIException
key
- The unique keyvalue
- The object to store (must be java serializable)
java.lang.Exception
DIException
java.lang.Object deletePersistentObject(java.lang.String key) throws DIException
key
- The unique key
java.lang.Exception
DIException
java.lang.String getJavaProperty(java.lang.String prop) throws DIException
prop
- The property name
DIException
void setJavaProperty(java.lang.String prop, java.lang.String value) throws DIException
prop
- The property namevalue
- The property value
DIException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |