Package org.jboss.invocation

Examples of org.jboss.invocation.MarshalledValueInputStream


    * @param state
    * @throws Exception
    */
   public void storeEntireState(byte[] state) throws Exception {
      ByteArrayInputStream in_stream=new ByteArrayInputStream(state);
      MarshalledValueInputStream in=new MarshalledValueInputStream(in_stream);
      NodeData nd;

      // remove entire existing state
      this.remove(Fqn.fromString("/"));

      // store new state
      try {
         while(true) {
            nd=(NodeData) in.readObject();
            if(nd.attrs != null)
               this.put(nd.fqn, nd.attrs, true); // creates a node with 0 or more attributes
            else
               this.put(nd.fqn, null)// creates a node with null attributes
         }
View Full Code Here


      {
         // Set the TCCL to any classloader registered for subtree
         setUnmarshallingClassLoader(subtree);

         ByteArrayInputStream in_stream=new ByteArrayInputStream(state);
         MarshalledValueInputStream in=new MarshalledValueInputStream(in_stream);
         NodeData nd;

         // remove entire existing state
         this.remove(subtree);

         boolean moveToBuddy =
            subtree.isChildOf(BuddyManager.BUDDY_BACKUP_SUBTREE_FQN) && subtree.size() > 1;

         // store new state
         Fqn fqn = null;
         while(in_stream.available() > 0)
         {
            nd=(NodeData)in.readObject();

            if (moveToBuddy)
               fqn = BuddyManager.getBackupFqn(subtree, nd.fqn);
            else
               fqn = nd.fqn;
View Full Code Here

      {
         // Set the TCCL to any classloader registered for subtree
         setUnmarshallingClassLoader(subtree);

         ByteArrayInputStream in_stream = new ByteArrayInputStream(state);
         MarshalledValueInputStream in = new MarshalledValueInputStream(in_stream);
         NodeData nd;

         // remove entire existing state
         this.remove(subtree);

         boolean moveToBuddy =
                 subtree.isChildOf(BuddyManager.BUDDY_BACKUP_SUBTREE_FQN) && subtree.size() > 1;

         // store new state
         Fqn fqn;
         while (in_stream.available() > 0)
         {
            nd = (NodeData) in.readObject();

            if (moveToBuddy)
               fqn = BuddyManager.getBackupFqn(subtree, nd.fqn);
            else
               fqn = nd.fqn;
View Full Code Here

      // this node exists so we should never return a null after this... at worst case, an empty HashMap.
      File child = new File(f, DATA);
      if (!child.exists()) return new HashMap(0); // no node attribs exist hence the empty HashMap.
      //if(!child.exists()) return null;
      FileInputStream in = new FileInputStream(child);
      MarshalledValueInputStream input = new MarshalledValueInputStream(in);
      Map m = (Map) input.readObject();
      if (log.isTraceEnabled())
      {
         log.trace("Read fqn="+ fqn + " from file input stream and returned " + m);
      }     
      in.close();
View Full Code Here

/* 424 */       return null;
/*     */     }
/* 426 */     ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
/*     */     try
/*     */     {
/* 431 */       ObjectInputStream oos = new MarshalledValueInputStream(bais);
/* 432 */       return oos.readObject();
/*     */     }
/*     */     catch (Exception e)
/*     */     {
/* 436 */       log.error("Cannot deserialize", e);
/* 437 */     }return null;
View Full Code Here

     
      long used_mem_before, used_mem_after;
      Runtime rt=Runtime.getRuntime();
      used_mem_before=rt.totalMemory() - rt.freeMemory();
     
      MarshalledValueInputStream mvis = new MarshalledValueInputStream(stream);
     
      while (true)
      {
         Object obj = mvis.readObject();
         if (obj instanceof StateStreamEnd)
         {
            break;
         }
        
         String key = (String) obj;
         this.log.debug("setState for " + key);
         Object someState = mvis.readObject();
         HAPartitionStateTransfer subscriber = this.stateHandlers.get(key);
         if (subscriber != null)
         {
            try
            {
View Full Code Here

      {
         return null;
      }

      ByteArrayInputStream bais = new ByteArrayInputStream(buffer);
      MarshalledValueInputStream mvis = new MarshalledValueInputStream(bais);
      return mvis.readObject();
   }
View Full Code Here

      }

      ByteArrayInputStream bais = new ByteArrayInputStream(buffer);
      // read past the null/serializable byte
      bais.read();
      MarshalledValueInputStream mvis = new MarshalledValueInputStream(bais);
      return mvis.readObject();
   }
View Full Code Here

TOP

Related Classes of org.jboss.invocation.MarshalledValueInputStream

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.