Class AbstractServiceConsumer<T,E extends IServiceEvent>

java.lang.Object
com._1c.g5.aef2.events.AbstractServiceConsumer<T,E>
Type Parameters:
T - the type of external service event object.
E - the type of the event that is created by service one.
All Implemented Interfaces:
IServiceConsumer<T>
Direct Known Subclasses:
BmChangeEventConsumer, DerivedDataObjectStatusConsumer, DistributionSupportChangeConsumer, EditingLanguageChangeConsumer, ProjectParametersConsumer

public abstract class AbstractServiceConsumer<T,E extends IServiceEvent> extends Object implements IServiceConsumer<T>
The basic abstract implementation of the IServiceConsumer. It accepts external event and convert it to AEF one. After convertation it processes the AEF event: if event is null then there is nothing to do. Otherwise it sends event to event tracker.
  • Constructor Details

    • AbstractServiceConsumer

      public AbstractServiceConsumer()
  • Method Details

    • intitialize

      public void intitialize(IServiceEventTracker tracker)
      Description copied from interface: IServiceConsumer
      Initializes the consumer with the given tracker. Also it is the point to initialize listeners for external events.
      Specified by:
      intitialize in interface IServiceConsumer<T>
      Parameters:
      tracker - the tracker.
    • getEventTracker

      public IServiceEventTracker getEventTracker()
      Specified by:
      getEventTracker in interface IServiceConsumer<T>
      Returns:
      the event tracker.
    • notifyServiceEventQualifierScopeChanged

      public void notifyServiceEventQualifierScopeChanged(Collection<IServiceEventQualifier> qualifiers)
      Description copied from interface: IServiceConsumer
      Notifies the consumer that the scope of processing service events was changed.
      Specified by:
      notifyServiceEventQualifierScopeChanged in interface IServiceConsumer<T>
      Parameters:
      qualifiers - the service event qualifiers.
    • dispose

      public void dispose()
      Description copied from interface: IServiceConsumer
      Disposes the consumer.
      Specified by:
      dispose in interface IServiceConsumer<T>
    • accept

      public void accept(T externalEvent)
      Description copied from interface: IServiceConsumer
      Accepts the given event object from service and processes it.
      Specified by:
      accept in interface IServiceConsumer<T>
      Parameters:
      externalEvent - the event or message object from service.
    • convertToAefEvent

      protected abstract E convertToAefEvent(T externalEvent)
      Converts the given external event to AEF service event.
      Parameters:
      externalEvent - the external service event.
      Returns:
      the AEF IServiceEvent successor.