Package org.jgroups.blocks

Examples of org.jgroups.blocks.RequestOptions


      Response retval;
      Buffer buf;
      buf = marshallCall(marshaller, command);
      retval = card.sendMessage(constructMessage(buf, destination, oob, mode, rsvp),
                                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


      RspList<Object> retval = null;
      Buffer buf;
      if (broadcast || FORCE_MCAST) {
         buf = marshallCall(marshaller, command);
         retval = card.castMessage(dests, constructMessage(buf, null, oob, mode, rsvp),
                                   new RequestOptions(mode, timeout, false, filter));
      } else {
         RequestOptions opts = new RequestOptions(mode, timeout);

         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

         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( GroupRequest.GET_ALL, methodTimeout, false, rspFilter);
      if (excludeSelf)
      {
         ro.setExclusionList(this.localJGAddress);
      }
     
      if(this.channel.flushSupported())
      {
         this.flushBlockGate.await(this.getMethodCallTimeout());
View Full Code Here

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

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

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

    */
   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( GroupRequest.GET_NONE, this.getMethodCallTimeout());
      if (excludeSelf)
      {        
         ro.setExclusionList(this.localJGAddress);
      }
     
      if(this.channel.flushSupported())
      {
         this.flushBlockGate.await(this.getMethodCallTimeout());
View Full Code Here

            return;
         }
      }
     
      Address coord = this.groupView.coordinator;
      RequestOptions opt = new RequestOptions( GroupRequest.GET_ALL, this.getMethodCallTimeout());
      if (unordered)
      {
         opt.setFlags(Message.OOB);
      }
      try
      {
         this.dispatcher.callRemoteMethod(coord, m, opt);
      }
View Full Code Here

      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, false, 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

      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

TOP

Related Classes of org.jgroups.blocks.RequestOptions

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.