Package org.jboss.seam.wiki.util

Source Code of org.jboss.seam.wiki.util.AnnotationDeploymentHelper

/*
* JBoss, Home of Professional Open Source
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package org.jboss.seam.wiki.util;

import org.jboss.seam.deployment.AnnotationDeploymentHandler;
import org.jboss.seam.deployment.DeploymentStrategy;
import org.jboss.seam.Component;

import java.util.Set;

/**
* A convenience class that allows us to access Seam deployment handlers without @In'jecting them.
* <p>
* This is useful because we can optimize things such as registries with @BypassInterceptors.
* </p>
*
* @author Christian Bauer
*/
public class AnnotationDeploymentHelper {

    public static Set<Class<?>> getAnnotatedClasses(String annotationFQN) {
        DeploymentStrategy deployment = (DeploymentStrategy) Component.getInstance("deploymentStrategy");
        AnnotationDeploymentHandler handler =
                (AnnotationDeploymentHandler)deployment.getDeploymentHandlers().get(AnnotationDeploymentHandler.NAME);
        return handler.getClassMap().get(annotationFQN);
    }

    public static Set<Class<?>> getAnnotatedClasses(Class annotationType) {
        return getAnnotatedClasses(annotationType.getName());
    }

}
TOP

Related Classes of org.jboss.seam.wiki.util.AnnotationDeploymentHelper

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.