Package org.jgroups.blocks

Examples of org.jgroups.blocks.RequestOptions


        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();
            log("results of calling innerMethod():\n" + rspList);
            StringBuilder sb=new StringBuilder("outerMethod[");
            for(Enumeration e = results.elements(); e.hasMoreElements(); ) {
View Full Code Here


    }

    @Override
    protected GroupRequest cast(Collection<Address> dests, Message msg, RequestOptions options, boolean blockForResults) {
        RspFilter filter=options.getRspFilter();
        RequestOptions newOptions = new RequestOptions(options.getMode(), options.getTimeout(), options.getAnycasting(),
                                                       (filter != null) ? new NoMuxHandlerRspFilter(filter) : new NoMuxHandlerRspFilter(),
                                                       options.getFlags());
        return super.cast(dests, msg, newOptions, blockForResults);
    }
View Full Code Here

   
    for (int i = 0; i < 5; i++) {
      Util.sleep(100);
      System.out.println("Casting message #" + i);
      Message msg = new Message(null, null,new String("Kylin Soong JGroups Study Case, Number #" + i));
      rsp_list = disp.castMessage(null, msg, new RequestOptions(ResponseMode.GET_ALL, 0));
      System.out.println("Responses:\n" + rsp_list);
    }
//    channel.close();
//    disp.stop();
View Full Code Here

    logger.info(" -> View Id: " + channel.getView().getViewId());
    logger.info(" -> View Creater: " + channel.getView().getCreator());
    logger.info(" -> View Coordinator: " + channel.getView().getMembers().get(0));
    logger.info(" -> View Memembers: " + channel.getView().getMembers() + "\n");
   
    RequestOptions requestOptions = new RequestOptions(ResponseMode.GET_ALL, 5000, false, new RspFilter(){

      int num=0;

      public boolean isAcceptable(Object response, Address sender) {
        System.out.println("&& " + response);
View Full Code Here

   
    Util.sleep(1000);
    String param = channel.getName();
    MethodCall call = new MethodCall("getNodeName", new Object[]{param}, new Class[]{String.class});
    logger.info("Call all members getNodeName()");
    RequestOptions requestOptions = new RequestOptions(ResponseMode.GET_ALL, 0);
   
    System.out.println("Responses:");
    List<String> list = rsp_list.getResults();
    for(Object obj : list) {
      System.out.println("  " + obj);
View Full Code Here

    channel.connect("MessageDispatcherTestGroup");
   
    Util.sleep(100);
    logger.info("Casting message to all group members");
    Message message = new Message(null, null, new String("MessageDispatcher Test Message"));
    rsp_list = disp.castMessage(null, message, new RequestOptions().setMode(ResponseMode.GET_ALL).setTimeout(0));
   
    System.out.println("Responses:");
   
    List list = rsp_list.getResults();
    for(Object obj : list) {
View Full Code Here

   
    Util.sleep(1000);
    String param = channel.getName();
    MethodCall call = new MethodCall("getNodeName", new Object[]{param}, new Class[]{String.class});
    logger.info("Call all members getNodeName()");
    RequestOptions requestOptions = new RequestOptions(ResponseMode.GET_ALL, 0, false, new MyRspFilter());   
    rsp_list = disp.callRemoteMethods(null, call, requestOptions);
   
    System.out.println("Responses:");
    List<String> list = rsp_list.getResults();
    for(Object obj : list) {
View Full Code Here

    membershipListener = new MyMembershipListener();
    rpcMethods = new RpcMethods(channel);
    disp = new RpcDispatcher(channel, messageListener, membershipListener, rpcMethods);
    channel.connect("RpcDispatcherContentTestGroup");
   
    RequestOptions requestOptions = new RequestOptions(ResponseMode.GET_ALL, 0, false, new MyRspFilter());
   
    for(int i = 0 ; i < 10 ; i ++) {
      Util.sleep(1000);
      String viewId = null;
      if(null != channel.getView()) {
View Full Code Here

    membershipListener = new MyMembershipListener();
    rpcMethods = new RpcMethods(channel);
    disp = new RpcDispatcher(channel, messageListener, membershipListener, rpcMethods);
    channel.connect("RpcDispatcherContentTestGroup");
   
    RequestOptions requestOptions = new RequestOptions(ResponseMode.GET_ALL, 0);
   
    for(int i = 0 ; i < 10 ; i ++) {
      String viewId = null;
      if(null != channel.getView()) {
        viewId = channel.getView().getViewId().toString();
View Full Code Here

    membershipListener = new MyMembershipListener();
    rpcMethods = new RpcMethods(channel);
    disp = new RpcDispatcher(channel, messageListener, membershipListener, rpcMethods);
    channel.connect("RpcDispatcherContentTestGroup");
   
    RequestOptions requestOptions = new RequestOptions(ResponseMode.GET_ALL, 0);
   
    Util.sleep(1000);
    String viewId = null;
    if(null != channel.getView()) {
      viewId = channel.getView().getViewId().toString();
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.