Package org.jboss.cache.pojo.util

Examples of org.jboss.cache.pojo.util.MethodCall


      String methodName = invocation.getMethod().getName();
      // TODO Needs to handle Collection interceptor as well.
      if (methodName.equals(MethodDeclarations.attachInterceptor.getName()))
      {
         Method method = MethodDeclarations.undoAttachInterceptor;
         MethodCall mc = new MethodCall(method, invocation.getArguments(), invocation.getTargetObject());
         handler.addToList(mc);
      }
      else if (methodName.equals(MethodDeclarations.detachInterceptor.getName()))
      {
         Method method = MethodDeclarations.undoDetachInterceptor;
         MethodCall mc = new MethodCall(method, invocation.getArguments(), invocation.getTargetObject());
         handler.addToList(mc);
      }
      else if (methodName.equals(MethodDeclarations.inMemorySubstitution.getName()))
      {
         Method method = MethodDeclarations.undoInMemorySubstitution;
         Object obj = invocation.getArguments()[0];
         Field field = (Field) invocation.getArguments()[1];
         Object oldValue = field.get(obj);
         Object[] args = new Object[]{obj, field, oldValue};
         MethodCall mc = new MethodCall(method, args, invocation.getTargetObject());
         handler.addToList(mc);
      }
      else if (methodName.equals(MethodDeclarations.incrementReferenceCount.getName()))
      {
         Method method = MethodDeclarations.undoIncrementReferenceCount;
         Fqn fqn = (Fqn) invocation.getArguments()[0];
         int count = (Integer) invocation.getArguments()[1];
         List referenceList = (List) invocation.getArguments()[2];
         Object[] args = new Object[]{fqn, count, referenceList};
         MethodCall mc = new MethodCall(method, args, invocation.getTargetObject());
         handler.addToList(mc);
      }
      else if (methodName.equals(MethodDeclarations.decrementReferenceCount.getName()))
      {
         Method method = MethodDeclarations.undoDecrementReferenceCount;
         Fqn fqn = (Fqn) invocation.getArguments()[0];
         int count = (Integer) invocation.getArguments()[1];
         List referenceList = (List) invocation.getArguments()[2];
         Object[] args = new Object[]{fqn, count, referenceList};
         MethodCall mc = new MethodCall(method, args, invocation.getTargetObject());
         handler.addToList(mc);
      }
      else
      {
         throw new PojoCacheException("PojoTxUndoInterceptor: invalid invocation name: " + methodName);
View Full Code Here


   private void runRollbackPhase()
   {
      // Rollback the pojo interceptor add/remove
      for (int i = (undoList_.size() - 1); i >= 0; i--)
      {
         MethodCall mc = (MethodCall) undoList_.get(i);
         try
         {
            mc.invoke();
         }
         catch (Throwable t)
         {
            throw new PojoCacheException(
                  "PojoTxSynchronizationHandler.runRollbackPhase(): error: " + t, t);
View Full Code Here

TOP

Related Classes of org.jboss.cache.pojo.util.MethodCall

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.