use of org.wso2.carbon.identity.core.handler.MessageHandlerComparator in project carbon-identity-framework by wso2.
the class IdentityEventServiceComponent method registerEventHandler.
@Reference(name = "event.handler", service = org.wso2.carbon.identity.event.handler.AbstractEventHandler.class, cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC, unbind = "unRegisterEventHandler")
protected void registerEventHandler(AbstractEventHandler eventHandler) {
String handlerName = eventHandler.getName();
try {
eventHandler.init(IdentityEventConfigBuilder.getInstance().getModuleConfigurations(handlerName));
} catch (IdentityEventException | IdentityRuntimeException e) {
log.warn("Properties for " + handlerName + " is not configured. This event handler will not be activated");
}
eventHandlerList.add(eventHandler);
MessageHandlerComparator messageHandlerComparator = new MessageHandlerComparator(null);
Collections.sort(eventHandlerList, messageHandlerComparator);
}
use of org.wso2.carbon.identity.core.handler.MessageHandlerComparator in project identity-data-publisher-authentication by wso2-extensions.
the class AuthenticationDataPublisherServiceComponent method setAuthenticationDataPublisher.
@Reference(name = "AuthenticationDataPublisher", service = AuthenticationDataPublisher.class, cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC, unbind = "unsetAuthenticationDataPublisher")
protected void setAuthenticationDataPublisher(AuthenticationDataPublisher publisher) {
if (publisher != null && !FrameworkConstants.AnalyticsAttributes.AUTHN_DATA_PUBLISHER_PROXY.equalsIgnoreCase(publisher.getName())) {
AuthenticationDataPublisherDataHolder.getInstance().getDataPublishers().add(publisher);
Collections.sort(AuthenticationDataPublisherDataHolder.getInstance().getDataPublishers(), new MessageHandlerComparator(null));
Collections.reverse(AuthenticationDataPublisherDataHolder.getInstance().getDataPublishers());
}
}
Aggregations