org.xwiki.observation.remote.internal.converter
Class DefaultEventConverterManager

java.lang.Object
  extended by org.xwiki.observation.remote.internal.converter.DefaultEventConverterManager
All Implemented Interfaces:
Initializable, EventConverterManager

@Component
@Singleton
public class DefaultEventConverterManager
extends Object
implements EventConverterManager, Initializable

Default implementation of EventConverterManager.

Since:
2.0M3

Constructor Summary
DefaultEventConverterManager()
           
 
Method Summary
 LocalEventData createLocalEventData(RemoteEventData remoteEvent)
          Convert a remote event to a local event.
 RemoteEventData createRemoteEventData(LocalEventData localEvent)
          Convert a local event to a remote event.
 List<LocalEventConverter> getLocalEventConverters()
           
 List<RemoteEventConverter> getRemoteEventConverters()
           
 void initialize()
          Method called by the Component Manager when the component is created for the first time (i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultEventConverterManager

public DefaultEventConverterManager()
Method Detail

initialize

public void initialize()
                throws InitializationException
Description copied from interface: Initializable
Method called by the Component Manager when the component is created for the first time (i.e. when it's looked up for the first time or if the component is specified as being loaded on startup). If the component instantiation strategy is singleton then this method is called only once during the lifecycle of the Component Manager. Otherwise the component is created at each lookup and thus this method is called at each lookup too.

Specified by:
initialize in interface Initializable
Throws:
InitializationException - if an error happens during a component's initialization

getLocalEventConverters

public List<LocalEventConverter> getLocalEventConverters()
Specified by:
getLocalEventConverters in interface EventConverterManager
Returns:
the local to remote events converters

getRemoteEventConverters

public List<RemoteEventConverter> getRemoteEventConverters()
Specified by:
getRemoteEventConverters in interface EventConverterManager
Returns:
the remote to local events converters

createRemoteEventData

public RemoteEventData createRemoteEventData(LocalEventData localEvent)
Description copied from interface: EventConverterManager
Convert a local event to a remote event.

Specified by:
createRemoteEventData in interface EventConverterManager
Parameters:
localEvent - the local event
Returns:
the remote event, if null the event should not be sent to the network.

createLocalEventData

public LocalEventData createLocalEventData(RemoteEventData remoteEvent)
Description copied from interface: EventConverterManager
Convert a remote event to a local event.

Specified by:
createLocalEventData in interface EventConverterManager
Parameters:
remoteEvent - the remote event
Returns:
the local event, if null the event should not send to ObservationManager.