Examples of SimpleCachableMarshalledValue


Examples of org.jboss.ha.framework.server.SimpleCachableMarshalledValue

      // Swap in/out the tcl for this web app. Needed only for un marshalling.
      ClassLoader prevTCL = Thread.currentThread().getContextClassLoader();
      Thread.currentThread().setContextClassLoader(webAppClassLoader_);
      try
      {
         SimpleCachableMarshalledValue mv = (SimpleCachableMarshalledValue) obj;
         mv.setObjectStreamSource(SessionSerializationFactory.getObjectStreamSource());
         return mv.get();
      }
      catch (IOException e)
      {
         log_.error("IOException occurred unmarshalling value ", e);
         return null;
View Full Code Here

Examples of org.jboss.ha.framework.server.SimpleCachableMarshalledValue

       }
   }
  
   public static SimpleCachableMarshalledValue createMarshalledValue(Serializable o)
   {
      return new SimpleCachableMarshalledValue(o, objectStreamSource);
   }
View Full Code Here

Examples of org.jboss.ha.framework.server.SimpleCachableMarshalledValue

      try
      {
         switcher = getContextClassLoaderSwitcher().getSwitchContext();
         switcher.setClassLoader(webAppClassLoader_);
        
         SimpleCachableMarshalledValue mv = (SimpleCachableMarshalledValue) obj;
         mv.setObjectStreamSource(SessionSerializationFactory.getObjectStreamSource());
         return mv.get();
      }
      finally
      {
         if (switcher != null)
         {
View Full Code Here

Examples of org.jboss.ha.framework.server.SimpleCachableMarshalledValue

      try
      {
         switcher = getContextClassLoaderSwitcher().getSwitchContext();
         switcher.setClassLoader(webAppClassLoader_);
        
         SimpleCachableMarshalledValue mv = (SimpleCachableMarshalledValue) obj;
         mv.setObjectStreamSource(SessionSerializationFactory.getObjectStreamSource());
         return mv.get();
      }
      finally
      {
         if (switcher != null)
         {
View Full Code Here

Examples of org.jboss.ha.framework.server.SimpleCachableMarshalledValue

         }
         else
         {
            try
            {
               return new SimpleCachableMarshalledValue((Serializable) value, SessionSerializationFactory.getObjectStreamSource(), true);
            }
            catch (ClassCastException e)
            {
               throw new IllegalArgumentException(value + " does not implement java.io.Serializable");
            }
View Full Code Here

Examples of org.jboss.ha.framework.server.SimpleCachableMarshalledValue

      try
      {
         switcher = getContextClassLoaderSwitcher().getSwitchContext();
         switcher.setClassLoader(webAppClassLoader_);
        
         SimpleCachableMarshalledValue mv = (SimpleCachableMarshalledValue) obj;
         mv.setObjectStreamSource(SessionSerializationFactory.getObjectStreamSource());
         return mv.get();
      }
      finally
      {
         if (switcher != null)
         {
View Full Code Here

Examples of org.jboss.ha.framework.server.SimpleCachableMarshalledValue

      try
      {
         switcher = getContextClassLoaderSwitcher().getSwitchContext();
         switcher.setClassLoader(webAppClassLoader_);
        
         SimpleCachableMarshalledValue mv = (SimpleCachableMarshalledValue) obj;
         mv.setObjectStreamSource(SessionSerializationFactory.getObjectStreamSource());
         return mv.get();
      }
      finally
      {
         if (switcher != null)
         {
View Full Code Here

Examples of org.jboss.ha.framework.server.SimpleCachableMarshalledValue

   }
  
   public void testReplication() throws Exception
   {
      GUID guid = new GUID();
      SimpleCachableMarshalledValue mv = new SimpleCachableMarshalledValue(guid);
     
      SimpleCachableMarshalledValue copy = replicate(mv);
      assertNull(copy.peekUnderlyingObject());
      byte[] serialized = copy.peekSerializedForm();
      assertNotNull(serialized);
     
      assertNull(mv.peekSerializedForm());
      assertSame(guid, mv.peekUnderlyingObject());
     
View Full Code Here

Examples of org.jboss.ha.framework.server.SimpleCachableMarshalledValue

    * Test method for {@link org.jboss.ha.framework.server.SimpleCachableMarshalledValue#get()}.
    */
   public void testGet() throws Exception
   {
      GUID guid = new GUID();
      SimpleCachableMarshalledValue mv = new SimpleCachableMarshalledValue(guid);
     
      assertSame(guid, mv.get());
     
      SimpleCachableMarshalledValue copy = replicate(mv);
     
      Object guid2 =  copy.get();
      assertNotSame(guid, guid2);
      assertEquals(guid, guid2);
     
      copy.toByteArray();
      SimpleCachableMarshalledValue triplet = replicate(copy);
      guid2 = triplet.get();
      assertEquals(guid, guid2);
     
      mv = new SimpleCachableMarshalledValue(null);
      assertNull(mv.get());
   }
View Full Code Here

Examples of org.jboss.ha.framework.server.SimpleCachableMarshalledValue

    * Test method for {@link org.jboss.ha.framework.server.SimpleCachableMarshalledValue#toByteArray()}.
    */
   public void testToByteArray() throws Exception
   {
      GUID guid = new GUID();
      SimpleCachableMarshalledValue mv = new SimpleCachableMarshalledValue(guid);
     
      assertNull(mv.peekSerializedForm());
     
      byte[] bytes = mv.toByteArray();
     
      assertNull(mv.peekUnderlyingObject());
     
      assertSame(bytes, mv.peekSerializedForm());
     
      byte[] bytes2 = mv.toByteArray();
     
      assertSame(bytes, bytes2);
     
      SimpleCachableMarshalledValue copy = replicate(mv);
      assertEquals(copy.peekSerializedForm(), copy.toByteArray());
     
      mv = new SimpleCachableMarshalledValue(null);
      assertNull(mv.toByteArray());
   }
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.