Examples of MarshalledValue


Examples of org.infinispan.marshall.MarshalledValue

      }
   }

   @Override
   public Object visitRemoveCommand(InvocationContext ctx, RemoveCommand command) throws Throwable {
      MarshalledValue value = null;
      if (wrapKeys) {
         if (!isTypeExcluded(command.getKey().getClass())) {
            value = createMarshalledValue(command.getKey(), ctx);
            command.setKey(value);
         }
View Full Code Here

Examples of org.infinispan.marshall.MarshalledValue

      return processRetVal(retVal, ctx);
   }

   @Override
   public Object visitEvictCommand(InvocationContext ctx, org.infinispan.commands.write.EvictCommand command) throws Throwable {
      MarshalledValue value = null;
      if (wrapKeys) {
         if (!isTypeExcluded(command.getKey().getClass())) {
            value = createMarshalledValue(command.getKey(), ctx);
            command.setKey(value);
         }
View Full Code Here

Examples of org.infinispan.marshall.MarshalledValue

      return processRetVal(retVal, ctx);
   }

   @Override
   public Object visitGetKeyValueCommand(InvocationContext ctx, GetKeyValueCommand command) throws Throwable {
      MarshalledValue mv = null;
      if (wrapKeys) {
         if (!isTypeExcluded(command.getKey().getClass())) {
            mv = createMarshalledValue(command.getKey(), ctx);
            command.setKey(mv);
            compact(mv);
View Full Code Here

Examples of org.infinispan.marshall.core.MarshalledValue

      }
   }

   private Object compact(Object val) {
      if (val instanceof MarshalledValue) {
         MarshalledValue marshalled = (MarshalledValue) val;
         if (marshalled.getRaw().size() < marshalled.getRaw().getRaw().length) {
            byte[] compactedArray = Arrays.copyOfRange(marshalled.getRaw().getRaw(), 0, marshalled.getRaw().size());
            return new MarshalledValue(compactedArray, marshalled.hashCode(), marshalled.getMarshaller());
         }
      }
      return val;
   }
View Full Code Here

Examples of org.jboss.aop.util.MarshalledValue

      final Object version;
      final long versionId;
      lock.acquire();
      try
      {
         version = new MarshalledValue(currentObject).get();
         if (version instanceof Advised)
         {
            // REVISIT: Currently share the InstanceAdvisor between versions
            Advised versionAdvised = (Advised)version;
            Advised currentAdvised = (Advised)currentObject;
View Full Code Here

Examples of org.jboss.cache.marshall.MarshalledValue

      return copy;
   }

   protected MarshalledValue createAndAddMarshalledValue(Object toWrap, Set<MarshalledValue> marshalledValues, InvocationContext ctx) throws NotSerializableException
   {
      MarshalledValue mv = new MarshalledValue(toWrap);
      marshalledValues.add(mv);
      if (!ctx.isOriginLocal()) mv.setEqualityPreferenceForInstance(false);
      return mv;
   }
View Full Code Here

Examples of org.jboss.invocation.MarshalledValue

      {
         result = null;
      }
      else if( value instanceof MarshalledValue )
      {
         MarshalledValue mv = (MarshalledValue) value;
         try
         {
            result = mv.get();
         }
         catch (Exception e)
         {
            SQLException sqe = new SQLException("Unable to extract MarshalledValue");
            sqe.initCause(e);
View Full Code Here

Examples of org.jboss.invocation.MarshalledValue

   {
      if(log.isTraceEnabled())
         log.trace("set: i=" + index + ", jdbcType="+jdbcType+", value=" + value);
      if( value instanceof MarshalledValue )
      {
         MarshalledValue mv = (MarshalledValue) value;
         try
         {
            value = mv.get();
         }
         catch (Exception e)
         {
            SQLException sqe = new SQLException("Unable to extract MarshalledValue");
            sqe.initCause(e);
View Full Code Here

Examples of org.jboss.invocation.MarshalledValue

      if( log.isTraceEnabled() )
         log.trace("ContentLength: "+length+"\nContentType: "+type);

      InputStream is = conn.getInputStream();
      ObjectInputStream ois = new ObjectInputStream(is);
      MarshalledValue mv = (MarshalledValue) ois.readObject();
      ois.close();

      Object obj = mv.get();
      if( (obj instanceof Naming) == false )
      {
         String msg = "Invalid reply content seen: "+obj.getClass();
         Throwable t = null;
         if( obj instanceof Throwable )
View Full Code Here

Examples of org.jboss.invocation.MarshalledValue

         }
         // Forward the invocation onto the JMX invoker
         Object value = mbeanServer.invoke(invokerName, "invoke", params, sig);
         if( returnValueAsAttribute == null || returnValueAsAttribute.booleanValue() == false )
         {
            MarshalledValue mv = new MarshalledValue(value);
            ServletOutputStream sos = response.getOutputStream();
            ObjectOutputStream oos = new ObjectOutputStream(sos);
            oos.writeObject(mv);
            oos.close();
         }
         else
         {
            request.setAttribute("returnValue", value);
         }
      }
      catch(Throwable t)
      {
         t = JMXExceptionDecoder.decode(t);
         // Unwrap any reflection InvocationTargetExceptions
         if( t instanceof InvocationTargetException )
         {
            InvocationTargetException ite = (InvocationTargetException) t;
            t = ite.getTargetException();
         }
         /* Wrap the exception in an InvocationException to distinguish
            between application and transport exceptions
         */
         InvocationException appException = new InvocationException(t);
         // Marshall the exception
         if( returnValueAsAttribute == null || returnValueAsAttribute.booleanValue() == false )
         {
            if (response.isCommitted())
            {
               // Cannot report back exception
               log.error("Invoke threw exception, and response is already committed", t);
            }
            else
            {
               response.resetBuffer();
               MarshalledValue mv = new MarshalledValue(appException);
               ServletOutputStream sos = response.getOutputStream();
               ObjectOutputStream oos = new ObjectOutputStream(sos);
               oos.writeObject(mv);
               oos.close();
            }
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.