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 isnull
then 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 void
accept(T externalEvent)
Accepts the given event object from service and processes it.protected abstract E
convertToAefEvent(T externalEvent)
Converts the given external event to AEF service event.void
dispose()
Disposes the consumer.IServiceEventTracker
getEventTracker()
void
intitialize(IServiceEventTracker tracker)
Initializes the consumer with the given tracker.void
notifyServiceEventQualifierScopeChanged(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:IServiceConsumer
Initializes the consumer with the given tracker. Also it is the point to initialize listeners for external events.- Specified by:
intitialize
in interfaceIServiceConsumer<T>
- Parameters:
tracker
- the tracker.
-
getEventTracker
public IServiceEventTracker getEventTracker()
- Specified by:
getEventTracker
in interfaceIServiceConsumer<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 interfaceIServiceConsumer<T>
- Parameters:
qualifiers
- the service event qualifiers.
-
dispose
public void dispose()
Description copied from interface:IServiceConsumer
Disposes the consumer.- Specified by:
dispose
in interfaceIServiceConsumer<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 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
IServiceEvent
successor.
-
-