org.ow2.util.event.api.IEventService Maven / Gradle / Ivy
/**
* OW2 Util
* Copyright (C) 2008 Bull S.A.S.
* Contact: [email protected]
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*
* --------------------------------------------------------------------------
* $Id: IEventService.java 4389 2008-12-15 13:48:57Z alitokmen $
* --------------------------------------------------------------------------
*/
package org.ow2.util.event.api;
/**
* Allow to register event dispatchers with an id.
* Each listeners are associated with a regexp used to register them on all matching dispatchers.
* @author missonng
*/
public interface IEventService {
/**
* Start the service.
*/
void start();
/**
* Stop the service.
*/
void stop();
/**
* Get the event dispatcher with the given id.
* @param id The id of the dispatcher to get.
* @return The event dispatcher with the given id.
*/
IEventDispatcher getDispatcher(String id);
/**
* Register a new event dispatcher.
* @param id The id to register the dispatcher with.
* @param dispatcher The dispatcher to register.
*/
void registerDispatcher(String id, IEventDispatcher dispatcher);
/**
* Unregister an event dispatcher.
* @param id The id to unregister.
*/
void unregisterDispatcher(String id);
/**
* Register a new event listener.
* The listener will automatically be register with each registered dispatcher matching the given regexp.
* @param listener The listener to register.
* @param regexp The regexp to apply.
*/
void registerListener(IEventListener listener, String regexp);
/**
* Unregister an event listener.
* @param listener The listener to unregister.
*/
void unregisterListener(IEventListener listener);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy