Package rocket.serialization.client

Examples of rocket.serialization.client.SerializationFactory


  public void executeRocketTests(final int elementCount, final int iterations) {
    try {
      logNewBenchmark(ROCKET);

      final SerializationFactory factory = (SerializationFactory) com.google.gwt.core.client.GWT
          .create(TestSerializationFactoryComposer.class);
      final Tree tree = this.createTree(elementCount);

      final String serializedForm = this.performRocketSerializationTimings(tree, factory, iterations);
      this.performRocketDeserializationTimings(factory, tree, serializedForm, iterations);
View Full Code Here


      throw runtime;
    }
  }

  void prepareRocketStream() {
    final SerializationFactory factory = this.getSerializationFactory();
    Object instance = this.getObject();

    log(ROCKET, "About to capture serialized instance for later deserialization.");

    final ObjectOutputStream objectOutputStream = factory.createObjectOutputStream();
    objectOutputStream.writeObject(instance);
    final String stream = objectOutputStream.getText();
    this.setRocketStream(stream);

    log(ROCKET, "Saved serialized instance [" + stream + "]");
View Full Code Here

    void sendBackLastResponse(AsyncCallback callback);
  }

  protected void performRocketSerializationTimings(final int iterations) {
    final SerializationFactory factory = this.getSerializationFactory();
    String serializedForm = null;
    Object instance = this.getObject();
    final long start = System.currentTimeMillis();

    log(ROCKET, "Starting of timing.");

    for (int i = 0; i < iterations; i++) {
      final ObjectOutputStream objectOutputStream = factory.createObjectOutputStream();
      objectOutputStream.writeObject(instance);
      serializedForm = objectOutputStream.getText();
    }
    final long end = System.currentTimeMillis();
View Full Code Here

    log(ROCKET, "End of timing.");
    logBenchmark(ROCKET, SERIALIZATION, iterations, start, end);
  }

  protected void performRocketDeserializationTimings(final int iterations) {
    final SerializationFactory factory = this.getSerializationFactory();
    Object reconstituted = null;

    log(ROCKET, "Starting of timing.");

    final String stream = this.getRocketStream();
    final long start = System.currentTimeMillis();

    for (int i = 0; i < iterations; i++) {
      final ObjectInputStream objectInputStream = factory.createObjectInputStream(stream);
      reconstituted = objectInputStream.readObject();
    }
    final long end = System.currentTimeMillis();

    log(ROCKET, "End of timing.");
View Full Code Here

        break;
      }
      final AsyncCallback<R> callback = this.getCallback();

      try {
        final SerializationFactory serializationFactory = this.getSerializationFactory();
        final String stream = response.getText();
        final ObjectInputStream objectInputStream = serializationFactory.createObjectInputStream(stream);
        final boolean exceptionWasThrown = objectInputStream.readBoolean();
        final Object result = objectInputStream.readObject();

        if (exceptionWasThrown) {
          callback.onFailure((Throwable) result);
View Full Code Here

TOP

Related Classes of rocket.serialization.client.SerializationFactory

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.