Java Code Examples for javax.jws.HandlerChain#file()
The following examples show how to use
javax.jws.HandlerChain#file() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HandlerAnnotationProcessor.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
static InputStream getFileAsStream(Class clazz, HandlerChain chain) { URL url = clazz.getResource(chain.file()); if (url == null) { url = Thread.currentThread().getContextClassLoader(). getResource(chain.file()); } if (url == null) { String tmp = clazz.getPackage().getName(); tmp = tmp.replace('.', '/'); tmp += "/" + chain.file(); url = Thread.currentThread().getContextClassLoader().getResource(tmp); } if (url == null) { throw new UtilException("util.failed.to.find.handlerchain.file", clazz.getName(), chain.file()); } try { return url.openStream(); } catch (IOException e) { throw new UtilException("util.failed.to.parse.handlerchain.file", clazz.getName(), chain.file()); } }
Example 2
Source File: HandlerAnnotationProcessor.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
static InputStream getFileAsStream(Class clazz, HandlerChain chain) { URL url = clazz.getResource(chain.file()); if (url == null) { url = Thread.currentThread().getContextClassLoader(). getResource(chain.file()); } if (url == null) { String tmp = clazz.getPackage().getName(); tmp = tmp.replace('.', '/'); tmp += "/" + chain.file(); url = Thread.currentThread().getContextClassLoader().getResource(tmp); } if (url == null) { throw new UtilException("util.failed.to.find.handlerchain.file", clazz.getName(), chain.file()); } try { return url.openStream(); } catch (IOException e) { throw new UtilException("util.failed.to.parse.handlerchain.file", clazz.getName(), chain.file()); } }
Example 3
Source File: HandlerAnnotationProcessor.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
static InputStream getFileAsStream(Class clazz, HandlerChain chain) { URL url = clazz.getResource(chain.file()); if (url == null) { url = Thread.currentThread().getContextClassLoader(). getResource(chain.file()); } if (url == null) { String tmp = clazz.getPackage().getName(); tmp = tmp.replace('.', '/'); tmp += "/" + chain.file(); url = Thread.currentThread().getContextClassLoader().getResource(tmp); } if (url == null) { throw new UtilException("util.failed.to.find.handlerchain.file", clazz.getName(), chain.file()); } try { return url.openStream(); } catch (IOException e) { throw new UtilException("util.failed.to.parse.handlerchain.file", clazz.getName(), chain.file()); } }
Example 4
Source File: HandlerAnnotationProcessor.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
static InputStream getFileAsStream(Class clazz, HandlerChain chain) { URL url = clazz.getResource(chain.file()); if (url == null) { url = Thread.currentThread().getContextClassLoader(). getResource(chain.file()); } if (url == null) { String tmp = clazz.getPackage().getName(); tmp = tmp.replace('.', '/'); tmp += "/" + chain.file(); url = Thread.currentThread().getContextClassLoader().getResource(tmp); } if (url == null) { throw new UtilException("util.failed.to.find.handlerchain.file", clazz.getName(), chain.file()); } try { return url.openStream(); } catch (IOException e) { throw new UtilException("util.failed.to.parse.handlerchain.file", clazz.getName(), chain.file()); } }
Example 5
Source File: HandlerAnnotationProcessor.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
static InputStream getFileAsStream(Class clazz, HandlerChain chain) { Package pkg = clazz.getPackage(); String filename = chain.file(); String fullpath = addPackagePath(filename, pkg); InputStream is; is = moduleResource(clazz, filename); if (is != null) return is; is = moduleResource(clazz, fullpath); if (is != null) return is; URL url = cpResource(clazz, filename); if (url == null) url = cpResource(clazz, fullpath); if (url == null) { throw new UtilException("util.failed.to.find.handlerchain.file", clazz.getName(), filename); } try { return url.openStream(); } catch (IOException e) { throw new UtilException("util.failed.to.parse.handlerchain.file", clazz.getName(), filename); } }
Example 6
Source File: HandlerAnnotationProcessor.java From hottub with GNU General Public License v2.0 | 6 votes |
static InputStream getFileAsStream(Class clazz, HandlerChain chain) { URL url = clazz.getResource(chain.file()); if (url == null) { url = Thread.currentThread().getContextClassLoader(). getResource(chain.file()); } if (url == null) { String tmp = clazz.getPackage().getName(); tmp = tmp.replace('.', '/'); tmp += "/" + chain.file(); url = Thread.currentThread().getContextClassLoader().getResource(tmp); } if (url == null) { throw new UtilException("util.failed.to.find.handlerchain.file", clazz.getName(), chain.file()); } try { return url.openStream(); } catch (IOException e) { throw new UtilException("util.failed.to.parse.handlerchain.file", clazz.getName(), chain.file()); } }
Example 7
Source File: HandlerAnnotationProcessor.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
static InputStream getFileAsStream(Class clazz, HandlerChain chain) { URL url = clazz.getResource(chain.file()); if (url == null) { url = Thread.currentThread().getContextClassLoader(). getResource(chain.file()); } if (url == null) { String tmp = clazz.getPackage().getName(); tmp = tmp.replace('.', '/'); tmp += "/" + chain.file(); url = Thread.currentThread().getContextClassLoader().getResource(tmp); } if (url == null) { throw new UtilException("util.failed.to.find.handlerchain.file", clazz.getName(), chain.file()); } try { return url.openStream(); } catch (IOException e) { throw new UtilException("util.failed.to.parse.handlerchain.file", clazz.getName(), chain.file()); } }
Example 8
Source File: HandlerAnnotationProcessor.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
static InputStream getFileAsStream(Class clazz, HandlerChain chain) { URL url = clazz.getResource(chain.file()); if (url == null) { url = Thread.currentThread().getContextClassLoader(). getResource(chain.file()); } if (url == null) { String tmp = clazz.getPackage().getName(); tmp = tmp.replace('.', '/'); tmp += "/" + chain.file(); url = Thread.currentThread().getContextClassLoader().getResource(tmp); } if (url == null) { throw new UtilException("util.failed.to.find.handlerchain.file", clazz.getName(), chain.file()); } try { return url.openStream(); } catch (IOException e) { throw new UtilException("util.failed.to.parse.handlerchain.file", clazz.getName(), chain.file()); } }
Example 9
Source File: WsDeployer.java From tomee with Apache License 2.0 | 6 votes |
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; }