org.xwiki.component.event.ComponentDescriptorAddedEvent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xwiki-commons-component-observation Show documentation
Show all versions of xwiki-commons-component-observation Show documentation
XWiki Commons - Component - Observation
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This 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 software 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 software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.xwiki.component.event;
import java.lang.reflect.Type;
/**
* Event sent to tell that a new Component Descriptor has been registered.
*
* The event also send the following parameters:
*
*
* - source: the {@link org.xwiki.component.manager.ComponentManager} where the component was registered
* - data: the {@link org.xwiki.component.descriptor.ComponentDescriptor} instance
*
*
* @version $Id: 7087a3c5be3e8359c88c87291052d1aa57550d1d $
* @since 2.6RC2
*/
public class ComponentDescriptorAddedEvent extends AbstractComponentDescriptorEvent
{
/**
* Watches all roles (whenever a component is added it'll trigger this event).
*/
public ComponentDescriptorAddedEvent()
{
}
/**
* @param role the component role to watch (all components matching this role will trigger this event)
*/
public ComponentDescriptorAddedEvent(Class> role)
{
super(role);
}
/**
* @param roleType the component role to watch (all components matching this role will trigger this event)
* @since 4.4RC1
*/
public ComponentDescriptorAddedEvent(Type roleType)
{
super(roleType);
}
/**
* @param role the component role to watch
* @param roleHint the component role hint to watch
*/
public ComponentDescriptorAddedEvent(Class> role, String roleHint)
{
super(role, roleHint);
}
/**
* @param roleType the component role to watch
* @param roleHint the component role hint to watch
* @since 4.4RC1
*/
public ComponentDescriptorAddedEvent(Type roleType, String roleHint)
{
super(roleType, roleHint);
}
@Override
public boolean matches(Object otherEvent)
{
boolean result = false;
if (ComponentDescriptorAddedEvent.class.isAssignableFrom(otherEvent.getClass())) {
result = super.matches(otherEvent);
}
return result;
}
}