Package com._1c.g5.aef2.events
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 theIServiceConsumer. It accepts external event and convert it to AEF one. After convertation it processes the AEF event: if event isnullthen there is nothing to do. Otherwise it sends event to event tracker.
-
-
Constructor Summary
Constructors Constructor Description AbstractServiceConsumer()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaccept(T externalEvent)Accepts the given event object from service and processes it.protected abstract EconvertToAefEvent(T externalEvent)Converts the given external event to AEF service event.voiddispose()Disposes the consumer.IServiceEventTrackergetEventTracker()voidintitialize(IServiceEventTracker tracker)Initializes the consumer with the given tracker.voidnotifyServiceEventQualifierScopeChanged(Collection<IServiceEventQualifier> qualifiers)Notifies the consumer that the scope of processing service events was changed.
-
-
-
Method Detail
-
intitialize
public void intitialize(IServiceEventTracker tracker)
Description copied from interface:IServiceConsumerInitializes the consumer with the given tracker. Also it is the point to initialize listeners for external events.- Specified by:
intitializein interfaceIServiceConsumer<T>- Parameters:
tracker- the tracker.
-
getEventTracker
public IServiceEventTracker getEventTracker()
- Specified by:
getEventTrackerin interfaceIServiceConsumer<T>- Returns:
- the event tracker.
-
notifyServiceEventQualifierScopeChanged
public void notifyServiceEventQualifierScopeChanged(Collection<IServiceEventQualifier> qualifiers)
Description copied from interface:IServiceConsumerNotifies the consumer that the scope of processing service events was changed.- Specified by:
notifyServiceEventQualifierScopeChangedin interfaceIServiceConsumer<T>- Parameters:
qualifiers- the service event qualifiers.
-
dispose
public void dispose()
Description copied from interface:IServiceConsumerDisposes the consumer.- Specified by:
disposein interfaceIServiceConsumer<T>
-
accept
public void accept(T externalEvent)
Description copied from interface:IServiceConsumerAccepts the given event object from service and processes it.- Specified by:
acceptin interfaceIServiceConsumer<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
IServiceEventsuccessor.
-
-