Modifier | Constructor and Description |
---|---|
protected |
ServiceDelegator(String name) |
Modifier and Type | Method and Description |
---|---|
void |
after(EventPredicate matcher,
Handler handler)
Deprecated.
|
void |
after(String[] events,
String[] entities,
int order,
Handler handler)
|
void |
before(EventPredicate matcher,
Handler handler)
Deprecated.
|
void |
before(String[] events,
String[] entities,
int order,
Handler handler)
|
void |
emit(EventContext context)
The generic consumption API to emit arbitrary events, represented by
EventContext objects. |
Service |
getDelegatedService() |
String |
getName()
Returns the name of the
Service . |
void |
on(EventPredicate matcher,
Handler handler)
Deprecated.
|
void |
on(String[] events,
String[] entities,
int order,
Handler handler)
|
protected ServiceDelegator(String name)
@Deprecated public void before(EventPredicate matcher, Handler handler)
Service
before
in interface Service
matcher
- the EventPredicate
, defining for which events and entities the Handler
becomes active.handler
- the Handler
implementing the business-logic, which should become active during the BEFORE phase.public void before(String[] events, String[] entities, int order, Handler handler)
Service
before
in interface Service
events
- the events the custom handler is registered forentities
- the entities the custom handler is registered fororder
- the order of the handler. the lower the order the earlier the handler gets called. if two handlers have the same order they get ordered in their registration orderhandler
- the Handler
implementing the business-logic, which should become active during the BEFORE phase.@Deprecated public void on(EventPredicate matcher, Handler handler)
Service
on
in interface Service
matcher
- the EventPredicate
, defining for which events and entities the Handler
becomes active.handler
- the Handler
implementing the business-logic, which should become active during the ON phase.public void on(String[] events, String[] entities, int order, Handler handler)
Service
on
in interface Service
events
- the events the custom handler is registered forentities
- the entities the custom handler is registered fororder
- the order of the handler. the lower the order the earlier the handler gets called. if two handlers have the same order they get ordered in their registration orderhandler
- the Handler
implementing the business-logic, which should become active during the ON phase.@Deprecated public void after(EventPredicate matcher, Handler handler)
Service
after
in interface Service
matcher
- the EventPredicate
, defining for which events and entities the Handler
becomes active.handler
- the Handler
implementing the business-logic, which should become active during the AFTER phase.public void after(String[] events, String[] entities, int order, Handler handler)
Service
after
in interface Service
events
- the events the custom handler is registered forentities
- the entities the custom handler is registered fororder
- the order of the handler. the lower the order the earlier the handler gets called. if two handlers have the same order they get ordered in their registration orderhandler
- the Handler
implementing the business-logic, which should become active during the AFTER phase.public void emit(EventContext context)
Service
EventContext
objects.
More specialized consumption APIs (for example CqnService
) are implemented as a wrapper around this method.
EventContext
will start the processing of the event and calls the registered Handler
instances.
If Service.emit(EventContext)
is called outside of an active ChangeSetContext
, an internal ChangeSetContext
is opened and properly closed.
Handler
can therefore rely on an active ChangeSetContext
.
EventContext
passed to this method, should be propagated with the required input parameters of the event.
After the method finished, the respective output parameters can be read from the passed in EventContext
.emit
in interface Service
context
- the EventContext
to be emittedpublic String getName()
Service
Service
.
The name might be the fully qualified name of a service, which is also present in the CdsModel
.
If the service is a technical service, the name is an arbitrary name, which is not reflected in the CdsModel
.public Service getDelegatedService()
Copyright © 2023. All rights reserved.