Package net.jini.io

Examples of net.jini.io.MarshalInputStream.readObject()


      MarshalInputStream s =
    new MarshalInputStream(in,
               ActLogHandler.class.getClassLoader(),
               false, null, Collections.EMPTY_LIST);
      s.useCodebaseAnnotations();
      state = (Activation) s.readObject();
  }

  public void writeUpdate(OutputStream out, Object value)
      throws Exception
  {
View Full Code Here


      MarshalInputStream  s =
    new MarshalInputStream(in,
               ActLogHandler.class.getClassLoader(),
               false, null, Collections.EMPTY_LIST);
      s.useCodebaseAnnotations();
      applyUpdate(s.readObject());
  }

  public void applyUpdate(Object update) throws Exception {
      ((LogRecord) update).apply(state);
  }
View Full Code Here

                bios,readAnnotationException,null);

            // verify result

            try {
                System.out.println("readObject: " + input.readObject());
                throw new AssertionError("readObject() call should fail");
            } catch (Throwable caught) {
                assertion(readAnnotationException.equals(caught),
                    caught.toString());
            }
View Full Code Here

            // verify result

            if (shouldThrowException) {
                try {
                    input.readObject();
                    assertion(false);
                } catch (ClassNotFoundException ignore) { }
            } else {
                if (transferObject instanceof Proxy) {
                    // can't .equals written and read Proxy classes
View Full Code Here

                } catch (ClassNotFoundException ignore) { }
            } else {
                if (transferObject instanceof Proxy) {
                    // can't .equals written and read Proxy classes
                    // since they are defined in different class loaders
                    Object received = input.readObject();
                    assertion(received instanceof Proxy);
                    Class[] rClasses =
                        received.getClass().getInterfaces();
                    Class[] tClasses =
                        transferObject.getClass().getInterfaces();
View Full Code Here

                    for (int j = 0; j < rClasses.length; j++) {
                        assertion(rClasses[j].getName().equals(
                            tClasses[j].getName()));
                    }
                } else {
                    assertion(transferObject.equals(input.readObject()));
                }
            }
        }
    }
View Full Code Here

                    null);
            }

            // verify result
            try {
                input.readObject();
                throw new TestException("should have never reached here");
            } catch (Throwable caught) {
                if (loadClassException instanceof
                    ClassNotFoundException)
                {
View Full Code Here

                null,
                transferObject.getName(),
                null);

            // verify result
            assertion(input.readObject() == transferObject);
        }
    }

    // inherit javadoc
    public void tearDown() {
View Full Code Here

  MarshalInputStream in =
      new MarshalInputStream(new ByteArrayInputStream(bytes),
           ClassLoader.getSystemClassLoader(),
           false, null, new HashSet());
  ActivatableInvocationHandler aihRead =
      (ActivatableInvocationHandler) in.readObject();
  System.err.println("Test 1 passed: handler read successfully");

  /*
   * Set constraints on underlying proxy to make
   * them inconsistent with handler's constraints, then
View Full Code Here

  try {
      in =
    new MarshalInputStream(new ByteArrayInputStream(bytes),
               ClassLoader.getSystemClassLoader(),
               false, null, new HashSet());
      aihRead = (ActivatableInvocationHandler) in.readObject();
      System.err.println("Test 2 failed: no InvalidObjectException");
      throw new RuntimeException(
    "Test 2 failed: no InvalidObjectException");
  } catch (InvalidObjectException e) {
      System.err.println(
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.