public void agentInit();
None.
None.
The agentInit() method performs all initialization functionality for the connector, including any of the following tasks required for the connector's application-specific component:
The connector framework calls the agentInit() method to initialize the connector when it comes up. If agentInit() performs any of the conditions listed in Table 116,, it must check for the following conditions and throw the appropriate exception.
To throw one of the exceptions in Table 116, take the steps outlined in Table 117:
Error-handling step | Method or code to use | |
---|---|---|
1. | If an error has occurred, log an error message to the log destination to indicate the cause of the initialization error. | CWConnectorUtil.generateAndLogMsg() |
2. | Instantiate an exception-detail object to hold the exception information. | CWConnectorExceptionObject excptnDtailObj = new CWConnectorExceptionObject(); |
3. | Set the status information within an exception-detail object: | |
excptnDtailObj.setMsg() | ||
excptnDtailObj.setStatus() | ||
4. |
Throw the agentInit() exception from Table 116 that indicates the initialization failure. This exception is how the agentInit() method tells the connector framework that a initialization error has occurred. This exception object contains the exception-detail object you initialized in Step 3. When the low-level init() method (which calls agentInit()) catches this exception object, it copies the status from the exception-detail object into its own return status, which it returns to the connector framework. Note:
If you do not set the exception status within the exception-detail
object, the init() method returns an outcome status of FAIL and the connector framework terminates the connector. |
throw new agentInitException( excptnDtailObj); |