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 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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAccepts 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.voidintitialize(IServiceEventTracker tracker) Initializes the consumer with the given tracker.voidNotifies the consumer that the scope of processing service events was changed.
-
Constructor Details
-
AbstractServiceConsumer
public AbstractServiceConsumer()
-
-
Method Details
-
intitialize
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
- Specified by:
getEventTrackerin interfaceIServiceConsumer<T>- Returns:
- the event tracker.
-
notifyServiceEventQualifierScopeChanged
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
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
Converts the given external event to AEF service event.- Parameters:
externalEvent- the external service event.- Returns:
- the AEF
IServiceEventsuccessor.
-