Examples of MethodCall


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

Examples of org.jboss.errai.codegen.builder.callstack.MethodCall

  }

  @Override
  public ContextualStatementBuilder invokeStatic(MetaClass clazz, String methodName, Object... parameters) {
    appendCallElement(new LoadClassReference(clazz));
    appendCallElement(new MethodCall(methodName, parameters, true));
    return new ContextualStatementBuilderImpl(context, callElementBuilder);
  }
View Full Code Here

Examples of org.jboss.errai.codegen.framework.builder.callstack.MethodCall

  }

  @Override
  public ContextualStatementBuilder invokeStatic(MetaClass clazz, String methodName, Object... parameters) {
    appendCallElement(new LoadClassReference(clazz));
    appendCallElement(new MethodCall(methodName, parameters, true));
    return new ContextualStatementBuilderImpl(context, callElementBuilder);
  }
View Full Code Here

Examples of org.jboss.errai.ioc.rebind.ioc.codegen.builder.callstack.MethodCall

    return invoke(method.getName(), parameters);
  }

  @Override
  public ContextualStatementBuilder invoke(String methodName, Object... parameters) {
    appendCallElement(new MethodCall(methodName, parameters));
    return this;
  }
View Full Code Here

Examples of org.jgroups.blocks.MethodCall

        serverObject.setRpcDispatcher(disp);
        c1.connect(name);
        Address localAddress = c1.getAddress();

        // call the nested group method on itself
        MethodCall call = new MethodCall("outerMethod", new Object[0], new Class[0]);
        log("calling outerMethod() on all members");
        RspList rspList = disp.callRemoteMethods(null, call, GroupRequest.GET_ALL, 0);
        log("results of outerMethod(): " + rspList);

        Assert.assertEquals(1, rspList.size());
View Full Code Here

Examples of org.jgroups.blocks.MethodCall

        obj2.setRpcDispatcher(disp2);
        c2.connect(name);
        Address localAddress2 = c2.getAddress();

        // call a point-to-point method on Member 2 that triggers a nested distributed RPC
        MethodCall call = new MethodCall("outerMethod", new Object[0], new Class[0]);
        log("calling outerMethod() on " + localAddress2);
        Object retval = disp1.callRemoteMethod(localAddress2, call, GroupRequest.GET_ALL, 0);
        log("results of outerMethod(): " + retval);
    }
View Full Code Here

Examples of org.jgroups.blocks.MethodCall

        Vector<Address> dests=new Vector<Address>();
        dests.add(c1.getAddress());
        dests.add(c2.getAddress());

        // call a point-to-point method on Member 2 that triggers a nested distributed RPC
        MethodCall call = new MethodCall("outerMethod", new Object[0], new Class[0]);
        log("calling outerMethod() on all members");
        RspList rsps = disp1.callRemoteMethods(dests, call, GroupRequest.GET_ALL, 0);
        log("results of outerMethod():\n" + rsps);
        Assert.assertEquals(2, rsps.size());
    }
View Full Code Here

Examples of org.jgroups.blocks.MethodCall

            this.disp = rpcDispatcher;
        }

        public String outerMethod() {
            log("**** outerMethod() received, calling innerMethod() on all members");
            MethodCall call = new MethodCall("innerMethod", new Object[0], new Class[0]);
            // RspList rspList = disp.callRemoteMethods(null, call, GroupRequest.GET_ALL, 5000);
            RequestOptions opts=new RequestOptions(GroupRequest.GET_ALL, 0, false, null, (byte)0);
            opts.setFlags(Message.OOB);
            RspList rspList = disp.callRemoteMethods(null, call, opts);
            Vector results = rspList.getResults();
View Full Code Here

Examples of org.jgroups.blocks.MethodCall

  pick.y = p.y;
  pick.fixed = pickfixed;


  try {
    MethodCall call = new MethodCall("moveNode", new Object[] {pick}, new String[] {Node.class.getName()});
      wb.disp.callRemoteMethods(null, call, GroupRequest.GET_ALL, 0);
  }
  catch(Exception ex) {
      log.error(ex.toString());
  }
View Full Code Here

Examples of org.jgroups.blocks.MethodCall

  myname=name;
  int xloc = (int)(10 + 250*Math.random());
  int yloc = (int)(10 + 250*Math.random());

  try {
      MethodCall call=new MethodCall("addNode",
          new Object[] {name, my_addr, new Integer(xloc), new Integer(yloc)},
          new String[] {String.class.getName(), Address.class.getName(), int.class.getName(), int.class.getName()});
      wb.disp.callRemoteMethods(null, call, GroupRequest.GET_ALL, 0);
  }
  catch(Exception e) {
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.