Examples of MarshalOutputStream


Examples of com.sun.corba.se.impl.encoding.MarshalOutputStream

    public String stringify()
    {
        StringWriter bs;

        MarshalOutputStream s =
            sun.corba.OutputStreamFactory.newEncapsOutputStream(factory);
        s.putEndian();
        write( (OutputStream)s );
        bs = new StringWriter();
        try {
            s.writeTo(new HexOutputStream(bs));
        } catch (IOException ex) {
            throw wrapper.stringifyWriteError( ex ) ;
        }

        return ORBConstants.STRINGIFY_PREFIX + bs;
View Full Code Here

Examples of com.sun.corba.se.impl.encoding.MarshalOutputStream

        try {
            MarshalInputStream is = (MarshalInputStream)
                request.getInputObject();
            String method = request.getOperationName();
            response = request.getProtocolHandler().createResponse(request, null);
            MarshalOutputStream os = (MarshalOutputStream)
                response.getOutputObject();

            if (method.equals("get")) {
                // Get the name of the requested service
                String serviceKey = is.read_string();

                // Look it up
                org.omg.CORBA.Object serviceObject =
                    orb.getLocalResolver().resolve( serviceKey ) ;

                // Write reply value
                os.write_Object(serviceObject);
            } else if (method.equals("list")) {
                java.util.Set keys = orb.getLocalResolver().list() ;
                os.write_long( keys.size() ) ;
                Iterator iter = keys.iterator() ;
                while (iter.hasNext()) {
                    String obj = (String)iter.next() ;
                    os.write_string( obj ) ;
                }
            } else {
                throw wrapper.illegalBootstrapOperation( method ) ;
            }
View Full Code Here

Examples of com.sun.corba.se.impl.encoding.MarshalOutputStream

        try {
            MarshalInputStream is = (MarshalInputStream)
                request.getInputObject();
            String method = request.getOperationName();
            response = request.getProtocolHandler().createResponse(request, null);
            MarshalOutputStream os = (MarshalOutputStream)
                response.getOutputObject();

            if (method.equals("get")) {
                // Get the name of the requested service
                String serviceKey = is.read_string();

                // Look it up
                org.omg.CORBA.Object serviceObject =
                    orb.getLocalResolver().resolve( serviceKey ) ;

                // Write reply value
                os.write_Object(serviceObject);
            } else if (method.equals("list")) {
                java.util.Set keys = orb.getLocalResolver().list() ;
                os.write_long( keys.size() ) ;
                Iterator iter = keys.iterator() ;
                while (iter.hasNext()) {
                    String obj = (String)iter.next() ;
                    os.write_string( obj ) ;
                }
            } else {
                throw wrapper.illegalBootstrapOperation( method ) ;
            }
View Full Code Here

Examples of com.sun.corba.se.impl.encoding.MarshalOutputStream

    public String stringify()
    {
        StringWriter bs;

        MarshalOutputStream s = new EncapsOutputStream(factory);
        s.putEndian();
        write( (OutputStream)s );
        bs = new StringWriter();
        try {
            s.writeTo(new HexOutputStream(bs));
        } catch (IOException ex) {
            throw wrapper.stringifyWriteError( ex ) ;
        }

        return ORBConstants.STRINGIFY_PREFIX + bs;
View Full Code Here

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

Examples of net.jini.io.MarshalOutputStream

 
  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

Examples of net.jini.io.MarshalOutputStream

  }

  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

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

  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

Examples of net.jini.io.MarshalOutputStream

            // 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
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.