Examples of RequestOptions


Examples of org.jgroups.blocks.RequestOptions

      System.out.println("Invoke all members 'getUser' method");
      rsp_list = disp.callRemoteMethods(null
                      , "getUser"
                      , new Object[]{101, "RPC remote test", new User(1000, "Kylin Soong", "IT")}
                      , new Class[]{int.class, String.class, User.class}
                      , new RequestOptions(ResponseMode.GET_ALL, 5000));
      System.out.println("Responses:\n" + rsp_list);
    }
  }
View Full Code Here

Examples of org.jgroups.blocks.RequestOptions

//    System.out.println(methodName);
   
    for (int i = 0; i < 5; i++){
      Util.sleep(100);
      System.out.println("Invoke all members 'getUser' method");
      NotifyingFuture<RspList> future = disp.callRemoteMethodWithFuture(channel.getAddress(), method_call, new RequestOptions(ResponseMode.GET_ALL, 5000));
      future.setListener(new FutureListener(){

        public void futureDone(Future future) {
          try {
            System.out.println("result is " + future.get());
View Full Code Here

Examples of org.jgroups.blocks.RequestOptions

      Buffer buf = CommandAwareRpcDispatcher.marshallCall(dispatcher.getMarshaller(), rpcCommand);
      Map<XSiteBackup, Future<Object>> syncBackupCalls = new HashMap<XSiteBackup, Future<Object>>(backups.size());
      for (XSiteBackup xsb : backups) {
         SiteMaster recipient = new SiteMaster(xsb.getSiteName());
         if (xsb.isSync()) {
            RequestOptions sync = new RequestOptions(org.jgroups.blocks.ResponseMode.GET_ALL, xsb.getTimeout());
            syncBackupCalls.put(xsb, dispatcher.sendMessageWithFuture(CommandAwareRpcDispatcher.constructMessage(buf, recipient, true, false, false), sync));
         } else {
            RequestOptions async = new RequestOptions(org.jgroups.blocks.ResponseMode.GET_NONE, xsb.getTimeout());
            dispatcher.sendMessage(CommandAwareRpcDispatcher.constructMessage(buf, recipient, false, false, false), async);
         }
      }
      return new JGroupsBackupResponse(syncBackupCalls);
   }
View Full Code Here

Examples of org.jgroups.blocks.RequestOptions

      Response retval;
      Buffer buf;
      buf = marshallCall(marshaller, command);
      retval = card.sendMessage(constructMessage(buf, destination, oob, rsvp, false),
                                new RequestOptions(mode, timeout));

      // we only bother parsing responses if we are not in ASYNC mode.
      if (trace) log.tracef("Response: %s", retval);
      if (mode == ResponseMode.GET_NONE)
         return null;
View Full Code Here

Examples of org.jgroups.blocks.RequestOptions

         Message message = constructMessage(buf, null, oob, rsvp, totalOrder);

         AnycastAddress address = new AnycastAddress(dests);
         message.setDest(address);

         retval = card.castMessage(dests, message, new RequestOptions(mode, timeout, false, filter));
      } else if (broadcast || FORCE_MCAST || totalOrder) {
         buf = marshallCall(marshaller, command);
         RequestOptions opts = new RequestOptions(mode, timeout, false, filter);

         //Only the commands in total order must be received...
         //For correctness, ispn doesn't need their own message, so add own address to exclusion list
         if(!totalOrder) {
            opts.setExclusionList(card.getChannel().getAddress());
         }

         retval = card.castMessage(dests, constructMessage(buf, null, oob, rsvp, totalOrder),opts);
      } else {
         RequestOptions opts = new RequestOptions(mode, timeout);

         //Only the commands in total order must be received...
         opts.setExclusionList(card.getChannel().getAddress());

         if (dests.isEmpty()) return new RspList<Object>();
         buf = marshallCall(marshaller, command);

         // if at all possible, try not to use JGroups' ANYCAST for now.  Multiple (parallel) UNICASTs are much faster.
View Full Code Here

Examples of org.jgroups.blocks.RequestOptions

         Class<T> returnType, boolean excludeSelf, ResponseFilter filter, long methodTimeout, boolean unordered)
         throws InterruptedException
   {
      MethodCall m = new MethodCall(serviceName + "." + methodName, args, types);
      RspFilterAdapter rspFilter = filter == null ? null : new RspFilterAdapter(filter, this.nodeFactory);
      RequestOptions ro = new RequestOptions(Request.GET_ALL, methodTimeout, false, rspFilter);
      if (excludeSelf)
      {
         ro.setExclusionList(this.localJGAddress);
      }
     
      if(this.channel.flushSupported())
      {
         this.flushBlockGate.await(this.getMethodCallTimeout());
View Full Code Here

Examples of org.jgroups.blocks.RequestOptions

            return invokeDirectly(serviceName, methodName, args, types, returnType, null, null);
         }
      }
     
      Address coord = this.groupView.coordinator;
      RequestOptions opt = new RequestOptions(Request.GET_ALL, methodTimeout);
      if (unordered)
      {
         opt.setFlags(Message.OOB);
      }
      try
      {
         return returnType.cast(this.dispatcher.callRemoteMethod(coord, m, opt));
      }
View Full Code Here

Examples of org.jgroups.blocks.RequestOptions

      {
         return invokeDirectly(serviceName, methodName, args, types, returnType, null, null);
      }
     
      Object rsp = null;
      RequestOptions opt = new RequestOptions(Request.GET_FIRST, methodTimeout);
      if (unordered)
      {
         opt.setFlags(Message.OOB);
      }
      try
      {
         rsp = this.dispatcher.callRemoteMethod(((ClusterNodeImpl) targetNode).getOriginalJGAddress(), m, opt);
      }
View Full Code Here

Examples of org.jgroups.blocks.RequestOptions

      {
         new AsynchronousLocalInvocation(serviceName, methodName, args, types).invoke();
         return;
      }
     
      RequestOptions opt = new RequestOptions(Request.GET_NONE, this.getMethodCallTimeout());
      if (unordered)
      {
         opt.setFlags(Message.OOB);
      }
      try
      {
         this.dispatcher.callRemoteMethod(((ClusterNodeImpl) targetNode).getOriginalJGAddress(), m, opt);
      }
View Full Code Here

Examples of org.jgroups.blocks.RequestOptions

   @Override
   public void callAsynchMethodOnCluster(final String serviceName, final String methodName, final Object[] args, final Class<?>[] types,
         boolean excludeSelf, boolean unordered) throws InterruptedException
   {
      MethodCall m = new MethodCall(serviceName + "." + methodName, args, types);
      RequestOptions ro = new RequestOptions(Request.GET_NONE, this.getMethodCallTimeout());
      if (excludeSelf)
      {        
         ro.setExclusionList(this.localJGAddress);
      }
     
      if(this.channel.flushSupported())
      {
         this.flushBlockGate.await(this.getMethodCallTimeout());
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.