本文整理匯總了Java中com.hazelcast.nio.ClassLoaderUtil類的典型用法代碼示例。如果您正苦於以下問題:Java ClassLoaderUtil類的具體用法?Java ClassLoaderUtil怎麽用?Java ClassLoaderUtil使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ClassLoaderUtil類屬於com.hazelcast.nio包,在下文中一共展示了ClassLoaderUtil類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: read
import com.hazelcast.nio.ClassLoaderUtil; //導入依賴的package包/類
@Override
public Writable read(ObjectDataInput in) throws IOException {
if (!warnedOnce) {
LOGGER.warning("Using default Writable serialization without explicit type registration. " +
"Consider explicit type registration using WritableSerializerHook.");
warnedOnce = true;
}
String className = in.readUTF();
try {
Writable instance = ClassLoaderUtil.newInstance(Thread.currentThread().getContextClassLoader(), className);
instance.readFields(in);
return instance;
} catch (Exception e) {
throw rethrow(e);
}
}
示例2: getTypeByName
import com.hazelcast.nio.ClassLoaderUtil; //導入依賴的package包/類
@Override
protected Class<?> getTypeByName(String className) {
try {
return ClassLoaderUtil.loadClass(classLoader, className);
} catch (ClassNotFoundException e) {
return null;
}
}
示例3: readObject
import com.hazelcast.nio.ClassLoaderUtil; //導入依賴的package包/類
private void readObject(ObjectInputStream in) throws Exception {
index = in.readInt();
split = ClassLoaderUtil.newInstance(Thread.currentThread().getContextClassLoader(), in.readUTF());
split.readFields(in);
}