Package org.jboss.ha.framework.server

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


  
   protected RDBMSStoreBase()
   {
      try
      {
         Object empty = new SimpleCachableMarshalledValue(new HashMap<String, Object>());
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ObjectOutputStream oos = new ObjectOutputStream(baos);
         oos.writeObject(empty);
         oos.close();
         emptyAttributes = baos.toByteArray();
View Full Code Here


               Map<String, Object> attributes = null;
               if (includeAttributes)
               {
                  BufferedInputStream attributes_bis = new BufferedInputStream(rst.getBinaryStream(8));
                  attributes_ois = new ObjectInputStream(attributes_bis);                 
                  SimpleCachableMarshalledValue mv = (SimpleCachableMarshalledValue) attributes_ois.readObject();

                  attributes = uncheckedCast(mv.get());
               }

               incomingSession = new IncomingDistributableSessionDataImpl(version, timestamp, metadata, attributes);

            }
View Full Code Here

      try
      {
         bos = new ByteArrayOutputStream();
         oos = new ObjectOutputStream(new BufferedOutputStream(bos));

         oos.writeObject(new SimpleCachableMarshalledValue((Serializable) attrs));
         oos.close();
         return bos.toByteArray();
      }
      finally
      {
View Full Code Here

      if (!(value instanceof Serializable))
      {
         throw new IllegalArgumentException(String.format("%s does not implement %s", value, Serializable.class.getName()));
      }
     
      return new SimpleCachableMarshalledValue((Serializable) value, this.source, true);
   }
View Full Code Here

   @Override
   public Object unmarshal(Object object) throws IOException, ClassNotFoundException
   {
      if ((object == null) || !(object instanceof SimpleCachableMarshalledValue)) return object;

      SimpleCachableMarshalledValue value = (SimpleCachableMarshalledValue) object;
     
      // Swap in/out the class loader for this web app. Needed only for unmarshalling.
      ContextClassLoaderSwitcher.SwitchContext switchContext = this.switcher.getSwitchContext(this.manager.getApplicationClassLoader());
     
      try
      {
         value.setObjectStreamSource(this.source);
        
         return value.get();
      }
      finally
      {
         switchContext.reset();
      }
View Full Code Here

         }
         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

      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

         }
         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

      try
      {
         switcher = getContextClassLoaderSwitcher().getSwitchContext();
         switcher.setClassLoader(webAppClassLoader_);
        
         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

      try
      {
         switcher = getContextClassLoaderSwitcher().getSwitchContext();
         switcher.setClassLoader(webAppClassLoader_);
        
         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

TOP

Related Classes of org.jboss.ha.framework.server.SimpleCachableMarshalledValue

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.