本文整理汇总了Java中javax.jws.HandlerChain.file方法的典型用法代码示例。如果您正苦于以下问题:Java HandlerChain.file方法的具体用法?Java HandlerChain.file怎么用?Java HandlerChain.file使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.jws.HandlerChain
的用法示例。
在下文中一共展示了HandlerChain.file方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFileAsStream
import javax.jws.HandlerChain; //导入方法依赖的package包/类
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());
}
}
示例2: getFileAsStream
import javax.jws.HandlerChain; //导入方法依赖的package包/类
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);
}
}
示例3: getHandlerChains
import javax.jws.HandlerChain; //导入方法依赖的package包/类
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;
}