Tuxedo
0

Using the CORBA Notification Service

 Previous Next Contents Index View as PDF  

Channel::subscribe

CORBA IDL

SubscriptionID subscribe (
in string subscription_name,
in RegularExpression domain,
in RegularExpression type,
in FilterExpression data_filter,
// The filter expression must length 1 and the name must
// be TRANSIENT_SUBSCRIPTION or PERSISTENT_SUBSCRIPTION.
in CosNotification::QoSProperties qos,
in CosNotifyComm::StructuredPushConsumer push_consumer
);

Parameters

For a description of the parameters supported by this operation, see "Parameters Used When Creating Subscriptions" on page  2-12.

Exceptions

CORBA::BAD_PARAM

Indicates one of the following problems:
Tobj_Events::SUB_INVALID_FILTER_EXPRESSION
Tobj_Events::SUB_UNSUPPORTED_QOS_VALUE

CORBA::IMP_LIMIT

Indicates one of the following problems:
Tobj_Events::SUB_DOMAIN_BEGINS_WITH_SYSEV

Tobj_Events::SUB_EMPTY_DOMAIN

Tobj_Events::SUB_EMPTY_TYPE

Tobj_Events::SUB_DOMAIN_AND_TYPE_TOO_LONG

Tobj_Events::SUB_FILTER_TOO_LONG

Tobj_Events::SUB_NAME_TO_LONG

Tobj_Events::TRANSIENT_ONLY_CONFIGURATION

CORBA::INV_OBJREF

Indicates the following problem:

Tobj_Events::SUB_NIL_CALLBACK_REF

Note: For more information on exceptions and corresponding minor codes, see "Exception Minor Codes" on page  2-66.

Description

Use this operation to subscribe to events. This operation is called by a subscriber application on the Notification Service to create a subscription to a particular event. The subscription name, domain name, type name, data filter, quality of service, and the object reference of the subscriber's callback object are passed in. The callback object implements the CosNotifyComm::StructuredPushConsumer IDL interface.

Note: For subscribers that shut down and restart, you must write the subscription_id to persistent storage.

To use data filtering or subscribe to BEA Tuxedo system events or events posted by a BEA Tuxedo application, see the sections "Creating FML Field Table Files for Events" on page  2-8 and "Interoperability with BEA Tuxedo Applications" on page  2-10.

Return Value

Returns a unique subscription identifier. The effect of this operation is not instantaneous. There can be a delay between returning from this operation and the actual start of event delivery. The length of the delay period may be significant depending on your configuration. For more information on factors impacting this delay period, see "Synchronizing Databases" on page  7-24.

Note: Notification Service applications that start and shut down only once can use the subscription_id to determine if their subscription has been cancelled automatically or by the system administrator.

Examples

Note: Code examples shown here are abbreviated. For complete code examples, see "Creating a Subscription" on page  3-12.

C++ code example:

subscription_id = channel->subscribe(
subscription_name,
"News", // domain
"Sports", // type
"", // No data filter.
qos,
news_consumer.in()
);

Java code example:

 

Back to Top Previous Next
Contact e-docsContact BEAwebmasterprivacy