![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |
A custom adapter accesses the configuration information stored in the project repository. Separating code from configuration allows a custom adapter to run with one configuration during testing, and with a different configuration after deployment.The location of the project repository can be specified on the command line, in a properties file, or in the code. In addition, some information about the adapter (for example, the instance ID or username and password) can be specified either in the custom adapter itself, on the command line, or in a properties file.-system:propfile file-system:instanceid instanceid-system:plugin plugname-system:username username-system:password password-system:messageformat formatTable 13 gives detailed information of the command-line arguments.
Before using this feature, call MAppProperties::setCommandLine().
Table 13 Command-Line Arguments This value takes precedence over any global value set in the repository. Substitution takes place only at startup.If more than one -system:clientVar is specified in the command line, the latter one replaces the prior one. No space characters are allowed in either the varName or the value when using -system:clientVar. See Variable Substitution for details.AppName - The name of the application set in MAppProperties.InstanceId - The name of the application instance. See Guidelines for Using the Argument –system:configurl for details. Tells the SDK to load a command properties file containing SDK startup information. It may also contain optional properties to be used by the adapter itself. These properties can be set and queried through the MAppProperties::setProperty() and MAppProperties::getProperty() methods (C++ only).For Java, the conventional properties mechanism can also be used. The properties file specification is part of the Java language. There are built-in APIs in Java for loading properties files, and the syntax of such files is detailed in the official Java documentation from Sun Microsystems. In particular, see the description of java.util.Properties.See Properties Files for available keys and other information. See Guidelines for Using the Argument –system:repourl for details. MApp InstanceId to be used for this process. This information supersedes any other instanceId defined. Loads a plug-in into the adapter. See the API documentation for the MPlugin class for more information. -system:username <username>-system:password <password> -system:messageformat <format> Specifies the message format to be used by the adapter. Legal values are aeRvMsg, xmlRvMsg, and xmlJmsMsg. If this option is turned on, Adapter SDK validates an incoming XML message using the XSD for the given class. The default value is off.Refer to Working with XML and XSD for more information. By default, MApp runs as a single-threaded application. Under heavy load, this could interfere with Hawk’s status update of the adapter application. Setting this property to on allows dedication of a separate thread for the application to do Hawk status updates. Setting this property to true displays a banner containing application name, RepoURL, ConfigURL, application version, information string, and the TIBCO copyright notice. This banner appears on the console.The default value is true. -system:jmsReconnectCount <reconnection count> For example: -system:jmsreconnectcount=2 -system:jmsReconnectDelay <reconnection delay> For example: -system:jmsreconnectdelay=500The argument –system:configurl <relativeUrlPath> | <absoluteUrlPath> specifies the location of the adapter instance description object. If not specified, the adapter instance description object provided in the MApp constructor is used.
• If relativeUrlPath is specified, the adapter instance description object is assumed to be under the default area in the repository (/tibco/private/adapter/).For example, the following command-line argument connects to an adapter instance description object named ZAPInstance1 in the directory /tibco/private/adapter/ZAPadapter.Here, /tibco/private/adapter/ is the default area of the repository for adapter instance description objects, ZAPadapter is an application defined subdirectory.
• If absoluteURlPath is specified, the adapter instance description object is looked up in the repository.The argument –system:repourl <repoConnectionString> | <repoLocalFile> specifies the location of the repository.
• If repositoryConnectionString is specified, a connection is made to an adapter instance description object defined in a remote repository.The following example shows a connection to an adapter instance description object named ZAPInstance1, which is defined in a remote repository. No subject name is specified, so the default subject is used. Note that tibrc@ syntax is required as part of the connection string protocol.The next example shows a connection string to an adapter instance description object defined in a remote repository that uses the given subject name for discovery. There are no space characters in the subject string.
− subject is the subject for repository discovery.
−
− timeout is the timeout value in seconds for any TIBCO Administrator communication to be aborted.
• If repositoryLocalFile is specified, a connection is made to a local file repository.The following example connects to a repository instance named ZAP.DAT that is on the local file system.Properties file values have the second highest precedence, which means if the same information can be set with a command-line argument, the command-line argument overrides the property key.tibco.clientVar.varnametibco.jmsclientid.session_nameSee Properties Files for more information.The custom adapter code can set some of the configuration information, usually through the MAppProperties instance. This approach has the lowest precedence.Specifying the information directly in the code, as shown in the following example, enables an adapter to always run with the same configuration:
![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |