• 沒有找到結果。

tibasListenerDef_Create()

在文檔中 TIBCO ActiveSpaces (頁 178-182)

Returns a new ListenerDef instance.

Declaration

tibas_status tibasListenerDef_Create (tibasListenerDef* listenerDef)

Parameters

Parameter Description

listenerDef The new instance of ListenerDef returned by the function.

Remarks

Use the tibasListenerDefCreate() function to create a ListenerDef object that you can use to define an event listener.

After you have defined the ListenerDef object, use the tibasListenerDef_SetTimeScope() and

tibasListenerDef_SetDistributionScope() functions to specify the time scope and distribution scope for the listener.

See Also

tibasListenerDef_CreateEx(), tibasListenerDef_SetTimeScope(), tibasListenerDef_SetDistributionScope(), tibasListenerDef_Free()

tibasListenerDef_CreateEx()

Returns a new ListenerDef instance specifying additional parameters.

Declaration

tibas_status tibasListenerDef_CreateEx (tibasListenerDef* listenerDef, tibas_timeScope timeScope,

tibas_distributionScope distributionScope)

Parameters

Parameter Description

listenerDef The new instance of ListenerDef returned by the function.

timeScope Specifies the time scope for the ListenerDef. The time scope can be TIBAS_TIME_SCOPE_SNAPSHOT, TIBAS_TIME_SCOPE_NEW, TIBAS_TIME_SCOPE_NEW_EVENTS, or

TIBAS_TIME_SCOPE_ALL.

distributionScope The distribution scope to be set in the returned ListenerDef.

Remarks

Use the tibasListenerDef_CreateEx() function to create a listenerDef object and directly set the attributes for the listenerDef.

To activate the listener, call the tibasMetaspace_Listen() function or the tibasSpace_Listen() and specify the listenerDef object that you have created with tibasListenerDef_Create() or

tibasListenerDefCreateEx().

The timeScope parameter specifies the time scope, which can be one of the following:

TIBAS_TIME_SCOPE_ALL

The listener starts with all the tuples currently in the space at creation time (which will be presented as an initial set of PUT events) and then is continuously updated according to changes in the space.

TIBAS_TIME_SCOPE_SNAPSHOT

The listener contains only PUT events corresponding to the tuples stored in the space at creation time.

TIBAS_TIME_SCOPE_NEW

The listener starts empty and is updated only with events related to new or updated tuples in the space.

TIBAS_TIME_SCOPE_NEW_EVENTS

(the default setting) The listener starts empty and is updated with all events that occur in the space after creation time.

The distributionScope parameter specifies the distribution scope for the listener, which can be one of the following:

TIBAS_DISTRIBUTION_SCOPE_ALL

(default setting) The listener listens to events related to all tuples in the space.

TIBAS_DISTRIBUTION_SCOPE_SEEDED

The listener listens only to events associated with the tuples in the space that are seeded by this member.

See Also

tibasListenerDef_Create(), tibasMetaspace_Connect(), tibasSpace_Listen()

tibasListenerDef_GetTimeScope()

Returns the time scope attribute for a specified listenerDef.

Declaration

listenerDef The listenerDef for which you want to return a time scope.

timeScope The time scope can be TIBAS_TIME_SCOPE_SNAPSHOT,

TIBAS_TIME_SCOPE_NEW, TIBAS_TIME_SCOPE_NEW_EVENTS, or TIBAS_TIME_SCOPE_ALL.

Remarks

Use the tibasListenerDef_GetTimeScope() function to return the time scope attribute for a specified listenerDef.

The time scope value can be:

TIBAS_TIME_SCOPE_ALL

The listener starts with all the tuples currently in the space at creation time (which will be presented as an initial set of PUT events) and then is continuously updated according to changes in the space.

TIBAS_TIME_SCOPE_SNAPSHOT

The listener contains only PUT events corresponding to the tuples stored in the space at creation time.

TIBAS_TIME_SCOPE_NEW

The listener starts empty and is updated only with events related to new or updated tuples in the space.

TIBAS_TIME_SCOPE_NEW_EVENTS

The listener starts empty and is updated with all events that occur in the space after creation time.

See Also

tibasListenerDef_Create(), tibasListenerDef_SetTimeScope()

tibasListenerDef_GetDistributionScope()

Returns the distribution scope for a specified listenerDef.

Declaration

tibas_status tibasListenerDef_GetDistributionScope (tibasListenerDef listenerDef,

tibas_distributionScope* distributionScope)

Parameters

Parameter Description

listenerDef The TIBCO ActiveSpaces entity on which the function is invoked.

distributionScope The distribution for the specified listenerDef. Can be either TIBAS_DISTRIBUTION_SCOPE_ALL or

TIBAS_DISTRIBUTION_SCOPE_SEEDED.

Remarks

Use the tibasListenerDef_GetDistributionScope() function to return the distribution scope for a specified listenerDef.

The distribution scope can be:

TIBAS_DISTRIBUTION_SCOPE_ALL

(default setting) The listener listens to events related to all tuples in the space.

TIBAS_DISTRIBUTION_SCOPE_SEEDED

The listener listens only to events associated with the tuples in the space that are seeded by this member.

See Also

tibasListenerDef_Create(), tibasListenerDef_SetDistributionScope()

tibasListenerDef_SetTimeScope()

Sets the time scope associated with the listener.

Declaration

tibas_status tibasListenerDef_SetTimeScope (tibasListenerDef listenerDef,

tibas_timeScope timeScope)

Parameters

Parameter Description

listenerDef The TIBCO ActiveSpaces entity on which the function is invoked.

timeScope The time scope values for the listener. The time scope can be one of the following:

TIBAS_TIME_SCOPE_SNAPSHOT

TIBAS_TIME_SCOPE_NEW (the default)

TIBAS_TIME_SCOPE_NEW_EVENTS

TIBAS_TIME_SCOPE_ALL

Remarks

Use the tibasListenerDef_SetTimeScope() function to set the time scope for events that a lister will listen for. You can specify the following values:

TIBAS_TIME_SCOPE_ALL

The listener starts with all the tuples currently in the space at creation time (which will be presented as an initial set of PUT events) and then is continuously updated according to changes in the space.

TIBAS_TIME_SCOPE_SNAPSHOT

The listener contains only PUT events corresponding to the tuples stored in the space at creation time.

TIBAS_TIME_SCOPE_NEW

The listener starts empty and is updated only with events related to new or updated tuples in the space.

TIBAS_TIME_SCOPE_NEW_EVENTS

The listener starts empty and is updated with all events that occur in the space after creation time.

After you set the attributes for the ListenerDef object, you can pass it to either the tibasSpace_Listen() function or the tibasMetaspace_Listen() function to attach the listener to a space.

See Also

tibasListenerDef_Create(), tibasListenerDef_CreateEx(), tibasListenerDef_SetDistributionScope(), tibasSpace_Listen(), tibasMetaspace_Listen()

tibasListenerDef_SetDistributionScope()

Sets the distribution scope for a listener.

Declaration

tibas_status tibasListenerDef_SetDistributionScope (tibasListenerDef listenerDef,

tibas_distributionScope distributionScope)

Parameters

Parameter Description

listenerDef The TIBCO ActiveSpaces entity on which the function is invoked.

distributionScope The value can be either TIBAS_DISTRIBUTION_SCOPE_ALL (the default) or TIBAS_DISTRIBUTION_SCOPE_SEEDED.

Remarks

Use the tibasListenerDef_SetDistributionScope() function to specify the distribution scope for a listener.

The distribution scope can be:

TIBAS_DISTRIBUTION_SCOPE_ALL

(default setting) The listener listens to events related to all tuples in the space.

TIBAS_DISTRIBUTION_SCOPE_SEEDED

The listener listens only to events associated with the tuples in the space that are seeded by this member.

If the distribution role is TIBAS_DISTRIBUTION_SCOPE_SEEDED, two additional types of event may be generated:

SEED UNSEED

在文檔中 TIBCO ActiveSpaces (頁 178-182)

相關文件