Package net.jini.io

Examples of net.jini.io.MarshalOutputStream


       
        outputHandler.handleOutput(id, desc, incarnation,
                 groupName,
                 child.getInputStream(),
                 child.getErrorStream());
        MarshalOutputStream out =
      new MarshalOutputStream(child.getOutputStream(),
            Collections.EMPTY_LIST);
        out.writeObject(id);
        ActivationGroupDesc gd = desc;
        if (gd.getClassName() == null) {
      MarshalledObject data = gd.getData();
      if (data == null) {
          data = groupData;
      }
      String loc = gd.getLocation();
      if (loc == null) {
          loc = groupLocation;
      }
      gd = new ActivationGroupDesc(
        "com.sun.jini.phoenix.ActivationGroupImpl",
        loc,
        data,
        gd.getPropertyOverrides(),
        gd.getCommandEnvironment());
        }
        out.writeObject(gd);
        out.writeLong(incarnation);
        out.flush();
        out.close();
       
    } catch (Exception e) {
        terminate();
        if (e instanceof ActivationException) {
      throw (ActivationException) e;
View Full Code Here


 
  public void snapshot(OutputStream out) throws Exception {
      if (state == null) {
    state = new Activation();
      }
      MarshalOutputStream s =
    new MarshalOutputStream(out, Collections.EMPTY_LIST);
      s.writeObject(state);
      s.flush();
  }
View Full Code Here

  }

  public void writeUpdate(OutputStream out, Object value)
      throws Exception
  {
      MarshalOutputStream s =
    new MarshalOutputStream(out, Collections.EMPTY_LIST);
      s.writeObject(value);
      s.flush();
  }
View Full Code Here

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

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

            // Write a File object to MarshalOutputStream

            ArrayList context = new ArrayList();
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            MarshalOutputStream output = new FakeMarshalOutputStream(
                baos,context,"http://foo.bar");
            output.writeObject(new File("test case " + (i+1)));
            output.close();

            // Attempt to read from MarshalInputStream

            ByteArrayInputStream bios = new ByteArrayInputStream(
                baos.toByteArray());
View Full Code Here

    public void setup(QAConfig sysConfig) throws Exception {
        original = System.getSecurityManager();
    }

    public void run() throws Exception {
        MarshalOutputStream stream;
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ArrayList al = new ArrayList();
        PipedOutputStream pos = new PipedOutputStream();

        logger.log(Level.FINE,"=================================");
        logger.log(Level.FINE,"test case 1: "
            + "MarshalOutputStream(null,null)");
        logger.log(Level.FINE,"");

        try {
            stream = new MarshalOutputStream(null,null);
            assertion(false);
        } catch (NullPointerException ignore) {
        }

        logger.log(Level.FINE,"=================================");
        logger.log(Level.FINE,"test case 2: "
            + "MarshalOutputStream(OutputStream,null)");
        logger.log(Level.FINE,"");

        try {
            stream = new MarshalOutputStream(baos,null);
            assertion(false);
        } catch (NullPointerException ignore) {
        }

        logger.log(Level.FINE,"=================================");
        logger.log(Level.FINE,"test case 3: "
            + "MarshalOutputStream(null,Collection)");
        logger.log(Level.FINE,"");

        try {
            stream = new MarshalOutputStream(null,al);
            assertion(false);
        } catch (NullPointerException ignore) {
        }

        logger.log(Level.FINE,"=================================");
        logger.log(Level.FINE,"test case 4: "
            + "getObjectStreamContext method returns constructor arg");
        logger.log(Level.FINE,"");

        stream = new MarshalOutputStream(baos,al);
        assertion(stream.getObjectStreamContext() == al);

        logger.log(Level.FINE,"=================================");
        logger.log(Level.FINE,"test case 5: "
            + "constructor throws IOException");
        logger.log(Level.FINE,"");

        try {
            stream = new MarshalOutputStream(pos,al);
            assertion(false);
        } catch (IOException ignore) {
        }

        logger.log(Level.FINE,"=================================");
View Full Code Here

            // Write transferObject to MarshalOutputStream

            ArrayList context = new ArrayList();
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            MarshalOutputStream output = new FakeMarshalOutputStream(
                baos,context,writeAnnotationReturnVal);
            output.writeObject(transferObject);
            output.close();

            // Read transferObject from MarshalInputStream

            // Verifier shouldn't be called (so throw an exception if
            // it is) under the following conditions:
View Full Code Here

    }

    // inherit javadoc
    public void run() throws Exception {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        MarshalOutputStream output =
            new MarshalOutputStream(baos,new ArrayList());
        FakeMarshalInputStream input = new FakeMarshalInputStream(
            new ByteArrayInputStream(baos.toByteArray()),null,null);

        logger.log(Level.FINE,"=================================");
        logger.log(Level.FINE,"test case 1: resolveClass(null)");
View Full Code Here

            logger.log(Level.FINE,"");

            // Write transferObject to MarshalOutputStream
            ArrayList context = new ArrayList();
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            MarshalOutputStream output =
                new MarshalOutputStream(baos,context);
            output.writeObject(transferObject);
            output.close();

            // Read transferObject from MarshalInputStream
            ByteArrayInputStream bios =
                new ByteArrayInputStream(baos.toByteArray());
            MarshalInputStream input = new FakeMarshalInputStream(
View Full Code Here

TOP

Related Classes of net.jini.io.MarshalOutputStream

Copyright © 2018 www.massapicom. 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.