V. 1.0
Revision History | ||
---|---|---|
Revision 1.0 | 5 September 2008 | dn |
split from qore documentation |
The tibae module provides TIBCO ActiveEnterprise(TM) functionality; that is, the ability to use an adapter configuration decribing function and data classes to communicate safely with other TIBCO ActiveEnterprise(TM) components.
ActiveEnterprise is a trademark of TIBCO, Inc.
Note that the code in this module is not available with the PO_NO_NETWORK
parse option.
To use this module, include the following line in the qore program to load the module:
%requires tibae
This module was previously called "tibco", however it was renamed to avoid confusion with the tibrv module
The following table describes how Qore data is converted to Tibae data. To serialize to other types, use the Tibae Type Constants with the tibae_type() function.
Table 1. Default Serialization of Qore Data -> Tibae Format
Qore Type | Tibae Type |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Table 2. Deserialization of Tibae Message Data -> Qore Data Structures
Tibae Type | Qore Type |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| absolute |
| absolute |
| absolute |
| relative |
|
|
|
|
Table 3. Tibae Type Constants
Constant |
---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Creates a hash structure to ensure that qore data is serialized as a particular Tibae data type as specified by the first argument (use one of the constants in the Tibae Type Constant list).
tibae_type(integer, any
)
$val = tibae_type(TIBAE_INTERVAL, 5D + 3h + 2m + 25s);
Table 4. Arguments and Return Values for tibae_type()
Argument Types |
Return Type |
Description |
---|---|---|
Integer, Any |
Hash |
Creates a hash structure to ensure that qore data in the second argument is serialized as the Tibae type specified by the first argument. |
TibcoAdapter objects allow Qore programs to communicate with other TIBCO Active Enterprise components over the TIBCO message bus.
Use of this class requires a valid TIBCO repository with an adapter configuration (can be empty) and any ActiveEnterprise class definitions for outgoing messages and responses.
String data is converted to UTF-8 format if necessary for transmission with TIBCO Rendezvous.
The TibcoAdapter::constructor() method takes an adapter property hash to give the location for the repository and tell the SDK how the adapter should be instantiated. The table below describes the recognized keys in the adapter property hash and how they are used to describe the repository and the adapter. Note that the Vars
key in the property hash is used to override global variable values in the adapter.
When Qore data is serialized to TIBCO data format and you need to specify the class name for the data, use a hash and put the class name in the ^class^
key and the value in the ^value^
key.
Otherwise generally Qore data types are transformed to TIBCO data types. If the data type does not match what the repository has defined, then a run-time exception is raised.
Table 5. TIBCO Adapter Property Hash
Key | Description |
---|---|
AppInfo | Information for the adapter. |
AppName | The name of the adapter. |
AppVersion | The version of the adapter. |
RepoURL | The locataion of the repository. |
ConfigURL | The location of the adapter in the repository. |
Vars | This key can be set to a hash to override global variable values. |
Table 6. Method Overview
Method | Except? | Description |
---|---|---|
Y | Creates the adapter object based on the repository URL, class hash, and the connection parameters passed. | |
N | Destroys the TibcoAdapter object. | |
Y | Throws an exception; objects of this class cannot be copied. | |
Y | Creates a listener and receives data based on the subject and timeout values passed. | |
Y | Creates a publisher and transmits data. | |
Y | Creates a publisher, transmits data, and returns a data structure representing the reply. | |
Y | Calls a Tibco Adapter Operation and returns a data structure representing the reply. | |
Y | Calls an one way (no reply sent) Tibco Operation. |
Opens and parses a repository and instantiates an instance of an adapter based on the arguments passed.
new TibcoAdapter(session_name, properties, [classlist, service, network, daemon]
)
Table 7. Arguments for TibcoAdapter::constructor()
Argument | Type | Description |
---|---|---|
| String | The name of the session in the adapter. |
| Hash | Adapter properties, see Adapter Property Hash for more information. |
| Hash | Maps function class names to adapter positions. |
| String | Service for rendezvous daemon to connect to. |
| String | Network parameter for Rendezvous daemon to connect to. |
| String | Daemon IP address for Rendezvous daemon to connect to. |
Table 8. Return Values for TibcoAdapter::constructor()
Return Type | Description |
---|---|
TibcoAdapter Object | The new object created. |
Table 9. Exceptions Thrown by TibcoAdapter::constructor()
err | desc |
---|---|
| Non-string value found in properties hash. |
| Invalid parameters passed to constructor. |
| The TIBCO SDK raised an exception instantiating the adapter. |
Throws an exception - copying TibcoAdapter objects is not supported.
Table 10. Exceptions Thrown by TibcoAdapter::copy()
err | desc |
---|---|
| Objects of this class cannot be copied. |
Creates a listener and receives data based on the subject and timeout values passed.
TibcoAdapter::receive(subject, [timeout ms]
)
Table 11. Arguments for TibcoAdapter::receive()
Argument | Type | Description |
---|---|---|
| String | The subject to listen on. |
| Integer or Date/Time | The timeout in milliseconds (1/1000 second) or as relative date/time. |
Table 12. Return Values for TibcoAdapter::receive()
Return Type | Description |
---|---|
Hash | The message received. If a timeout value was set and no message was sent within the timeout period, no value is returned. |
Table 13. Exceptions Thrown by TibcoAdapter::receive()
err | desc |
---|---|
| Don't know how to map TIBCO data to Qore data (unsupported TIBCO data type). |
Creates a publisher and transmits data.
TibcoAdapter::sendSubject(subject, function, message
)
Table 14. Arguments for TibcoAdapter::sendSubject()
Argument | Type | Description |
---|---|---|
| String | The subject to use for the message. |
| String | The class to use for the message. |
| Hash | The message data, must match the class description or an exception will be thrown. |
Table 15. Return Values for TibcoAdapter::sendSubject()
Return Type | Description |
---|---|
n/a | This method does not return any value. |
Table 16. Exceptions Thrown by TibcoAdapter::sendSubject()
err | desc |
---|---|
| Invalid parameters passed to the method. |
| The TIBCO SDK raised an exception instantiating the adapter. |
Creates a publisher, transmits data with the given subject, and returns a data structure representing the synchronous reply.
TibcoAdapter::sendSubjectWithSyncReply(subject, function, message, [timeout ms]
)
Table 17. Arguments for TibcoAdapter::sendSubjectWithSyncReply()
Argument | Type | Description |
---|---|---|
| String | The subject to use for the message. |
| String | The class to use for the message. |
| Hash | The message data, must match the class description or an exception will be thrown. |
| Integer or Date/Time | The timeout in milliseconds (1/1000 second) or as relative date/time. |
Table 18. Return Values for TibcoAdapter::sendSubjectWithSyncReply()
Return Type | Description |
---|---|
Hash | The reply message received. If a timeout value was set and no message was sent within the timeout period, no value is returned. |
Calls an Tibco Operation, waits for the reply and converts the reply into returned data structure.
TibcoAdapter::callOperationWithSyncReply(class name, method name, call parameters, [timeout ms], [client name]
)
Table 19. Arguments for TibcoAdapter::callOperationWithSyncReply()
Argument | Type | Description |
---|---|---|
| String | Class name of the Operation, as defined in Tibco repository. |
| String | Method name of the Operation, as defined in Tibco repository. |
| Hash | Parameters passed to the Operation, must match the class description or an exception will be thrown. |
| Integer or Date/Time | Optional timeout. Default value is 60 seconds. |
| String | Optional identification of the caller, as defined in Tibco repository. Default is empty string. |
Table 20. Return Values for TibcoAdapter::callOperationWithSyncReply()
Return Type | Description |
---|---|
Hash | The reply from the Operation. If timeout expires an exception is thrown. |
Table 21. Exceptions Thrown by TibcoAdapter::callOperationWithSyncReply()
err | desc |
---|---|
| The TIBCO SDK raised an exception. |
| The TIBCO raised an exception on server side. |
| Description of a class not found in adapter parameters. |
| Class not found in repository. |
| Missing entry for an instantiated type. |
| Missing value for an instantiated type. |
| Date type cannot be instantiated. |
| A type currently not supported by the module. |
| Hash data was expected. |
| Invalid attribute of a class. |
Calls an oneway Tibco Operation, no reply is expected.
TibcoAdapter::callOperationOneWay(class name, method name, call parameters, [client name]
)
Table 22. Arguments for TibcoAdapter::callOperationOneWay()
Argument | Type | Description |
---|---|---|
| String | Class name of the oneway Operation, as defined in Tibco repository. |
| String | Method name of the oneway Operation, as defined in Tibco repository. |
| Hash | Parameters passed to the oneway Operation, must match the class description or an exception will be thrown. |
| String | Optional identification of the caller, as defined in Tibco repository. Default is empty string. |
Table 23. Exceptions Thrown by TibcoAdapter::callOperationOneWay()
err | desc |
---|---|
| The TIBCO SDK raised an exception. |
| The TIBCO raised an exception on server side. |
| Description of a class not found in adapter parameters. |
| Class not found in repository. |
| Missing entry for an instantiated type. |
| Missing value for an instantiated type. |
| Date type cannot be instantiated. |
| A type currently not supported by the module. |
| Hash data was expected. |
| Invalid attribute of a class. |