Java源码示例:com.caucho.hessian.io.IOExceptionWrapper
示例1
Object create(String name) throws IOException {
if (name == null) {
throw new IOException("Serialized Class expects name.");
}
Class cl = _primClasses.get(name);
if (cl != null) {
return cl;
}
ClassLoader loader = Thread.currentThread().getContextClassLoader();
try {
if (loader != null) {
return Class.forName(name, false, loader);
} else {
return Class.forName(name);
}
} catch (Exception e) {
throw new IOExceptionWrapper(e);
}
}
示例2
private Object create(long initValue)
throws IOException {
if (initValue == Long.MIN_VALUE) {
throw new IOException("java.time.LocalDateTime expects name");
}
try {
return LocalDateTime.ofEpochSecond(initValue / 1000,
(int) (initValue % 1000) * 1000 * 1000, ZoneOffset.of("+8"));
} catch (Exception e) {
throw new IOExceptionWrapper(e);
}
}
示例3
private Object create(String name) throws IOException {
if (name == null) {
throw new IOException(_enumType.getName() + " expects name.");
}
try {
return EnumUtils.readEnum(_enumType, name);
} catch (EnumDerialisationException cfe) {
throw cfe;
} catch (Exception e) {
throw new IOExceptionWrapper(e);
}
}