Package org.impalaframework.util.serialize

Examples of org.impalaframework.util.serialize.SerializationHelper


                logger.warn("Object in session under key [" + name + "] is not compatible with the current class loader, and cannot be recovered because it does not implement " + Serializable.class.getName() + ". Attribute will be removed from the session");
                this.removeAttribute(name);
                return null;
            }
           
            SerializationHelper helper = new SerializationHelper(new ClassLoaderAwareSerializationStreamFactory(moduleClassLoader));
           
            Object clonedAttribute = null;
            try {
                clonedAttribute = clone(attribute, helper);
            } catch (RuntimeException e) {
View Full Code Here


        logger.warn("Object in session under key [" + name + "] is not compatible with the current class loader, and cannot be recovered because it does not implement " + Serializable.class.getName() + ". Attribute will be removed from the session");
        this.removeAttribute(name);
        return null;
      }
     
      SerializationHelper helper = new SerializationHelper(new ClassLoaderAwareSerializationStreamFactory(moduleClassLoader));
     
      Object clonedAttribute = null;
      try {
        clonedAttribute = clone(attribute, helper);
      } catch (RuntimeException e) {
View Full Code Here

  }

  Object clone(Object o) {
    final BundleDelegatingClassLoader classLoader = BundleDelegatingClassLoader.createBundleClassLoaderFor(bundleContext.getBundle());
    final SerializationStreamFactory streamFactory = newStreamFactory(classLoader);
    SerializationHelper helper = new SerializationHelper(streamFactory);
    final Object clone = helper.clone((Serializable) o);
    return clone;
  }
View Full Code Here

    }

    Object clone(Object o) {
        final BundleDelegatingClassLoader classLoader = BundleDelegatingClassLoader.createBundleClassLoaderFor(bundleContext.getBundle());
        final SerializationStreamFactory streamFactory = newStreamFactory(classLoader);
        SerializationHelper helper = new SerializationHelper(streamFactory);
        final Object clone = helper.clone((Serializable) o);
        return clone;
    }
View Full Code Here

  }

  Object clone(Object o) {
    final BundleDelegatingClassLoader classLoader = BundleDelegatingClassLoader.createBundleClassLoaderFor(bundleContext.getBundle());
    final SerializationStreamFactory streamFactory = newStreamFactory(classLoader);
    SerializationHelper helper = new SerializationHelper(streamFactory);
    final Object clone = helper.clone((Serializable) o);
    return clone;
  }
View Full Code Here

                logger.warn("Object in session under key [" + name + "] is not compatible with the current class loader, and cannot be recovered because it does not implement " + Serializable.class.getName() + ". Attribute will be removed from the session");
                this.removeAttribute(name);
                return null;
            }
           
            SerializationHelper helper = new SerializationHelper(new ClassLoaderAwareSerializationStreamFactory(moduleClassLoader));
           
            Object clonedAttribute = null;
            try {
                clonedAttribute = clone(attribute, helper);
            } catch (RuntimeException e) {
View Full Code Here

        logger.warn("Object in session under key [" + name + "] is not compatible with the current class loader, and cannot be recovered because it does not implement " + Serializable.class.getName() + ". Attribute will be removed from the session");
        this.removeAttribute(name);
        return null;
      }
     
      SerializationHelper helper = new SerializationHelper(new ClassLoaderAwareSerializationStreamFactory(moduleClassLoader));
     
      Object clonedAttribute = null;
      try {
        clonedAttribute = clone(attribute, helper);
      } catch (RuntimeException e) {
View Full Code Here

    public void testGetAttributeWrappingSerializableValueHolder() {
        //test the case where the classloader is compatible
       
        session = createMock(HttpSession.class);
        SerializableValueHolder valueHolder = new SerializableValueHolder();
        SerializationHelper helper = new SerializationHelper(new ClassLoaderAwareSerializationStreamFactory(newModuleClassLoader()));
       
        Object clonedObject = helper.clone(valueHolder);
        expect(session.getAttribute("myAttribute")).andReturn(clonedObject);
        session.setAttribute(eq("myAttribute"), EasyMock.anyObject());
       
        replay(session);
View Full Code Here

    public void testGetAttributeWrappingWithFailedSerialization() {
        //test the case where the classloader is compatible
       
        session = createMock(HttpSession.class);
        SerializableValueHolder valueHolder = new SerializableValueHolder();
        SerializationHelper helper = new SerializationHelper(new ClassLoaderAwareSerializationStreamFactory(newModuleClassLoader()));
       
        Object clonedObject = helper.clone(valueHolder);
        expect(session.getAttribute("myAttribute")).andReturn(clonedObject);
        session.removeAttribute("myAttribute");
       
        replay(session);
View Full Code Here

       
        PropertySourceHolder.getInstance().setPropertySource(source);
       
        session = createMock(HttpSession.class);
        SerializableValueHolder valueHolder = new SerializableValueHolder();
        SerializationHelper helper = new SerializationHelper(new ClassLoaderAwareSerializationStreamFactory(newModuleClassLoader()));
       
        Object clonedObject = helper.clone(valueHolder);
        expect(session.getAttribute("myAttribute")).andReturn(clonedObject);
       
        //note the call to invalidate
        session.invalidate();
       
View Full Code Here

TOP

Related Classes of org.impalaframework.util.serialize.SerializationHelper

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.