Search in sources :

Example 1 with HandlerChainsModel

use of com.sun.xml.ws.handler.HandlerChainsModel in project metro-jax-ws by eclipse-ee4j.

the class HandlerAnnotationProcessor method buildHandlerChainsModel.

public static HandlerChainsModel buildHandlerChainsModel(final Class<?> clazz) {
    if (clazz == null) {
        return null;
    }
    HandlerChain handlerChain = clazz.getAnnotation(HandlerChain.class);
    if (handlerChain == null)
        return null;
    InputStream iStream = getFileAsStream(clazz, handlerChain);
    XMLStreamReader reader = XMLStreamReaderFactory.create(null, iStream, true);
    XMLStreamReaderUtil.nextElementContent(reader);
    HandlerChainsModel handlerChainsModel = HandlerChainsModel.parseHandlerConfigFile(clazz, reader);
    try {
        reader.close();
        iStream.close();
    } catch (XMLStreamException | IOException e) {
        e.printStackTrace();
        throw new UtilException(e.getMessage());
    }
    return handlerChainsModel;
}
Also used : HandlerChain(jakarta.jws.HandlerChain) XMLStreamReader(javax.xml.stream.XMLStreamReader) XMLStreamException(javax.xml.stream.XMLStreamException) InputStream(java.io.InputStream) HandlerChainsModel(com.sun.xml.ws.handler.HandlerChainsModel) IOException(java.io.IOException)

Aggregations

HandlerChainsModel (com.sun.xml.ws.handler.HandlerChainsModel)1 HandlerChain (jakarta.jws.HandlerChain)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 XMLStreamException (javax.xml.stream.XMLStreamException)1 XMLStreamReader (javax.xml.stream.XMLStreamReader)1