BaseListener

public abstract class BaseListener<T> implements ServiceListener

A base class for listeners in MDS. Since listeners get constructed by JDO, we don’t normally have access to the spring context of MDS entities. This class retrieves this context by registering as a service listener that for the org.springframework.context.ApplicationContext. After the context gets retrieved it can be used for retrieving the service specified by the implementing listener. If service retrieval is initiated before the context is available, a wait time of max 5 minutes will begin.

Parameters:
  • <T> – the type of the service which is used by the implementing listener

Constructors

BaseListener

public BaseListener()

Methods

getApplicationContext

public ApplicationContext getApplicationContext()

getLogger

protected Logger getLogger()

getService

protected T getService()

getServiceClass

protected abstract Class<T> getServiceClass()

serviceChanged

public void serviceChanged(ServiceEvent event)