Search in sources :

Example 1 with HandlerComparator

use of org.wso2.carbon.identity.core.handler.HandlerComparator in project carbon-identity-framework by wso2.

the class FrameworkServiceComponent method addHttpIdentityResponseFactory.

@Reference(name = "identity.response.factory", service = HttpIdentityResponseFactory.class, cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC, unbind = "removeHttpIdentityResponseFactory")
protected void addHttpIdentityResponseFactory(HttpIdentityResponseFactory factory) {
    FrameworkServiceDataHolder.getInstance().getHttpIdentityResponseFactories().add(factory);
    Collections.sort(FrameworkServiceDataHolder.getInstance().getHttpIdentityResponseFactories(), new HandlerComparator());
    Collections.reverse(FrameworkServiceDataHolder.getInstance().getHttpIdentityResponseFactories());
    if (log.isDebugEnabled()) {
        log.debug("Added HttpIdentityResponseFactory : " + factory.getName());
    }
}
Also used : HandlerComparator(org.wso2.carbon.identity.core.handler.HandlerComparator) Reference(org.osgi.service.component.annotations.Reference)

Example 2 with HandlerComparator

use of org.wso2.carbon.identity.core.handler.HandlerComparator in project identity-inbound-auth-oauth by wso2-extensions.

the class OAuth2ServiceComponentHolder method addAuthenticationHandler.

public static void addAuthenticationHandler(OAuthClientAuthenticator clientAuthenticator) {
    authenticationHandlers.add(clientAuthenticator);
    authenticationHandlers.sort(new HandlerComparator());
}
Also used : HandlerComparator(org.wso2.carbon.identity.core.handler.HandlerComparator)

Example 3 with HandlerComparator

use of org.wso2.carbon.identity.core.handler.HandlerComparator in project carbon-identity-framework by wso2.

the class FrameworkServiceComponent method addIdentityProcessor.

@Reference(name = "identity.processor", service = IdentityProcessor.class, cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC, unbind = "removeIdentityProcessor")
protected void addIdentityProcessor(IdentityProcessor requestProcessor) {
    FrameworkServiceDataHolder.getInstance().getIdentityProcessors().add(requestProcessor);
    Collections.sort(FrameworkServiceDataHolder.getInstance().getIdentityProcessors(), new HandlerComparator());
    Collections.reverse(FrameworkServiceDataHolder.getInstance().getIdentityProcessors());
    if (log.isDebugEnabled()) {
        log.debug("Added IdentityProcessor : " + requestProcessor.getName());
    }
}
Also used : HandlerComparator(org.wso2.carbon.identity.core.handler.HandlerComparator) Reference(org.osgi.service.component.annotations.Reference)

Example 4 with HandlerComparator

use of org.wso2.carbon.identity.core.handler.HandlerComparator in project carbon-identity-framework by wso2.

the class FrameworkServiceComponent method addHttpIdentityRequestFactory.

@Reference(name = "identity.request.factory", service = HttpIdentityRequestFactory.class, cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC, unbind = "removeHttpIdentityRequestFactory")
protected void addHttpIdentityRequestFactory(HttpIdentityRequestFactory factory) {
    FrameworkServiceDataHolder.getInstance().getHttpIdentityRequestFactories().add(factory);
    Collections.sort(FrameworkServiceDataHolder.getInstance().getHttpIdentityRequestFactories(), new HandlerComparator());
    Collections.reverse(FrameworkServiceDataHolder.getInstance().getHttpIdentityRequestFactories());
    if (log.isDebugEnabled()) {
        log.debug("Added HttpIdentityRequestFactory : " + factory.getName());
    }
}
Also used : HandlerComparator(org.wso2.carbon.identity.core.handler.HandlerComparator) Reference(org.osgi.service.component.annotations.Reference)

Example 5 with HandlerComparator

use of org.wso2.carbon.identity.core.handler.HandlerComparator in project carbon-identity-framework by wso2.

the class FrameworkServiceDataHolder method addPostAuthenticationHandler.

/**
 * Adds a post authentication handler.
 *
 * @param postAuthenticationHandler Post authentication handler implementation.
 */
public void addPostAuthenticationHandler(PostAuthenticationHandler postAuthenticationHandler) {
    synchronized (postAuthenticationHandlers) {
        this.postAuthenticationHandlers.add(postAuthenticationHandler);
        postAuthenticationHandlers.sort(new HandlerComparator());
    }
}
Also used : HandlerComparator(org.wso2.carbon.identity.core.handler.HandlerComparator)

Aggregations

HandlerComparator (org.wso2.carbon.identity.core.handler.HandlerComparator)5 Reference (org.osgi.service.component.annotations.Reference)3