MMBase

System events

Details

  • Type: New Feature New Feature
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9.2
  • Fix Version/s: 1.9.3, 2.0.0
  • Component/s: Core
  • Description:
    It would be convenient if MMBase itself would use its own 'EventManager' to issue events about it's own life cycle.

    Things like 'I'm up now', 'components are now initialized' etc.

Activity

Hide
Michiel Meeuwissen added a comment - 2010-03-25 15:25
For the moment only 2 system events are defined (SystemEvent.Up and ComponentRepository.Ready), but it 's easy to add more now.
Show
Michiel Meeuwissen added a comment - 2010-03-25 15:25 For the moment only 2 system events are defined (SystemEvent.Up and ComponentRepository.Ready), but it 's easy to add more now.
Hide
Michiel Meeuwissen added a comment - 2010-03-25 15:49
Example usage:

public class BlocksToDatabaseSyncer extends BasicComponent implements SystemEventListener {
    private static final Logger LOG = Logging.getLoggerInstance(BlocksToDatabaseSyncer.class);


    public BlocksToDatabaseSyncer(String name) {
        super(name);
        EventManager.getInstance().addEventListener(this);
    }

    public void notify(SystemEvent event) {
        if (event instanceof ComponentRepository.Ready) {
            Cloud cloud = ContextProvider.getDefaultCloudContext().getCloud("mmbase", "class", null);
            NodeManager blocks = cloud.getNodeManager("blocks");

         .....
Show
Michiel Meeuwissen added a comment - 2010-03-25 15:49 Example usage: public class BlocksToDatabaseSyncer extends BasicComponent implements SystemEventListener {     private static final Logger LOG = Logging.getLoggerInstance(BlocksToDatabaseSyncer.class);     public BlocksToDatabaseSyncer(String name) {         super(name);         EventManager.getInstance().addEventListener(this);     }     public void notify(SystemEvent event) {         if (event instanceof ComponentRepository.Ready) {             Cloud cloud = ContextProvider.getDefaultCloudContext().getCloud("mmbase", "class", null);             NodeManager blocks = cloud.getNodeManager("blocks");          .....

People

Dates

  • Created:
    2010-03-25 15:15
    Updated:
    2010-03-25 15:49
    Resolved:
    2010-03-25 15:25