MarshalledObjectOutputStream
3735373637373738373937403741
*/ private void writeObject(ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); stream.writeObject(new MarshalledObject(target)); }
3745374637473748374937503751375237533754375537563757
*/ private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); MarshalledObject mo = (MarshalledObject)stream.readObject(); try { target = (RemoteEventListener)mo.get(); } catch (Throwable e) { if (e instanceof Error && !(e instanceof LinkageError || e instanceof OutOfMemoryError || e instanceof StackOverflowError))
405406407408409410411412413414415
ObjectOutputStream oos = null; try { oos = new ObjectOutputStream( new BufferedOutputStream( new FileOutputStream(cookieFile))); oos.writeObject(new MarshalledObject(obj)); oos.flush(); //TODO - file sync? } catch (IOException e) { cookieFile.delete(); throw (IOException)e.fillInStackTrace();
438439440441442443444445446447448449
try { //TODO - lock out strategy for concurrent r/w file access ois = new ObjectInputStream( new BufferedInputStream( new FileInputStream(cookieFile))); MarshalledObject mo = (MarshalledObject)ois.readObject(); obj = (ActivationGroupID)mo.get(); } finally { if (ois != null) ois.close(); } return obj; }
639640641642643644645646647648649
} logger.log(Level.FINEST, "Proxy = {0}", proxy); curThread.setContextClassLoader(oldClassLoader); //TODO - factor in code integrity for MO proxy = (new MarshalledObject(proxy)).get(); } finally { curThread.setContextClassLoader(oldClassLoader); } if(proxy != null) {
726727728729730731732733
// and when we unpack to discard attributes who's codebase // has been lost without throwing away those we can still deal with. out.writeInt(attributes.length); for (int i=0; i<attributes.length; i++) { out.writeObject(new MarshalledObject(attributes[i])); } }
749750751752753754755756757758759760
{ final List entries = new java.util.LinkedList(); final int objectCount = in.readInt(); for (int i=0; i<objectCount; i++) { try { MarshalledObject mo = (MarshalledObject)in.readObject(); entries.add(mo.get()); } catch (IOException e) { if(initlogger.isLoggable(Levels.HANDLED)) { initlogger.log(Levels.HANDLED, "Exception getting service attribute ... skipping", e); }
543544545546547548549550
566567568569570571572573574575576577
{ final List entries = new java.util.LinkedList(); final int objectCount = in.readInt(); for (int i=0; i<objectCount; i++) { try { MarshalledObject mo = (MarshalledObject)in.readObject(); entries.add(mo.get()); } catch (IOException e) { logger.log(Level.INFO, "Encountered IOException recovering " + "attribute, dropping attribute", e); } catch (ClassNotFoundException e) { logger.log(Level.INFO, "Encountered ClassNotFoundException " +
545546547548549550551552553554555556557
throws ActivationException, RemoteException { logger.entering(ActivateWrapper.class.getName(), "register", new Object[] { gid, desc, Boolean.valueOf(restart), sys }); MarshalledObject data; try { data = new MarshalledObject(desc); } catch (Exception e) { MarshalException me = new MarshalException("marshalling ActivateDesc", e); logger.throwing(ActivateWrapper.class.getName(), "register", me);