Package org.jboss.invocation

Examples of org.jboss.invocation.MarshalledValueInputStream


            {
               cache.getRegionManager().setUnmarshallingClassLoader(name);

               byte[] nodeData = (byte[]) resp[0];
               ByteArrayInputStream bais = new ByteArrayInputStream(nodeData);
               MarshalledValueInputStream mais = new MarshalledValueInputStream(bais);
               nodes = (List) mais.readObject();
               mais.close();
            }
            finally
            {
               Thread.currentThread().setContextClassLoader(cl);
            }
View Full Code Here


                                    ? NodeFactory.NODE_TYPE_OPTIMISTIC_NODE
                                    : NodeFactory.NODE_TYPE_TREENODE;
      this.internalFqns = cache.getInternalFqns();
     
      ByteArrayInputStream bais = new ByteArrayInputStream(state);
      MarshalledValueInputStream in = new MarshalledValueInputStream(bais);
      in.readShort(); // the version, which we discard
      transientSize  = in.readInt();
      associatedSize = in.readInt();
      persistentSize = in.readInt();
      in.close();
      if (log.isTraceEnabled()) {
            log.trace("transient state: " + transientSize + " bytes");
            log.trace("associated state: " + associatedSize + " bytes");
            log.trace("persistent state: " + persistentSize + " bytes");
      }
View Full Code Here

      if (associatedSize > 0 && cache instanceof PojoCache) {
        
         DataNode refMapNode = cache.get(InternalDelegate.JBOSS_INTERNAL_MAP);

         ByteArrayInputStream in_stream=new ByteArrayInputStream(state, HEADER_LENGTH + transientSize, associatedSize);
         MarshalledValueInputStream in=new MarshalledValueInputStream(in_stream);
        
         try {
            Object[] nameValue;
            while ((nameValue = (Object[]) in.readObject()) != null) {
               TreeNode target = refMapNode.getChild(nameValue[0]);
              
               if (target == null) {
                  // Create the node
                  Fqn fqn = new Fqn(InternalDelegate.JBOSS_INTERNAL_MAP, nameValue[0]);
View Full Code Here

      Set retainedNodes = retainInternalNodes(target);
     
      target.removeAllChildren();
     
      ByteArrayInputStream in_stream=new ByteArrayInputStream(state, HEADER_LENGTH, transientSize);
      MarshalledValueInputStream in=new MarshalledValueInputStream(in_stream);
     
      // Read the first NodeData and integrate into our target
      NodeData nd = (NodeData) in.readObject();
      Map attrs = nd.getAttributes();
      if (attrs != null)
         target.put(attrs, true);
      else
         target.clear();
     
      // Check whether this is an integration into the buddy backup subtree
      Fqn tferFqn = nd.getFqn();
      Fqn tgtFqn = target.getFqn();     
      boolean move = tgtFqn.isChildOrEquals(BuddyManager.BUDDY_BACKUP_SUBTREE_FQN)
                     && !tferFqn.isChildOrEquals(tgtFqn);
      // If it is an integration, calculate how many levels of offset
      int offset = move ? tgtFqn.size() - tferFqn.size() : 0;
     
      RegionManager erm = cache.getEvictionRegionManager();
      if (erm != null)
      {
         Region[] regions = erm.getRegions();
         if (regions == null || regions.length == 0)
            erm = null;
      }
      integrateStateTransferChildren(target, offset, in, erm);
     
      in.close();
     
      integrateRetainedNodes(target, retainedNodes);
   }
View Full Code Here

      this.nodeType = cache.isNodeLockingOptimistic()
                                    ? NodeFactory.NODE_TYPE_OPTIMISTIC_NODE
                                    : NodeFactory.NODE_TYPE_TREENODE;
     
      ByteArrayInputStream bais = new ByteArrayInputStream(state);
      MarshalledValueInputStream in = new MarshalledValueInputStream(bais);
      in.readShort(); // the version, which we discard
      transientSize  = in.readInt();
      associatedSize = in.readInt();
      persistentSize = in.readInt();
      in.close();
      if (log.isTraceEnabled()) {
            log.trace("transient state: " + transientSize + " bytes");
            log.trace("associated state: " + associatedSize + " bytes");
            log.trace("persistent state: " + persistentSize + " bytes");
      }
View Full Code Here

      if (associatedSize > 0 && cache instanceof PojoCache) {
        
         DataNode refMapNode = cache.get(InternalDelegate.JBOSS_INTERNAL_MAP);

         ByteArrayInputStream in_stream=new ByteArrayInputStream(state, HEADER_LENGTH + transientSize, associatedSize);
         MarshalledValueInputStream in=new MarshalledValueInputStream(in_stream);
        
         try {
            Object[] nameValue;
            while ((nameValue = (Object[]) in.readObject()) != null) {
               TreeNode target = refMapNode.getChild(nameValue[0]);
              
               if (target == null) {
                  // Create the node
                  Fqn fqn = new Fqn(InternalDelegate.JBOSS_INTERNAL_MAP, nameValue[0]);
View Full Code Here

         throws IOException, ClassNotFoundException
   {
      target.removeAllChildren();
     
      ByteArrayInputStream in_stream=new ByteArrayInputStream(state, HEADER_LENGTH, transientSize);
      MarshalledValueInputStream in=new MarshalledValueInputStream(in_stream);
     
      // Read the first NodeData and integrate into our target
      NodeData nd = (NodeData) in.readObject();
      Map attrs = nd.getAttributes();
      if (attrs != null)
         target.put(attrs, true);
      else
         target.clear();
     
      RegionManager erm = cache.getEvictionRegionManager();
      if (erm != null)
      {
         Region[] regions = erm.getRegions();
         if (regions == null || regions.length == 0)
            erm = null;
      }
      integrateStateTransferChildren(target, in, erm);
     
      in.close();     
   }
View Full Code Here

      if (associated_state != null && cache instanceof PojoCache) {
        
         DataNode refMapNode = cache.get(InternalDelegate.JBOSS_INTERNAL_MAP);

         ByteArrayInputStream in_stream=new ByteArrayInputStream(associated_state);
         MarshalledValueInputStream in=new MarshalledValueInputStream(in_stream);
        
         try {
            Object[] nameValue;
            while ((nameValue = (Object[]) in.readObject()) != null) {
               TreeNode target = refMapNode.getChild(nameValue[0]);
              
               if (target == null) {
                  // Create the node
                  Fqn fqn = new Fqn(InternalDelegate.JBOSS_INTERNAL_MAP, nameValue[0]);
View Full Code Here

         throws IOException, ClassNotFoundException
   {
      target.removeAllChildren();
     
      ByteArrayInputStream in_stream=new ByteArrayInputStream(transient_state);
      MarshalledValueInputStream in=new MarshalledValueInputStream(in_stream);
     
      // Read the first NodeData and integrate into our target
      NodeData nd = (NodeData) in.readObject();
      Map attrs = nd.getAttributes();
      if (attrs != null)
         target.put(attrs, true);
      else
         target.clear();
     
      RegionManager erm = cache.getEvictionRegionManager();
      if (erm != null)
      {
         Region[] regions = erm.getRegions();
         if (regions == null || regions.length == 0)
            erm = null;
      }
      integrateStateTransferChildren(target, in, erm);
     
      in.close();     
   }
View Full Code Here

   {
      ByteArrayInputStream bais = new ByteArrayInputStream(state);
      bais.mark(1024);     
     
      short version = 0;
      MarshalledValueInputStream in = null;
      try {
         in = new MarshalledValueInputStream(bais);
      }
      catch (IOException e) {
         // No short at the head of the stream means version 123
         version = RV_123;
      }

      try {
         if (in != null) {
            try {
               version = in.readShort();
            }
            catch (IOException io) {
               // No short at the head of the stream means version 123
               version = RV_123;
            }
         }
        
         // Compiler won't let me use a switch
        
         // Test 1.2.4 and 1.2.4.SP1 first as these are actually lower numbers
         // than 1.2.3 since their shorts used a different algorithm
         if (version == RV_124)
            return new StateTransferIntegrator_124(in, targetFqn, cache);
         else if (version == RV_124SP1)
            return new StateTransferIntegrator_1241(state, targetFqn, cache);
         else if (version <= RV_123 && version > 0) // <= 0 is actually a version > 15.31.63
            return new StateTransferIntegrator_123(state, targetFqn, cache);
         else if (version < RV_140 && version > 0) // <= 0 is actually a version > 15.31.63
            return new StateTransferIntegrator_1241(state, targetFqn, cache);
         else
            return new StateTransferIntegrator_140(state, targetFqn, cache); // current default
                
      }
      finally {
         try {
            if (in != null) in.close();
         }
         catch (IOException io) {}
      }
   }
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.