public class NamedEventManager
extends java.lang.Object
ProcedureManager
APIs.
PUBLISHProcedureManager.publish(com.goldencode.p2j.util.character, com.goldencode.p2j.util.handle, java.lang.String, java.lang.Object[])
SUBSCRIBEProcedureManager.subscribe(com.goldencode.p2j.util.handle, com.goldencode.p2j.util.character, com.goldencode.p2j.util.handle, com.goldencode.p2j.util.character)
ProcedureManager.subscribeAnywhere(com.goldencode.p2j.util.handle, com.goldencode.p2j.util.character, com.goldencode.p2j.util.character)
UNSUBSCRIBEProcedureManager.unsubscribe(com.goldencode.p2j.util.handle, com.goldencode.p2j.util.character, com.goldencode.p2j.util.handle)
ProcedureManager.unsubscribeAll(com.goldencode.p2j.util.handle, com.goldencode.p2j.util.handle)
Constructor and Description |
---|
NamedEventManager() |
Modifier and Type | Method and Description |
---|---|
static void |
publish(character event,
handle publisher)
Notify all subscribers (to the given event) that the event has occurred.
|
static void |
publish(character event,
handle publisher,
java.lang.Object[] param)
Notify all subscribers (to the given event) that the event has occurred.
|
static void |
publish(character event,
handle publisher,
java.lang.String modes,
java.lang.Object[] param)
Notify all subscribers (to the given event) that the event has occurred.
|
static void |
publish(java.lang.String event,
handle publisher)
Notify all subscribers (to the given event) that the event has occurred.
|
static void |
publish(java.lang.String event,
handle publisher,
java.lang.Object[] param)
Notify all subscribers (to the given event) that the event has occurred.
|
static void |
publish(java.lang.String event,
handle publisher,
java.lang.String modes,
java.lang.Object[] param)
Notify all subscribers (to the given event) that the event has occurred.
|
static void |
publishExternal(java.lang.String event,
handle publisher,
java.lang.String[] args)
Notify all subscribers (to the given event) that the event has occurred.
|
static void |
subscribe(handle subscriber,
character event)
Create a new subscription to the given event for a specified program.
|
static void |
subscribe(handle subscriber,
character event,
handle publisher)
Create a new subscription to the given event for a specified program.
|
static void |
subscribe(handle subscriber,
character event,
handle publisher,
character method)
Create a new subscription to the given event for a specified program.
|
static void |
subscribe(handle subscriber,
character event,
handle publisher,
java.lang.String method)
Create a new subscription to the given event for a specified program.
|
static void |
subscribe(handle subscriber,
java.lang.String event)
Create a new subscription to the given event for a specified program.
|
static void |
subscribe(handle subscriber,
java.lang.String event,
handle publisher)
Create a new subscription to the given event for a specified program.
|
static void |
subscribe(handle subscriber,
java.lang.String event,
handle publisher,
character method)
Create a new subscription to the given event for a specified program.
|
static void |
subscribe(handle subscriber,
java.lang.String event,
handle publisher,
java.lang.String method)
Create a new subscription to the given event for a specified program.
|
static void |
subscribeAnywhere(handle subscriber,
character event)
Create a new subscription to the given event for any program.
|
static void |
subscribeAnywhere(handle subscriber,
character event,
character method)
Create a new subscription to the given event for any program.
|
static void |
subscribeAnywhere(handle subscriber,
character event,
java.lang.String method)
Create a new subscription to the given event for any program.
|
static void |
subscribeAnywhere(handle subscriber,
java.lang.String event)
Create a new subscription to the given event for any program.
|
static void |
subscribeAnywhere(handle subscriber,
java.lang.String event,
character method)
Create a new subscription to the given event for any program.
|
static void |
subscribeAnywhere(handle subscriber,
java.lang.String event,
java.lang.String method)
Create a new subscription to the given event for any program.
|
static handle |
subscribeExternal(boolean global,
handle subscriber,
java.lang.String event,
handle publisher)
Create a new subscription to the given event for a specified external resource.
|
static void |
unsubscribe(handle subscriber,
character event)
Delete a subscription to the given event for the specified program.
|
static void |
unsubscribe(handle subscriber,
character event,
handle publisher)
Delete a subscription to the given event for the specified program.
|
static void |
unsubscribe(handle subscriber,
java.lang.String event)
Delete a subscription to the given event for the specified program.
|
static void |
unsubscribe(handle subscriber,
java.lang.String event,
handle publisher)
Delete a subscription to the given event for the specified program.
|
static void |
unsubscribeAll(handle subscriber)
Delete a subscription to ALL events for the specified program.
|
static void |
unsubscribeAll(handle subscriber,
handle publisher)
Delete a subscription to ALL events for the specified program.
|
static void |
unsubscribeExternal(boolean global,
handle subscriber,
java.lang.String event,
handle publisher)
Delete a subscription to the given event for the specified external resource.
|
public static void publish(java.lang.String event, handle publisher)
ErrorManager.silent(java.lang.Runnable)
bracket, as the PUBLISH
statement is executed with a default NO-ERROR clause.
All processing is done with silent error mode implicitly enabled.
event
- The name of the event which is being published.publisher
- The procedure handle representing the program that is the
source of the event. Must not be null
.public static void publish(character event, handle publisher)
ErrorManager.silent(java.lang.Runnable)
bracket, as the PUBLISH
statement is executed with a default NO-ERROR clause.
All processing is done with silent error mode implicitly enabled.
event
- The name of the event which is being published.publisher
- The procedure handle representing the program that is the
source of the event. Must not be null
.public static void publish(java.lang.String event, handle publisher, java.lang.Object[] param)
ErrorManager.silent(java.lang.Runnable)
bracket, as the PUBLISH
statement is executed with a default NO-ERROR clause.
All processing is done with silent error mode implicitly enabled.
event
- The name of the event which is being published.publisher
- The procedure handle representing the program that is the
source of the event. Must not be null
.param
- The parameters passed to the subscriber. May be
null
to represent no parameters.public static void publish(character event, handle publisher, java.lang.Object[] param)
ErrorManager.silent(java.lang.Runnable)
bracket, as the PUBLISH
statement is executed with a default NO-ERROR clause.
All processing is done with silent error mode implicitly enabled.
event
- The name of the event which is being published.publisher
- The procedure handle representing the program that is the
source of the event. Must not be null
.param
- The parameters passed to the subscriber. May be
null
to represent no parameters.public static void publish(java.lang.String event, handle publisher, java.lang.String modes, java.lang.Object[] param)
ErrorManager.silent(java.lang.Runnable)
bracket, as the PUBLISH
statement is executed with a default NO-ERROR clause.
All processing is done with silent error mode implicitly enabled.
event
- The name of the event which is being published.publisher
- The procedure handle representing the program that is the
source of the event. Must not be null
.modes
- The mode for each parameter, encoded in a string. When
null
, the parameter modes will not be checked
against the procedure definition.param
- The parameters passed to the subscriber. May be
null
to represent no parameters.public static void publish(character event, handle publisher, java.lang.String modes, java.lang.Object[] param)
ErrorManager.silent(java.lang.Runnable)
bracket, as the PUBLISH
statement is executed with a default NO-ERROR clause.
All processing is done with silent error mode implicitly enabled.
event
- The name of the event which is being published.publisher
- The procedure handle representing the program that is the
source of the event. Must not be null
.modes
- The mode for each parameter, encoded in a string. When
null
, the parameter modes will not be checked
against the procedure definition.param
- The parameters passed to the subscriber. May be
null
to represent no parameters.public static void subscribe(handle subscriber, java.lang.String event)
subscriber
- The program to notify when the specified event is published.
Must not be null
. The specified program must
have a method that corresponds to a Progress 4GL internal
procedure name created from the given event name.event
- The name of the event which is being published.public static void subscribe(handle subscriber, character event)
subscriber
- The program to notify when the specified event is published.
Must not be null
. The specified program must
have a method that corresponds to a Progress 4GL internal
procedure name created from the given event name.event
- The name of the event which is being published.public static void subscribe(handle subscriber, java.lang.String event, handle publisher)
subscriber
- The program to notify when the specified event is published.
Must not be null
. The specified program must
have a method that corresponds to a Progress 4GL internal
procedure name created from the given event name.event
- The name of the event which is being published.publisher
- The procedure handle representing the program that is the
source of the event. If specified, the named event will only
cause a notification if the event source matches this handle.
null
represents the ANYWHERE
option
which means that the events will not be filtered by source.public static void subscribe(handle subscriber, character event, handle publisher)
subscriber
- The program to notify when the specified event is published.
Must not be null
. The specified program must
have a method that corresponds to a Progress 4GL internal
procedure name created from the given event name.event
- The name of the event which is being published.publisher
- The procedure handle representing the program that is the
source of the event. If specified, the named event will only
cause a notification if the event source matches this handle.
null
represents the ANYWHERE
option
which means that the events will not be filtered by source.public static void subscribe(handle subscriber, java.lang.String event, handle publisher, java.lang.String method)
subscriber
- The program to notify when the specified event is published.
Must not be null
. The specified program must
have a method that corresponds to the given Progress 4GL
internal procedure name (method
).event
- The name of the event which is being published.publisher
- The procedure handle representing the program that is the
source of the event. If specified, the named event will only
cause a notification if the event source matches this handle.
null
represents the ANYWHERE
option
which means that the events will not be filtered by source.method
- The Progress 4GL internal procedure name which will be
translated into a method name and invoked on the
subscriber
instance.public static void subscribe(handle subscriber, java.lang.String event, handle publisher, character method)
subscriber
- The program to notify when the specified event is published.
Must not be null
. The specified program must
have a method that corresponds to the given Progress 4GL
internal procedure name (method
).event
- The name of the event which is being published.publisher
- The procedure handle representing the program that is the
source of the event. If specified, the named event will only
cause a notification if the event source matches this handle.
null
represents the ANYWHERE
option
which means that the events will not be filtered by source.method
- The Progress 4GL internal procedure name which will be
translated into a method name and invoked on the
subscriber
instance.public static void subscribe(handle subscriber, character event, handle publisher, java.lang.String method)
subscriber
- The program to notify when the specified event is published.
Must not be null
. The specified program must
have a method that corresponds to the given Progress 4GL
internal procedure name (method
).event
- The name of the event which is being published.publisher
- The procedure handle representing the program that is the
source of the event. If specified, the named event will only
cause a notification if the event source matches this handle.
null
represents the ANYWHERE
option
which means that the events will not be filtered by source.method
- The Progress 4GL internal procedure name which will be
translated into a method name and invoked on the
subscriber
instance.public static void subscribe(handle subscriber, character event, handle publisher, character method)
subscriber
- The program to notify when the specified event is published.
Must not be null
. The specified program must
have a method that corresponds to the given Progress 4GL
internal procedure name (method
).event
- The name of the event which is being published.publisher
- The procedure handle representing the program that is the
source of the event. If specified, the named event will only
cause a notification if the event source matches this handle.
null
represents the ANYWHERE
option
which means that the events will not be filtered by source.method
- The Progress 4GL internal procedure name which will be
translated into a method name and invoked on the
subscriber
instance.public static void subscribeAnywhere(handle subscriber, java.lang.String event)
subscriber
- The program to notify when the specified event is published.
Must not be null
. The specified program must
have a method that corresponds to the given Progress 4GL
internal procedure name (method
).event
- The name of the event which is being published.public static void subscribeAnywhere(handle subscriber, character event)
subscriber
- The program to notify when the specified event is published.
Must not be null
. The specified program must
have a method that corresponds to the given Progress 4GL
internal procedure name (method
).event
- The name of the event which is being published.public static void subscribeAnywhere(handle subscriber, java.lang.String event, java.lang.String method)
subscriber
- The program to notify when the specified event is published.
Must not be null
. The specified program must
have a method that corresponds to the given Progress 4GL
internal procedure name (method
).event
- The name of the event which is being published.method
- The Progress 4GL internal procedure name which will be
translated into a method name and invoked on the
subscriber
instance.public static void subscribeAnywhere(handle subscriber, character event, java.lang.String method)
subscriber
- The program to notify when the specified event is published.
Must not be null
. The specified program must
have a method that corresponds to the given Progress 4GL
internal procedure name (method
).event
- The name of the event which is being published.method
- The Progress 4GL internal procedure name which will be
translated into a method name and invoked on the
subscriber
instance.public static void subscribeAnywhere(handle subscriber, java.lang.String event, character method)
subscriber
- The program to notify when the specified event is published.
Must not be null
. The specified program must
have a method that corresponds to the given Progress 4GL
internal procedure name (method
).event
- The name of the event which is being published.method
- The Progress 4GL internal procedure name which will be
translated into a method name and invoked on the
subscriber
instance.public static void subscribeAnywhere(handle subscriber, character event, character method)
subscriber
- The program to notify when the specified event is published.
Must not be null
. The specified program must
have a method that corresponds to the given Progress 4GL
internal procedure name (method
).event
- The name of the event which is being published.method
- The Progress 4GL internal procedure name which will be
translated into a method name and invoked on the
subscriber
instance.public static handle subscribeExternal(boolean global, handle subscriber, java.lang.String event, handle publisher)
global
- Flag indicating if the subscription is for global (cross-session) events.subscriber
- The resource to notify when the specified event is published. If null
,
a ExternalResource
will be built and its ID return.event
- The name of the event which is being published.publisher
- The handle representing the program or resource that is the source of the event.
If specified, the named event will only cause a notification if the event source
matches this handle. null
represents the ANYWHERE
option
which means that the events will not be filtered by source.public static void unsubscribeExternal(boolean global, handle subscriber, java.lang.String event, handle publisher)
ErrorManager.silent(java.lang.Runnable)
bracket, as the UNSUBSCRIBE
statement is executed with a default NO-ERROR clause.global
- Flag indicating if the search is done in the global (cross-session) event register.subscriber
- The resource whose subscription is to be deleted. Must not be null
.event
- The name of the event which is being published. If this is null
, then
subscriptions to all events will be deleted.publisher
- The procedure or resource handle representing the source of the event.
If specified, the subscription will only be deleted if the event source matches
this handle. null
represents the ALL
option which means
that the events will not be filtered by source. When null
, it means
that the publisher was not set.public static void publishExternal(java.lang.String event, handle publisher, java.lang.String[] args)
ErrorManager.silent(java.lang.Runnable)
bracket, as the PUBLISH
statement is executed with a default NO-ERROR clause.
All processing is done with silent error mode implicitly enabled.
The subscriptions are fired in the order they were subscribed. Although 4GL documentation specifically states, that "If a named event has multiple subscribers, the order in which the AVM notifies subscribers is undefined.", the actual 4GL implementation (OpenEdge 10.2B) does fire the events in the order the subscriptions get subscribed.
event
- The name of the event which is being published.publisher
- The procedure or resource handle representing the program that is the source of
the event. Must not be null
.args
- The parameters passed to the subscriber. May be null
to represent no
parameters. When null
, it means that no parameters were specified for
this call.public static void unsubscribe(handle subscriber, java.lang.String event)
ErrorManager.silent(java.lang.Runnable)
bracket, as the UNSUBSCRIBE
statement is executed with a default NO-ERROR clause.subscriber
- The program whose subscription is to be deleted. Must not
be null
.event
- The name of the event which is being published. If this is
null
, then subscriptions to all events will be
deleted.public static void unsubscribe(handle subscriber, character event)
ErrorManager.silent(java.lang.Runnable)
bracket, as the UNSUBSCRIBE
statement is executed with a default NO-ERROR clause.subscriber
- The program whose subscription is to be deleted. Must not
be null
.event
- The name of the event which is being published. If this is
null
, then subscriptions to all events will be
deleted.public static void unsubscribe(handle subscriber, java.lang.String event, handle publisher)
ErrorManager.silent(java.lang.Runnable)
bracket, as the UNSUBSCRIBE
statement is executed with a default NO-ERROR clause.subscriber
- The program whose subscription is to be deleted. Must not
be null
.event
- The name of the event which is being published. If this is
null
, then subscriptions to all events will be
deleted.publisher
- The procedure handle representing the program that is the
source of the event. If specified, the subscription will only
be deleted if the event source matches this handle.
null
represents the ALL
option
which means that the events will not be filtered by source.public static void unsubscribe(handle subscriber, character event, handle publisher)
ErrorManager.silent(java.lang.Runnable)
bracket, as the UNSUBSCRIBE
statement is executed with a default NO-ERROR clause.subscriber
- The program whose subscription is to be deleted. Must not
be null
.event
- The name of the event which is being published. If this is
null
, then subscriptions to all events will be
deleted.publisher
- The procedure handle representing the program that is the
source of the event. If specified, the subscription will only
be deleted if the event source matches this handle.
null
represents the ALL
option
which means that the events will not be filtered by source.public static void unsubscribeAll(handle subscriber)
ErrorManager.silent(java.lang.Runnable)
bracket, as the UNSUBSCRIBE
statement is executed with a default NO-ERROR clause.subscriber
- The program whose subscription is to be deleted. Must not
be null
.public static void unsubscribeAll(handle subscriber, handle publisher)
ErrorManager.silent(java.lang.Runnable)
bracket, as the UNSUBSCRIBE
statement is executed with a default NO-ERROR clause.subscriber
- The program whose subscription is to be deleted. Must not
be null
.publisher
- The procedure handle representing the program that is the
source of the event. If specified, the subscription will only
be deleted if the event source matches this handle.
null
represents the ALL
option
which means that the events will not be filtered by source.