This section describes how the different parts of the connector
process a business object:
- Upon startup of the connector, the
connector's Agent class performs the following initialization
(Init) processes:
- Retrieves configuration properties.
- Fetches the Username and Password, and
Environment from the connector configuration file.
- Creates a OneWorld connector object.
- Logs in to the OneWorld server using the Login method
and parameters using the Username and Password as
fetched above. This method returns a SessionID.
- Creates an instance of the OneWorld interface object.
- Adds the connector, OneWorldInterface, and
SessionID to the connection pool.
- The OneWorld BO handler reads the verb ASI and translates it
into a sequence of callable functions or child objects.
- If the business object has a child business object of type
ACCESS_LEVEL and the Username attribute within
this child business object is populated and has a value that is
different from what is used by the adapter, then the BO handler
opens a new connection using the values of the Username
and Password attributes specified for the
ACCESS_LEVEL business object. All such business objects
must have both Username and Password attributes
populated.
- If the connection creation fails because the application is
down, the BO handler returns APPRESPONSETIMEOUT.
- If the connection creation fails because the
Username/Password is wrong, then the BO handler
logs an error and returns a FAIL status.
- If the business object does not have a child business object of
type ACCESS_LEVEL, or the value for the Username
attribute in this business object is null or has the same
value as specified for the adapter Username, then it
fetches a connection form the available connection pool. The
following steps represent what would happen in the connection pool
when the BO handler requests an available connection:
- The BO handler checks to see if there are available connections
in the pool.
- If yes, it checks for the validity of the connection. If it is
not valid it attempts to recreate the connection.
- If the connection creation fails, it returns
APPRESPONSETIMEOUT status.
- The BO handler removes the connection from the available list
and adds it to the busy list.
- If the connection is not available and the maximum number of
connections is less than the pool size, then it opens a new
connection and adds it to the connection pool's busy list. If
opening a new connection returns a failure, the adapter returns
APPRESPONSETIMEOUT.
- If no connections are available and the maximum limit of the
pool size has been reached, then the doVerbFor thread
waits until a connection becomes available.
- If the business object is of type BFN, then the
adapter performs the following actions:
- The adapter starts a transaction using the
BeginTransaction method of the OneWorld class
OneWorldInterface.
- If the business object maps to an interface class and if the
verb ASI is blank, the adapter finds the first method attribute or
the first child object that is populated in the business object and
executes. it.
- If the verb ASI is populated, the adapter calls
InvokeMethods, which loops through all the methods
specified in the verb ASI.
- If the business object maps to a business function, Invoker
executes the business function that maps to the business object. If
there are child business objects that are not of type
ACCESS_LEVEL, the BO handler loops through them and
executes the business functions corresponding to them in the order
in which they are defined in the top-level business object.
- Invoker constructs the arguments based on the attributes
defined in the business object and then invokes the method on
OneWorld Java objects using reflection APIs.
- If the execution of the complete business object succeeds, the
BO handler commits the transaction using the Commit method
on object OneWOrldInterface and returns a
VALCHANGED status.
- Releases the connection to the connection pool.
- Returns VALCHANGED upon successful execution of the
business functions.
- Returns FAIL if the business object is of type
BFN and maps to the Interface class and the verb
ASI is blank and no attributes are populated.
- Returns FAIL when processing fails.
- The ConnectionEventStore class performs the following
for subscription delivery:
- When the connector encounters an event, it
- creates a business object of the type specified by the
event,
- sets the key and non-key values for the business object (using
the object key specified in the event table),
- sets the verb as Execute if the business object is of
type business function,
- sets the verb as Retrieve if the business object is of
type interface.
- After it retrieves the business object, the connector sends it
to the integration broker with the verb specified in the
event.
- Terminates (Terminate) by closing all the connections
from the connection pool.
