Class ServiceDelegator

java.lang.Object
com.sap.cds.services.ServiceDelegator
All Implemented Interfaces:
Service

public abstract class ServiceDelegator extends Object implements Service
  • Constructor Details

    • ServiceDelegator

      protected ServiceDelegator(String name)
  • Method Details

    • before

      public void before(String[] events, String[] entities, int order, Handler handler)
      Description copied from interface: Service
      Registers a Handler on this Service for the BEFORE phase of the processing of an EventContext.
      Specified by:
      before in interface Service
      Parameters:
      events - the events the custom handler is registered for
      entities - the entities the custom handler is registered for
      order - 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 order
      handler - the Handler implementing the business-logic, which should become active during the BEFORE phase.
    • on

      public void on(String[] events, String[] entities, int order, Handler handler)
      Description copied from interface: Service
      Registers a Handler on this Service for the ON phase of the processing of an EventContext.
      Specified by:
      on in interface Service
      Parameters:
      events - the events the custom handler is registered for
      entities - the entities the custom handler is registered for
      order - 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 order
      handler - the Handler implementing the business-logic, which should become active during the ON phase.
    • after

      public void after(String[] events, String[] entities, int order, Handler handler)
      Description copied from interface: Service
      Registers a Handler on this Service for the AFTER phase of the processing of an EventContext.
      Specified by:
      after in interface Service
      Parameters:
      events - the events the custom handler is registered for
      entities - the entities the custom handler is registered for
      order - 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 order
      handler - the Handler implementing the business-logic, which should become active during the AFTER phase.
    • emit

      public void emit(EventContext context)
      Description copied from interface: Service
      The generic consumption API to emit arbitrary events, represented by EventContext objects. More specialized consumption APIs (for example CqnService) are implemented as a wrapper around this method.
      Emitting an 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.
      The 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.
      Specified by:
      emit in interface Service
      Parameters:
      context - the EventContext to be emitted
    • getName

      public String getName()
      Description copied from interface: Service
      Returns the name of the 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.
      Specified by:
      getName in interface Service
      Returns:
      the name of the Service
    • getDelegatedService

      public Service getDelegatedService()