@Override public ClassLoader getClassLoader() { if (config.getClassLoader() != null) { return config.getClassLoader(); } return super.getClassLoader(); }
@Override public ClassLoader getClassLoader() { if (config.getClassLoader() != null) { return config.getClassLoader(); } return super.getClassLoader(); }
if (res == null) { try { res = Class.forName(clName, false, conf.getClassLoader()); } catch (Throwable th) { if (clName.endsWith("_Struct")) // hack to define struct proxys on the fly if sent from another process Class onHeapStructClz = classCache.get(clName); if (onHeapStructClz == null) onHeapStructClz = Class.forName(clName, false, conf.getClassLoader() ); res = FSTStructFactory.getInstance().getProxyClass(onHeapStructClz); } catch (Throwable th1) { if (actorClz == null) { try { actorClz = Class.forName(clName, false, conf.getClassLoader()); } catch (ClassNotFoundException clf) { if ( conf.getLastResortResolver() != null ) { return aClass; throw new RuntimeException("class not found CLASSNAME:" + clName + " loader:"+conf.getClassLoader(), th);
@Override public void writeObject(FSTObjectOutput out, Object toWrite, FSTClazzInfo clzInfo, FSTClazzInfo.FSTFieldInfo referencedBy, int streamPosition) throws IOException { Class<?>[] ifaces = clzInfo.getClazz().getInterfaces(); ClassLoader cl = out.getConf().getClassLoader(); out.writeInt(ifaces.length); for (Class i : ifaces) out.writeUTF(i.getName()); out.writeObject(Proxy.getInvocationHandler(toWrite)); }
@Override public Object instantiate(Class objectClass, FSTObjectInput in, FSTClazzInfo serializationInfo, FSTClazzInfo.FSTFieldInfo referencee, int streamPositioin) throws IOException, ClassNotFoundException { ClassLoader cl = in.getConf().getClassLoader(); int numIfaces = in.readInt(); String[] interfaces = new String[numIfaces]; for (int i = 0; i < numIfaces; i++) { interfaces[i] = in.readUTF(); } Class[] classObjs = new Class[interfaces.length]; for(int i = 0; i < interfaces.length; ++i) { try { classObjs[i] = Class.forName(interfaces[i], false, cl); } catch (ClassNotFoundException e) { classObjs[i] = Class.forName(interfaces[i], false, this.getClass().getClassLoader()); } } InvocationHandler ih = (InvocationHandler)in.readObject(); Object res = Proxy.newProxyInstance(in.getConf().getClassLoader(),classObjs,ih); in.registerObject(res,streamPositioin,serializationInfo,referencee); return res; } }
if (res == null) { try { res = Class.forName(clName, false, conf.getClassLoader()); } catch (Throwable th) { if (clName.endsWith("_Struct")) // hack to define struct proxys on the fly if sent from another process Class onHeapStructClz = classCache.get(clName); if (onHeapStructClz == null) onHeapStructClz = Class.forName(clName, false, conf.getClassLoader() ); res = FSTStructFactory.getInstance().getProxyClass(onHeapStructClz); } catch (Throwable th1) { if (actorClz == null) { try { actorClz = Class.forName(clName, false, conf.getClassLoader()); } catch (ClassNotFoundException clf) { if ( conf.getLastResortResolver() != null ) { return aClass; throw new RuntimeException("class not found CLASSNAME:" + clName + " loader:"+conf.getClassLoader(), th);
@Override public ClassLoader getClassLoader() { if (config.getClassLoader() != null) { return config.getClassLoader(); } return super.getClassLoader(); }
@Override public Object instantiate(Class objectClass, FSTObjectInput in, FSTClazzInfo serializationInfo, FSTClazzInfo.FSTFieldInfo referencee, int streamPositioin) throws Exception { // fixme: detect local actors returned from foreign long id = in.readLong(); String clzName = in.readStringUTF(); if (clzName.endsWith("_ActorProxy")) { clzName = clzName.substring(0,clzName.length()-"_ActorProxy".length()); } Class actorClz = Class.forName(clzName,true,reg.getConf().getClassLoader()); Actor actorRef = reg.registerRemoteActorRef(actorClz, id, null); in.registerObject(actorRef, streamPositioin, serializationInfo, referencee); return actorRef; }
@Override public Object instantiate(Class objectClass, FSTObjectInput in, FSTClazzInfo serializationInfo, FSTClazzInfo.FSTFieldInfo referencee, int streamPositioin) throws Exception { // fixme: detect local actors returned from foreign long id = in.readLong(); String clzName = in.readStringUTF(); if (clzName.endsWith("_ActorProxy")) { clzName = clzName.substring(0,clzName.length()-"_ActorProxy".length()); } Class actorClz = Class.forName(clzName,true,reg.getConf().getClassLoader()); Actor actorRef = reg.registerRemoteActorRef(actorClz, id, null); in.registerObject(actorRef, streamPositioin, serializationInfo, referencee); return actorRef; }