Package org.jboss.serial.objectmetamodel

Examples of org.jboss.serial.objectmetamodel.DataContainer


    }

    public Object readObjectOverride() throws IOException,
            ClassNotFoundException
    {
        DataContainer container = new DataContainer(classLoader,this.getSubstitutionInterface(), false,buffer,classDescriptorStrategy,objectDescriptorStrategy);
        container.setClassResolver(resolver);
        //container.loadData(dis);
        //ObjectInput input = container.getInput();
        ObjectInput input = container.getDirectInput(dis);
        return input.readObject();
    }
View Full Code Here


  }

  private void checkOutput() throws IOException {
    if (objectOutput==null)
    {
          dataContainer = new DataContainer(null,this.getSubstitutionInterface(),checkSerializableClass,buffer,classDescriptorStrategy, objectDescriptorStrategy);
          if (output instanceof DataOutputStream)
          {
              dataOutput = (DataOutputStream) output;
          }
          else
View Full Code Here

  }

  public Object readObjectOverride() throws IOException, ClassNotFoundException {
    if (input==null)
    {
          container = new DataContainer(classLoader,getSubstitutionInterface(), false,buffer,classDescriptorStrategy, objectDescriptorStrategy);
          container.setClassResolver(resolver);
          input = container.getDirectInput(dis);
    }
        return input.readObject();
  }
View Full Code Here

   {
   }

   public LocalMarshalledValue(Object obj) throws IOException
   {
      container = new DataContainer(false);
      ObjectOutput output = container.getOutput();
      output.writeObject(obj);
      output.flush();
      container.flush();
   }
View Full Code Here

      container.flush();
   }

   public LocalMarshalledValue(Object obj, SafeCloningRepository safeToReuse) throws IOException
   {
      container = new DataContainer(null, null, safeToReuse, false);
      ObjectOutput output = container.getOutput();
      output.writeObject(obj);
      output.flush();
      container.flush();
   }
View Full Code Here

      log.warn("LocalmarshalledValue readExternal is deprecated. This version is best used on call-by-value operations");
      byte[] bytes = new byte[in.readInt()];
      in.readFully(bytes);
      ByteArrayInputStream byteInput = new ByteArrayInputStream(bytes);
      DataInputStream input = new DataInputStream(byteInput);
      container = new DataContainer(false);
      container.loadData(input);
   }
View Full Code Here

  }
 
  // do not change these testcases as they test the interface used by JBossRemoting
    private void doTestJBossDataContainer(Object dataObject) throws Exception
    {
        DataContainer container = new DataContainer(false);
        ObjectOutput output = container.getOutput();
        output.writeObject(dataObject);
        output.flush();
        container.flush();
       
        container.getCache().setLoader(Thread.currentThread().getContextClassLoader());
        Object newObject = container.getInput().readObject();
        if (!(dataObject instanceof String) && !(dataObject instanceof String[]))
        {
          assertNotSame(dataObject,newObject);
            assertEquals(dataObject,newObject);
        }
View Full Code Here

      }
      };
     
      SafeCloningRepository safeToReuse = new SafeCloningRepository(safeClone);
     
      DataContainer container = new DataContainer(null, null, safeToReuse, false);
        ObjectOutput output = container.getOutput();
        output.writeObject(dataObject);
        output.flush();
        container.flush();
       
        container.getCache().setLoader(Thread.currentThread().getContextClassLoader());
        Object newObject = container.getInput().readObject();
        if (!(dataObject instanceof String) && !(dataObject instanceof String[]))
        {
          assertEquals(dataObject,newObject);
            assertNotSame(dataObject,newObject);
        }
View Full Code Here

    if (dataObject instanceof String || dataObject instanceof String[] || dataObject instanceof TestReadResolve)
    {
      return;
    }
    System.out.println("Testing " + dataObject.getClass().getName());
      DataContainer container = new DataContainer(null, null, null, false);
        ObjectOutput output = container.getOutput();
        output.writeObject(dataObject);
        output.flush();
        container.flush();
       
       
        TestThread threads[] = new TestThread[100];
        for (int i=0;i<threads.length;i++)
        {
            ObjectInput input = container.getInput();
            Object newObject = input.readObject();
            assertNotSame(dataObject, newObject);
            assertEquals(dataObject,newObject);

            threads[i] = new TestThread(container.cloneContainer(),newObject);
        }
       
        for (int i=0;i<threads.length;i++)
        {
          threads[i].start();
View Full Code Here

            {

                if (useJRunit) ThreadLocalBenchmark.openBench(myTest.getClass().getName(),metaData);
                original = System.currentTimeMillis();
            }
            DataContainer container = new DataContainer(false,buffer);
            ObjectOutput out = container.getOutput();
            out.writeObject(myTest);
            container.flush();

            ObjectInput input = container.getInput();

            Object value = input.readObject();

            if (!(myTest instanceof String[]))
              {
View Full Code Here

TOP

Related Classes of org.jboss.serial.objectmetamodel.DataContainer

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.