Search in sources :

Example 1 with HandlerChain

use of javax.jws.HandlerChain in project tomee by apache.

the class WsDeployer method getHandlerChains.

public static HandlerChains getHandlerChains(Class<?> declaringClass, final String serviceEndpoint, final ClassLoader classLoader) throws OpenEJBException {
    HandlerChain handlerChain = declaringClass.getAnnotation(HandlerChain.class);
    if (handlerChain == null && serviceEndpoint != null) {
        try {
            declaringClass = classLoader.loadClass(serviceEndpoint);
            handlerChain = declaringClass.getAnnotation(HandlerChain.class);
        } catch (final ClassNotFoundException ignored) {
        // no-op
        }
    }
    HandlerChains handlerChains = null;
    if (handlerChain != null) {
        try {
            final URL handlerFileURL = declaringClass.getResource(handlerChain.file());
            handlerChains = ReadDescriptors.readHandlerChains(handlerFileURL);
        } catch (final Throwable e) {
            throw new OpenEJBException("Unable to load handler chain file: " + handlerChain.file(), e);
        }
    }
    return handlerChains;
}
Also used : OpenEJBException(org.apache.openejb.OpenEJBException) HandlerChain(javax.jws.HandlerChain) HandlerChains(org.apache.openejb.jee.HandlerChains) URL(java.net.URL)

Aggregations

URL (java.net.URL)1 HandlerChain (javax.jws.HandlerChain)1 OpenEJBException (org.apache.openejb.OpenEJBException)1 HandlerChains (org.apache.openejb.jee.HandlerChains)1