Package org.jboss.cache.marshall

Examples of org.jboss.cache.marshall.MethodCall


   private List<Integer> allCalledIdsList = new ArrayList<Integer>();

   @Override
   public Object invoke(InvocationContext ctx) throws Throwable
   {
      MethodCall m = ctx.getMethodCall();
      if (!MethodDeclarations.isBlockUnblockMethod(m.getMethodId()))
      {
         if (failurelist.contains(m.getMethod())) throw new Exception("Failure in method " + m);
         allCalled.add(m.getMethod());
         allCalledIdsList.add(m.getMethodId());
      }

      return null;
   }
View Full Code Here


      // DON'T make a remote call if this is a remote call in the first place - leads to deadlocks - JBCACHE-1103
      if (!isCacheReady() || !cache.getInvocationContext().isOriginLocal()) return Collections.emptyMap();
      lock.acquireLock(name, true);
      try
      {
         MethodCall call = MethodCallFactory.create(MethodDeclarations.getDataMapMethodLocal_id, name);
         Object resp = callRemote(call);
         return (Map) resp;
      }
      finally
      {
View Full Code Here

      if (!isCacheReady() || !cache.getInvocationContext().isOriginLocal()) return false;

      lock.acquireLock(name, false);
      try
      {
         MethodCall call = MethodCallFactory.create(MethodDeclarations.existsMethod_id, name);
         Object resp = callRemote(call);

         return resp != null && (Boolean) resp;
      }
      finally
View Full Code Here

      try
      {
         NodeSPI n = cache.peek(name, false);
         if (n == null)
         {
            MethodCall call = MethodCallFactory.create(MethodDeclarations.getKeyValueMethodLocal_id, name, key, true);
            return callRemote(call);
         }
         else
         {
            // dont bother with a remote call
View Full Code Here

      try
      {
         NodeSPI n = cache.peek(name, true);
         if (n == null)
         {
            MethodCall call = MethodCallFactory.create(MethodDeclarations.getKeyValueMethodLocal_id, name, key, true);
            return callRemote(call);
         }
         else
         {
            // dont bother with a remote call
View Full Code Here

    */
   public Object invoke(InvocationContext ctx) throws Throwable
   {
      if (trace) log.trace("Invoked with method call " + ctx.getMethodCall());

      MethodCall m = ctx.getMethodCall();
      if (!overriddenMethods.contains(m.getMethodId()) || skipMethodCall(ctx))
      {
         if (trace) log.trace("Not registered for any handlers, or instructed to skip call.  Passing up the chain.");
         return nextInterceptor(ctx);
      }

      Object[] args = m.getArgs();
      Object result;
      switch (m.getMethodId())
      {
         case MethodDeclarations.putDataEraseMethodLocal_id:
            result = handlePutDataEraseMethod(ctx, (GlobalTransaction) args[0], (Fqn) args[1], (Map) args[2], (Boolean) args[3], (Boolean) args[4]);
            break;
         case MethodDeclarations.putDataMethodLocal_id:
View Full Code Here

      return enabled;
   }

   private void doPrepare(GlobalTransaction gtx, InvocationContext ctx) throws Throwable
   {
      MethodCall cleanup = transactionMods.get(gtx);
      if (trace) log.trace("Broadcasting prepare for cleanup ops " + cleanup);
      if (cleanup != null)
      {
         MethodCall prepare;
         List<MethodCall> mods = new ArrayList<MethodCall>(1);
         mods.add(cleanup);
         if (configuration.isNodeLockingOptimistic())
         {
            prepare = MethodCallFactory.create(MethodDeclarations.optimisticPrepareMethod_id, gtx, mods, null, cache.getLocalAddress(), false);
View Full Code Here

      return result;
   }

   private void cleanBackupData(BackupData backup, GlobalTransaction gtx, InvocationContext ctx) throws Throwable
   {
      MethodCall cleanup = MethodCallFactory.create(MethodDeclarations.dataGravitationCleanupMethod_id, backup.primaryFqn, backup.backupFqn);


      if (trace) log.trace("Performing cleanup on [" + backup.primaryFqn + "]");
      if (gtx == null)
      {
View Full Code Here

      {
         log.trace("cache=" + cache.getLocalAddress() + "; requesting data gravitation for Fqn " + fqn);
      }
      List<Address> mbrs = cache.getMembers();
      Boolean searchSubtrees = (buddyManager.isDataGravitationSearchBackupTrees() ? Boolean.TRUE : Boolean.FALSE);
      MethodCall dGrav = MethodCallFactory.create(MethodDeclarations.dataGravitationMethod_id, fqn, searchSubtrees);
      // doing a GET_ALL is crappy but necessary since JGroups' GET_FIRST could return null results from nodes that do
      // not have either the primary OR backup, and stop polling other valid nodes.
      List resps = cache.getRPCManager().callRemoteMethods(mbrs, dGrav, GroupRequest.GET_ALL, true, buddyManager.getBuddyCommunicationTimeout(), new ResponseValidityFilter(mbrs, cache.getLocalAddress()), false);
      if (trace)
      {
View Full Code Here

   private List<Integer> calledIdsList = new ArrayList<Integer>();

   @Override
   public synchronized Object invoke(InvocationContext ctx) throws Throwable
   {
      MethodCall m = ctx.getMethodCall();
      if (!MethodDeclarations.isBlockUnblockMethod(m.getMethodId()))
      {
         calledlist.add(m.getMethod());
         calledIdsList.add(m.getMethodId());
         called = m.getMethod();
      }

      return null;
   }
View Full Code Here

TOP

Related Classes of org.jboss.cache.marshall.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.