3.4.4.4. Listener to a space lifecycle

To receive notifications of what are happening in spaces, you need to extend SpaceListenerPlugin and register it. Every method takes a SpaceLifeCycleEvent object as a parameter that contains the information about the event and its context.

The available events are:



import org.exoplatform.social.space.lifecycle.SpaceListenerPlugin;
public class MySpaceListenerPlugin extends SpaceListenerPlugin {
...
}

As an example, see SpaceActivityPublisher that publishes an activity based on an event that happened in a space.

To register your listener, configure it as a plugin to the SpaceService like this:



<external-component-plugins>
  <target-component>org.exoplatform.social.core.space.spi.SpaceService</target-component>
  <component-plugin>
    <name>SpaceActivityPublisher</name>
    <set-method>addSpaceListener</set-method>
    <type>org.mycompany.MySpaceListenerPlugin</type>
  </component-plugin>
</external-component-plugins>
Copyright ©2012. All rights reserved. eXo Platform SAS