Package org.jboss.invocation

Examples of org.jboss.invocation.MarshalledValueOutputStream


    * @return
    * @throws Exception
    */
   public byte[] loadEntireState() throws Exception {
      ByteArrayOutputStream out_stream=new ByteArrayOutputStream(1024);
      ObjectOutputStream    out=new MarshalledValueOutputStream(out_stream);
      loadState(Fqn.fromString("/"), out);
      out.close();
      return out_stream.toByteArray();
   }
View Full Code Here


            throw new IllegalStateException("TreeCacheMarshaller.objectToByteBuffer(): MethodCall name is either not "
                  + " replicate or replicateAll but : " +call.getName());
      }

      ByteArrayOutputStream bos = new ByteArrayOutputStream();
      ObjectOutputStream oos = new MarshalledValueOutputStream(bos);

      // Extract fqn and write it out in fixed format
      if(fqn == null) fqn = "NULL"; // can't write null. tis can be commit.
      oos.writeUTF(fqn);
      // Serialize the rest of MethodCall object
      oos.writeObject(o);
      if (log_.isTraceEnabled()) {
         log_.trace("send");
         log_.trace(getColumnDump(bos.toByteArray()));
      }
      return bos.toByteArray();
View Full Code Here

            if (marshal)
            {
               try
               {
                  ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
                  MarshalledValueOutputStream maos = new MarshalledValueOutputStream(baos);
                  maos.writeObject(list);
                  maos.close();
                  retval.add(baos.toByteArray());
               }
               catch (IOException e)
               {
                  throw new CacheException("Failure marshalling subtree at " + fqn, e);
View Full Code Here

    * @return
    * @throws Exception
    */
   public byte[] loadEntireState() throws Exception {
      ByteArrayOutputStream out_stream=new ByteArrayOutputStream(1024);
      ObjectOutputStream    out=new MarshalledValueOutputStream(out_stream);
      loadState(Fqn.fromString("/"), out);
      out.close();
      return out_stream.toByteArray();
   }
View Full Code Here

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

         ByteArrayOutputStream out_stream=new ByteArrayOutputStream(1024);
         ObjectOutputStream    out=new MarshalledValueOutputStream(out_stream);
         loadState(subtree, out);
         out.close();
         return out_stream.toByteArray();
      }
      finally
      {
         Thread.currentThread().setContextClassLoader(currentCL);
View Full Code Here

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

         ByteArrayOutputStream out_stream = new ByteArrayOutputStream(1024);
         ObjectOutputStream out = new MarshalledValueOutputStream(out_stream);
         loadStateFromFilessystem(subtree, out);
         out.close();

         return out_stream.toByteArray();
      }
      finally
      {
View Full Code Here

            if (marshal)
            {
               try
               {
                  ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
                  MarshalledValueOutputStream maos = new MarshalledValueOutputStream(baos);
                  maos.writeObject(list);
                  maos.close();
                  retval.add(baos.toByteArray());
               }
               catch (IOException e)
               {
                  throw new CacheException("Failure marshalling subtree at " + fqn, e);
View Full Code Here

            if (marshal)
            {
               try
               {
                  ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
                  MarshalledValueOutputStream maos = new MarshalledValueOutputStream(baos);
                  maos.writeObject(list);
                  maos.close();
                  retval.add(baos.toByteArray());
               }
               catch (IOException e)
               {
                  throw new CacheException("Failure marshalling subtree at " + fqn, e);
View Full Code Here

      }
   }

   private void getStateInternal(OutputStream stream) throws IOException
   {
      MarshalledValueOutputStream mvos = null; // don't create until we know we need it
     
      for (Map.Entry<String, HAPartitionStateTransfer> entry: this.stateHandlers.entrySet())
      {
         HAPartitionStateTransfer subscriber = entry.getValue();
         this.log.debug("getState for " + entry.getKey());
         Object state = subscriber.getCurrentState();
         if (state != null)
         {
            if (mvos == null)
            {
               // This is our first write, so need to write the header first
               stream.write(SERIALIZABLE_VALUE);
              
               mvos = new MarshalledValueOutputStream(stream);
            }
           
            mvos.writeObject(entry.getKey());
            mvos.writeObject(state);
         }
      }
     
      if (mvos == null)
      {
         // We never wrote any serviceState, so write the NULL header
         stream.write(NULL_VALUE);
      }
      else
      {
         mvos.writeObject(new StateStreamEnd());
         mvos.flush();
         mvos.close();
      }
     
   }
View Full Code Here

    * The object has to implement interface Serializable or Externalizable
    */
   protected byte[] objectToByteBufferInternal (Object obj) throws Exception
   {
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      MarshalledValueOutputStream mvos = new MarshalledValueOutputStream(baos);
      mvos.writeObject(obj);
      mvos.flush();
      return baos.toByteArray();
   }
View Full Code Here

TOP

Related Classes of org.jboss.invocation.MarshalledValueOutputStream

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.