Package com.sap.cds.services
Class ServiceDelegator
java.lang.Object
com.sap.cds.services.ServiceDelegator
- All Implemented Interfaces:
Service
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
emit
(EventContext context) The generic consumption API to emit arbitrary events, represented byEventContext
objects.getName()
Returns the name of theService
.void
-
Constructor Details
-
ServiceDelegator
-
-
Method Details
-
before
Description copied from interface:Service
- Specified by:
before
in interfaceService
- Parameters:
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
- theHandler
implementing the business-logic, which should become active during the BEFORE phase.
-
on
Description copied from interface:Service
- Specified by:
on
in interfaceService
- Parameters:
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
- theHandler
implementing the business-logic, which should become active during the ON phase.
-
after
Description copied from interface:Service
- Specified by:
after
in interfaceService
- Parameters:
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
- theHandler
implementing the business-logic, which should become active during the AFTER phase.
-
emit
Description copied from interface:Service
The generic consumption API to emit arbitrary events, represented byEventContext
objects. More specialized consumption APIs (for exampleCqnService
) are implemented as a wrapper around this method.
Emitting anEventContext
will start the processing of the event and calls the registeredHandler
instances. IfService.emit(EventContext)
is called outside of an activeChangeSetContext
, an internalChangeSetContext
is opened and properly closed.Handler
can therefore rely on an activeChangeSetContext
.
TheEventContext
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 inEventContext
.- Specified by:
emit
in interfaceService
- Parameters:
context
- theEventContext
to be emitted
-
getName
Description copied from interface:Service
Returns the name of theService
. The name might be the fully qualified name of a service, which is also present in theCdsModel
. If the service is a technical service, the name is an arbitrary name, which is not reflected in theCdsModel
. -
getDelegatedService
-