Examples of MarshalOutputStream


Examples of net.jini.io.MarshalOutputStream

  if (impl == null) {
      throw new NullPointerException();
  }
  OutputStream out = request.getResponseOutputStream();
  Collection unmodContext = Collections.unmodifiableCollection(context);
  return new MarshalOutputStream(out, unmodContext);
    }
View Full Code Here

Examples of net.jini.io.MarshalOutputStream

        // write integrity yes/no
        requestOutput.write(secondRequestByte);

        // wrap requestOutput stream in a MarshalOutputStream
        MarshalOutputStream marshalledRequest = new MarshalOutputStream(
            requestOutput, new ArrayList());

        // write method hash
        marshalledRequest.writeLong(methodHash);

        // write method args
        if (methodArgs != null) {
            for (int i = 0; i < methodArgs.length; i++) {
                Util.marshalValue(methodArgs[i],marshalledRequest);
            }
        }
        marshalledRequest.close();

        requestInput = new ByteArrayInputStream(requestOutput.toByteArray());
    }
View Full Code Here

Examples of net.jini.io.MarshalOutputStream

        // write status byte
        responseOutput.write(firstResponseByte);
        // wrap responseOutput stream in a MarshalOutputStream
        MarshalOutputStream marshalledResponse = new MarshalOutputStream(
            responseOutput, new ArrayList());
        // write returnValue to response stream
        Util.marshalValue(returnValue, marshalledResponse);

        marshalledResponse.close();
        responseInput = new ByteArrayInputStream(responseOutput.toByteArray());
    }
View Full Code Here

Examples of sun.rmi.server.MarshalOutputStream

    //Write message type
    log.log (Level.FINEST, "Writing return header");
    out.writeByte (TransportConstants.Return);

    MarshalOutputStream objOut = new MarshalOutputStream (out);

    //Write return header
    objOut.writeByte (TransportConstants.NormalReturn);
    uid.write (objOut);
   
    //Write a stub that points back to this port
    log.log (Level.FINEST, "Writing new stub");
    /* This used to write out a new stub, but since I've removed the stub code
     * from the source base, I'm just writing out null here so I can get it to
     * compile.  This won't work, but this class has been deprecated, so I don't
     * really care. */
    objOut.writeObject (null);

    objOut.flush ();
   
    log.exiting ("com.sun.grid.jgrid.proxy.ComputeProxy", "processLookupCall");
  }
View Full Code Here

Examples of sun.rmi.server.MarshalOutputStream

    //Write message type
    log.log (Level.FINEST, "Writing return header");
    out.writeByte (TransportConstants.Return);

    MarshalOutputStream objOut = new MarshalOutputStream (out);

    //Write message header
    objOut.writeByte (TransportConstants.NormalReturn);
    uid.write (objOut);
   
    /* We don't do anything with this call because we don't have any actual
     * objects to keep track of. */

    objOut.flush ();
   
    log.exiting ("com.sun.grid.jgrid.proxy.ComputeProxy", "processCleanCall");
  }
View Full Code Here

Examples of sun.rmi.server.MarshalOutputStream

    //Write message type
    log.log (Level.FINEST, "Writing return header");
    out.writeByte (TransportConstants.Return);

    MarshalOutputStream objOut = new MarshalOutputStream (out);

    //Write message header
    objOut.writeByte (TransportConstants.NormalReturn);
    uid.write (objOut);

    //If the lease we were passed has a valid VM ID, write it
    if (lease.getVMID () != null) {
      log.log (Level.FINEST, "Writing old lease object");
      objOut.writeObject (lease);
    }
    //If not, create a valid lease and write it
    else {
      log.log (Level.FINEST, "Writing new lease object");
      objOut.writeObject (new Lease (new VMID (), lease.getValue ()));
    }

    objOut.flush ();
   
    log.exiting ("com.sun.grid.jgrid.proxy.ComputeProxy", "processDirtyCall");
  }
View Full Code Here

Examples of sun.rmi.server.MarshalOutputStream

    //Write message type
    log.log (Level.FINEST, "Writing return header");
    out.writeByte (TransportConstants.Return);

    MarshalOutputStream objOut = new MarshalOutputStream (out);

    //Write message header
    if (returnValue instanceof Throwable) {
      log.log (Level.FINER, "Exceptional return");
      objOut.writeByte (TransportConstants.ExceptionalReturn);

      //If the exception is a RemoteException, wrap it in a RemoteException
      if (!(returnValue instanceof RemoteException)) {
        log.log (Level.FINEST, "Wrapping exception in RemoteException");
        returnValue = new RemoteException ("An error occured while processing the Computable object", (Throwable)returnValue);
      }
    }
    else {
      log.log (Level.FINER, "Normal return");
      objOut.writeByte (TransportConstants.NormalReturn);
    }

    uid.write (objOut);
   
    //Write results
    log.log (Level.FINEST, "Writing results");
    objOut.writeObject (returnValue);

    objOut.flush ();
   
    log.exiting ("com.sun.grid.jgrid.proxy.ComputeProxy", "processComputeCall");
  }
View Full Code Here

Examples of sun.rmi.server.MarshalOutputStream

   
    //Write message type
    log.log (Level.FINEST, "Writing return header");
    out.writeByte (TransportConstants.Return);

    MarshalOutputStream objOut = new MarshalOutputStream (out);

    //Write message header
    objOut.writeByte (TransportConstants.NormalReturn);
    uid.write (objOut);
   
    //Write results
    log.log (Level.FINEST, "Writing results");
    if (lock instanceof Lock) {
      log.log (Level.FINE, "Process is not complete");
      objOut.writeObject (null);
    }
    else {
      log.log (Level.FINE, "Process is complete");
      objOut.writeObject (lock);
      lockbox.remove (id);
    }
   
    objOut.flush ();

    log.log (Level.FINER, "Deleting job file");
    this.deleteJob (id);
   
    log.exiting ("com.sun.grid.jgrid.proxy.ComputeProxy", "processGetResultsCall");
View Full Code Here

Examples of sun.rmi.server.MarshalOutputStream

   
    //Write message type
    log.log (Level.FINEST, "Writing return header");
    out.writeByte (TransportConstants.Return);

    MarshalOutputStream objOut = new MarshalOutputStream (out);

    //Write message header
    objOut.writeByte (TransportConstants.NormalReturn);
    uid.write (objOut);
   
    //Write results
    log.log (Level.FINEST, "Writing results");
    if (lock instanceof Lock) {
      log.log (Level.FINE, "Process is not complete");
      objOut.writeBoolean (false);
    }
    else {
      log.log (Level.FINE, "Process is complete");
      objOut.writeBoolean (true);
    }
   
    objOut.flush ();
   
    log.exiting ("com.sun.grid.jgrid.proxy.ComputeProxy", "processIsCompleteCall");
  }
View Full Code Here

Examples of sun.rmi.server.MarshalOutputStream

     * @param value the snapshot
     * @exception Exception can raise any exception
     */
    public
    void snapshot(OutputStream out, Object value) throws Exception {
        MarshalOutputStream s = new MarshalOutputStream(out);
        s.writeObject(value);
        s.flush();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.