Object readResolve() throws ObjectStreamException { return instance.convertToMarshalledObject(); } }
/** * Returns the handback object that was provided as a parameter to * the event interest registration method, if any. * * @return the MarshalledObject that was provided as a parameter to * the event interest registration method, if any. * @deprecated Use {@link #getRegistrationInstance() } instead. */ @Deprecated public MarshalledObject getRegistrationObject() { if (handback == null && miHandback != null) return miHandback.convertToMarshalledObject(); return handback; }
/** * @serialData RemoteEventListener as a MarshalledObject */ private void writeObject(ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); stream.writeObject(new MarshalledInstance(target).convertToMarshalledObject()); }
/** Set the reference to the client-supplied notification target */ public synchronized void setEventTarget(RemoteEventListener preparedTarget) throws IOException { if (preparedTarget == null) { preparedEventTarget = null; marshalledEventTarget = null; } else { preparedEventTarget = preparedTarget; marshalledEventTarget = new MarshalledInstance(preparedTarget).convertToMarshalledObject(); } }
/** * @serialData Use default semantics for the <tt>id</tt> field but * write the <tt>source</tt> field out as a <tt>MarshalledObject</tt>. * The <tt>source</tt> field is written out as a <tt>MarshalledObject</tt> * to preserve the codebase annotation as well as to * guarantee that the object can be successfully read from the stream * (even if the codebase is unavailable at the time the object is * being reconstituted). * * @exception IOException if an I/O error occurs */ private void writeObject(ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); stream.writeObject(new MarshalledInstance(source).convertToMarshalledObject()); }
/** * Utility method to write out an array of entities to an * <code>ObjectOutputStream</code>. Can be recovered by a call * to <code>readAttributes()</code> * <p> * Packages each attribute in its own <code>MarshalledObject</code> so * a bad codebase on an attribute class will not corrupt the whole array. */ static private void writeAttributes(Entry[] attributes, ObjectOutputStream out) throws IOException { // Need to package each attribute in its own marshalled object. // This makes sure that the attribute's codebase is preserved // and, when we unpack, that we can discard attributes whose 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 MarshalledInstance(attributes[i]).convertToMarshalledObject()); } }
/** * Marshal a unicast response to the given output stream. The * stream is flushed afterwards. * * @param str the stream to marshal to * @param reg the registrar object to marshal * @param groups the groups in which the registrar is currently a * member * @exception IOException a problem occurred during marshaling */ public static void marshal(OutputStream str, ServiceRegistrar reg, String[] groups) throws IOException { ObjectOutputStream ostr = new ObjectOutputStream(str); ostr.writeObject(new MarshalledInstance(reg).convertToMarshalledObject()); ostr.writeInt(groups.length); for (int i = 0; i < groups.length; i++) { ostr.writeUTF(groups[i]); } ostr.flush(); } }
/** When a registration is granted to a client, the client registers * a remote listener with the lookup discovery service so that the * lookup discovery service may send remote discovery events to the * client. The client typically annotates the listener with an RMI * codebase from which the backend server can download the remote * listener's proxy (stub). When the current registration is logged * to persistent storage (for example, a snapshot is taken), the * listener is written to the output snapshot or log file through * an <code>ObjectOutputStream</code> which only serializes the * listener; it does not marshal the listener. Thus, when the * listener field of this class is logged, unless special action * is taken, the codebase from which to retrieve the listener will * not be included in the output. * * In order to include the codebase with the listener when saving * state, the following custom <code>writeObject</code> method * is provided which first serializes the current instance of * this class (excluding the transient <code>listener</code> field), * and then explicitly marshals the listener to preserve the * codebase upon writing to the file. In this way, the listener -- * along with its codebase -- is persisted through a mechanism that * is separate from the normal mechanism applied to the remaining * fields of this class. */ private void writeObject(ObjectOutputStream stream) throws IOException{ stream.defaultWriteObject(); stream.writeObject(new MarshalledInstance(listener).convertToMarshalledObject()); }//end writeObject
new MarshalledInstance(attrs[i]).convertToMarshalledObject()); } catch(Throwable e) { if (RECOVERY_LOGGER.isLoggable(Levels.HANDLED)) {
new MarshalledInstance(attrs[i]).convertToMarshalledObject()); } catch(Throwable e) { if( problemLogger.isLoggable(Level.INFO) ) {
mReg = new MarshalledInstance(reg).convertToMarshalledObject(); } catch(IOException e) { continue nextReg; } //failed, next reg
for(int i=0;i<l;i++) { try { marshalledRegs.add(new MarshalledInstance(registrars[i]).convertToMarshalledObject()); (this.groups).put((registrars[i]).getServiceID(), groups.get(registrars[i]) );
public void handleUnicastDiscovery(UnicastResponse response, Socket socket, InvocationConstraints constraints, ClientSubjectChecker checker, Collection context) throws IOException { checkConstraints(constraints); if (checker != null) { checker.checkClientSubject(null); } // note: unicast request (the protocol version) already consumed // write LUS proxy ObjectOutputStream oout = new ObjectOutputStream( new BufferedOutputStream(socket.getOutputStream())); oout.writeObject( new MarshalledInstance( response.getRegistrar(), context).convertToMarshalledObject()); // write LUS member groups String[] groups = response.getGroups(); oout.writeInt(groups.length); for (int i = 0; i < groups.length; i++) { oout.writeUTF(groups[i]); } oout.flush(); if (logger.isLoggable(Level.FINEST)) { logger.log(Level.FINEST, "sent {0}", new Object[]{ response }); } }
/** * (Re)set the listener for this type of event. Any pending * events that have not yet been sent will be sent to the new * listener, passing the new handback. Setting the listener to * <code>null</code> will cancel the sending of all pending * events. * * @param listener the listener events of this type should go to * @param handback the object that should be passed to listener * as part of the event * @throws IOException if listener cannot be serialized */ public final synchronized void setListener(RemoteEventListener listener, MarshalledObject handback) throws IOException { registrationNumber++; if (listener == null) { clearListener(); } else { marshalledListener = new MarshalledInstance(listener).convertToMarshalledObject(); this.listener = listener; this.handback = handback; } }
ActiveEntry(Remote impl) throws ActivationException { this.impl = impl; try { Object proxy ; if (impl instanceof ProxyAccessor) { proxy = ((ProxyAccessor) impl).getProxy(); if (proxy == null) { throw new ActivationException( "ProxyAccessor.getProxy returned null"); } } else { proxy = impl; } this.mobj = new MarshalledInstance(proxy).convertToMarshalledObject(); } catch (IOException e) { throw new ActivationException( "failed to marshal remote object", e); } } }
new MarshalledInstance(ev).convertToMarshalledObject(); eout.reset(); eout.writeObject(mo);
configOptions); ActivationGroupData agd = new ActivationGroupData(groupConf); groupData = new MarshalledInstance(agd).convertToMarshalledObject(); outputHandler = (GroupOutputHandler) config.getEntry( PHOENIX, "groupOutputHandler", GroupOutputHandler.class,
proxy = RegistrarProxy.getInstance(myRef, myServiceID); MarshalledInstance proxyMarshalledInstance = new MarshalledInstance(proxy); proxyMarshalledObject = proxyMarshalledInstance.convertToMarshalledObject();