Package org.apache.wicket.serialize.java

Examples of org.apache.wicket.serialize.java.JavaSerializer


      {
        serializer = Application.get().getFrameworkSettings().getSerializer();
      }
      else
      {
        serializer = new JavaSerializer(WicketObjects.class.getName());
      }
      byte[] serialized = serializer.serialize(object);
      Object deserialized = serializer.deserialize(serialized);
      return (T) deserialized;
    }
View Full Code Here


      {
        serializer = Application.get().getFrameworkSettings().getSerializer();
      }
      else
      {
        serializer = new JavaSerializer(SerializingObjectSizeOfStrategy.class.getName());
      }
      byte[] serialized = serializer.serialize(object);
      int size = -1;
      if (serialized != null)
      {
View Full Code Here

   *
   * @param application
   */
  public FrameworkSettings(final Application application)
  {
    serializer = new JavaSerializer(application.getApplicationKey());
  }
View Full Code Here

   * keeps a reference to the Wicket Session.
   */
  @Test
  public void serializingTheSession()
  {
    JavaSerializer serializer = new JavaSerializer("JavaSerializerTest")
    {
      @Override
      protected ObjectOutputStream newObjectOutputStream(OutputStream out) throws IOException
      {
        IObjectChecker checker = new SessionChecker();
        return new CheckingObjectOutputStream(out, checker);
      }
    };

    WebComponent component = new ComponentWithAReferenceToTheSession("id");
    byte[] serialized = serializer.serialize(component);
    assertNull("The produced byte[] must be null if there was an error", serialized);
  }
View Full Code Here

   * keeps a reference to a page which is not component.getPage()..
   */
  @Test
  public void serializingAnotherPage()
  {
    JavaSerializer serializer = new JavaSerializer("JavaSerializerTest")
    {
      @Override
      protected ObjectOutputStream newObjectOutputStream(OutputStream out) throws IOException
      {
        IObjectChecker checker = new DifferentPageChecker();
        return new CheckingObjectOutputStream(out, checker);
      }
    };

    WebComponent component = new ComponentThatKeepsAReferenceToAnotherPage(MockPageWithLink.LINK_ID);
    MockPageWithLink rootPage = new MockPageWithLink();
    rootPage.add(component);
    byte[] serialized = serializer.serialize(rootPage);
    assertNull("The produced byte[] must be null if there was an error", serialized);
  }
View Full Code Here

      {
        serializer = Application.get().getFrameworkSettings().getSerializer();
      }
      else
      {
        serializer = new JavaSerializer("SerializingObjectSizeOfStrategy");
      }
      byte[] serialized = serializer.serialize(object);
      int size = -1;
      if (serialized != null)
      {
View Full Code Here

      {
        serializer = Application.get().getFrameworkSettings().getSerializer();
      }
      else
      {
        serializer = new JavaSerializer("SerializingObjectSizeOfStrategy");
      }
      byte[] serialized = serializer.serialize(object);
      int size = -1;
      if (serialized != null)
      {
View Full Code Here

        return new IPageManagerProvider()
        {
          @Override
          public IPageManager get(IPageManagerContext pageManagerContext)
          {
            IPageStore pageStore = new DefaultPageStore(new JavaSerializer(
              application.getApplicationKey()), dataStore, 4);
            return new PageStoreManager(application.getName(), pageStore,
              pageManagerContext);
          }
        };
View Full Code Here

   */
  public TestMapperContext()
  {
    appName = APP_NAME + count++;
    dataStore = new InMemoryPageStore();
    pageStore = new DefaultPageStore(new JavaSerializer(appName), dataStore, 4);
    pageManagerContext = new DummyPageManagerContext();
    pageManager = new PageStoreManager(appName, pageStore, pageManagerContext);
  }
View Full Code Here

    // destroy the manager and the store
    pageManager.destroy();

    // simulate persisting of the http sessions initiated by the web container
    byte[] serializedSessionEntry = new JavaSerializer(APP_NAME).serialize(sessionEntry);
    assertNotNull("Wicket needs to be able to serialize the session entry",
      serializedSessionEntry);

    // simulate loading of the persisted http session initiated by the web container
    // when starting an application
View Full Code Here

TOP

Related Classes of org.apache.wicket.serialize.java.JavaSerializer

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.