congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
MethodCall.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.jgroups.blocks.MethodCall
constructor

Best Java code snippets using org.jgroups.blocks.MethodCall.<init> (Showing top 20 results out of 315)

Refine searchRefine arrow

  • RpcDispatcher.callRemoteMethods
origin: wildfly/wildfly

protected RspList invokeRpc(short method_id, RequestOptions options, Object ... args) throws Exception {
  MethodCall call=new MethodCall(method_id, args);
  return disp.callRemoteMethods(null, call, options);
}
origin: wildfly/wildfly

/**
 * Removes all of the mappings from this map.
 */
public void clear() {
  try {
    MethodCall call=new MethodCall(CLEAR);
    disp.callRemoteMethods(null, call, call_options);
  }
  catch(Exception e) {
    throw new RuntimeException("clear() failed", e);
  }
}
origin: wildfly/wildfly

/**
 * Invokes a method in all members and expects responses from members contained in dests (or all members if dests is null).
 * @param dests A list of addresses. If null, we'll wait for responses from all cluster members
 * @param method_name The name of the target method
 * @param args The arguments to be passed
 * @param types The types of the arguments
 * @param options A collection of call options, e.g. sync versus async, timeout etc
 * @return RspList<T> A response list with results, one for each member in dests, or null if the RPC is asynchronous
 * @throws Exception If the sending of the message threw an exception. Note that <em>no</em> exception will be
 *                   thrown if any of the target members threw an exception, but this exception will be in the Rsp
 *                   object for the particular member in the RspList
 */
public <T> RspList<T> callRemoteMethods(Collection<Address> dests, String method_name, Object[] args,
                    Class[] types, RequestOptions options) throws Exception {
  MethodCall method_call=new MethodCall(method_name, args, types);
  return callRemoteMethods(dests, method_call, options);
}
origin: wildfly/wildfly

/**
 * Copies all of the mappings from the specified map to this one. These
 * mappings replace any mappings that this map had for any of the keys
 * currently in the specified map.
 * 
 * @param m
 *                mappings to be stored in this map
 */
public void putAll(Map<? extends K,? extends V> m) {
  try {
    MethodCall call=new MethodCall(PUT_ALL, m);
    disp.callRemoteMethods(null, call, call_options);
  }
  catch(Throwable t) {
    throw new RuntimeException("putAll() failed", t);
  }
}
origin: wildfly/wildfly

/** @throws NullPointerException if the specified key is null */
public boolean remove(Object key, Object value) {
  Object val=get(key);
  boolean removed=val != null && value != null && val.equals(value);
  try {
    MethodCall call=new MethodCall(REMOVE_IF_EQUALS, key, value);
    disp.callRemoteMethods(null, call, call_options);
  }
  catch(Exception e) {
    throw new RuntimeException("remove(" + key + ", " + value + ") failed", e);
  }
  return removed;
}
origin: wildfly/wildfly

protected void changeFieldAcrossCluster(Field field, Object value) throws Exception {
  disp.callRemoteMethods(null, new MethodCall(SET, field.getName(), value), RequestOptions.SYNC());
}
origin: wildfly/wildfly

/**
 * @return the previous value associated with the specified key, or <tt>null</tt> if there was no mapping for the key
 * @throws NullPointerException if the specified key or value is null
 */
public V putIfAbsent(K key, V value) {
  V prev_val=get(key);
  try {
    MethodCall call=new MethodCall(PUT_IF_ABSENT, key, value);
    disp.callRemoteMethods(null, call, call_options);
  }
  catch(Exception e) {
    throw new RuntimeException("putIfAbsent(" + key + ", " + value + ") failed", e);
  }
  return prev_val;
}
origin: wildfly/wildfly

/** @throws NullPointerException if any of the arguments are null */
public boolean replace(K key, V oldValue, V newValue) {
  Object val=get(key);
  boolean replaced=val != null && oldValue != null && val.equals(oldValue);
  try {
    MethodCall call=new MethodCall(REPLACE_IF_EQUALS, key, oldValue, newValue);
    disp.callRemoteMethods(null, call, call_options);
  }
  catch(Exception e) {
    throw new RuntimeException("replace(" + key
                   + ", "
                   + oldValue
                   + ", "
                   + newValue
                   + ") failed", e);
  }
  return replaced;
}
origin: wildfly/wildfly

/**
 *
 * 
 * @return the previous value associated with the specified key, or
 *         <tt>null</tt> if there was no mapping for the key
 * @throws NullPointerException
 *                 if the specified key or value is null
 */
public V replace(K key, V value) {
  V retval=get(key);
  try {
    MethodCall call=new MethodCall(REPLACE_IF_EXISTS, key, value);
    disp.callRemoteMethods(null, call, call_options);
  }
  catch(Exception e) {
    throw new RuntimeException("replace(" + key + ", " + value + ") failed", e);
  }
  return retval;
}
origin: wildfly/wildfly

/**
 * Removes the key (and its corresponding value) from this map. This method
 * does nothing if the key is not in the map.
 * 
 * @param key
 *                the key that needs to be removed
 * @return the previous value associated with <tt>key</tt>, or
 *         <tt>null</tt> if there was no mapping for <tt>key</tt>
 * @throws NullPointerException
 *                 if the specified key is null
 */
public V remove(Object key) {
  V retval=get(key);
  try {
    MethodCall call=new MethodCall(REMOVE, key);
    disp.callRemoteMethods(null, call, call_options);
  }
  catch(Exception e) {
    throw new RuntimeException("remove(" + key + ") failed", e);
  }
  return retval;
}
origin: wildfly/wildfly

public void mouseReleased(MouseEvent e) {
  Point p=e.getPoint();
  if(pick == null)
    return;
  pick.x=p.x;
  pick.y=p.y;
  pick.fixed=pickfixed;
  try {
    MethodCall call=new MethodCall("moveNode", new Object[]{pick}, new Class[]{Node.class});
    wb.disp.callRemoteMethods(null, call, new RequestOptions(ResponseMode.GET_ALL, 0));
  }
  catch(Exception ex) {
    log.error(ex.toString());
  }
  pick=null;
}
origin: wildfly/wildfly

/**
 * Maps the specified key to the specified value in this table. Neither the key nor the value can be null. <p/>
 * <p>
 * The value can be retrieved by calling the <tt>get</tt> method with a key that is equal to the original key.
 * 
 * @param key
 *                key with which the specified value is to be associated
 * @param value
 *                value to be associated with the specified key
 * @return the previous value associated with <tt>key</tt>, or
 *         <tt>null</tt> if there was no mapping for <tt>key</tt>
 * @throws NullPointerException
 *                 if the specified key or value is null
 */
public V put(K key, V value) {
  V prev_val=get(key);
  try {
    MethodCall call=new MethodCall(PUT, key, value);
    disp.callRemoteMethods(null, call, call_options);
  }
  catch(Exception e) {
    throw new RuntimeException("put(" + key + ", " + value + ") failed", e);
  }
  return prev_val;
}
origin: wildfly/wildfly

  public void run() {
    byte[] buf=new byte[msg_size];
    Object[] args={buf};
    MethodCall call=new MethodCall((short)0, args);
    try {
      latch.await();
    }
    catch(InterruptedException e) {
      e.printStackTrace();
      return;
    }
    for(;;) {
      int i=num_requests.incrementAndGet();
      if(i > num_msgs)
        break;
      try {
        if(dests != null)
          disp.callRemoteMethods(dests, call, options);
        else
          disp.callRemoteMethod(dest, call, options);
        if(print > 0 && i % print == 0)
          System.out.println("-- invoked " + i);
      }
      catch(Throwable throwable) {
        throwable.printStackTrace();
      }
    }
  }
}
origin: wildfly/wildfly

public void start(String name) {
  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,Integer.valueOf(xloc),Integer.valueOf(yloc)},
                    new Class[]{String.class,Address.class,int.class,int.class});
    wb.disp.callRemoteMethods(null, call, new RequestOptions(ResponseMode.GET_ALL, 0));
  }
  catch(Exception e) {
    log.error(e.toString());
  }
  repaint();
}
origin: wildfly/wildfly

private void mcastPut(K key, V val, short repl_count, long caching_time, boolean synchronous) {
  try {
    ResponseMode mode=synchronous? ResponseMode.GET_ALL : ResponseMode.GET_NONE;
    disp.callRemoteMethods(null, new MethodCall(PUT, key, val, repl_count, caching_time),
                new RequestOptions(mode, call_timeout));
  }
  catch(Throwable t) {
    if(log.isWarnEnabled())
      log.warn("put() failed", t);
  }
}
origin: wildfly/wildfly

private void mcastClear(Set<K> keys, boolean synchronous) {
  try {
    ResponseMode mode=synchronous? ResponseMode.GET_ALL : ResponseMode.GET_NONE;
    disp.callRemoteMethods(null, new MethodCall(REMOVE_MANY, keys), new RequestOptions(mode, call_timeout));
  }
  catch(Throwable t) {
    if(log.isWarnEnabled())
      log.warn("clear() failed", t);
  }
}
origin: wildfly/wildfly

public void destroy() {
  if (disp != null) {
    try {
      MethodCall call = new MethodCall("removeNode", new Object[] {panel.my_addr}, new Class[] {Object.class});
      disp.callRemoteMethods(null, call, new RequestOptions(ResponseMode.GET_ALL, 5000));
    } catch (Exception e) {
      log.error(e.toString());
    }
    channel.close();
    disp = null;
    if (panel != null) {
      panel.stop();
      panel = null;
    }
  }
}
origin: wildfly/wildfly

public void actionPerformed(ActionEvent e) {
  String command=e.getActionCommand();
  String retval=msg.getText();
  if(retval == null || retval.length() < 1) {
    dispose();
    return;
  }
  try {
    MethodCall call=new MethodCall("displayMessage", new Object[]{sender,retval},
                    new Class[]{String.class,String.class});
    if(command.equals("Send"))
      disp.callRemoteMethod(dest.addr, call, new RequestOptions(ResponseMode.GET_FIRST, 0));
    else if(command.equals("Send to all"))
      disp.callRemoteMethods(null, call, new RequestOptions(ResponseMode.GET_ALL, 0));
  }
  catch(Throwable ex) {
    System.err.println(ex);
  }
  dispose();
}
origin: wildfly/wildfly

long min=Long.MAX_VALUE, max=0;
RequestOptions opts=new RequestOptions(ResponseMode.GET_FIRST, 0).transientFlags(Message.TransientFlag.DONT_LOOPBACK);
MethodCall call=new MethodCall((short)0);
int print=num/10;
for(int i=0; i < num; i++) {
  long start=System.nanoTime();
  RspList<Void> rsps=disp.callRemoteMethods(null, call, opts);
  long time_ns=System.nanoTime() - start;
  if(i > 0 && i % print == 0)
origin: wildfly/wildfly

public void run() {
  Object[] put_args={0, BUFFER};
  Object[] get_args={0};
  MethodCall get_call=new MethodCall(GET, get_args);
  MethodCall put_call=new MethodCall(PUT, put_args);
  RequestOptions get_options=new RequestOptions(ResponseMode.GET_ALL, 40000, false, null);
  RequestOptions put_options=new RequestOptions(sync ? ResponseMode.GET_ALL : ResponseMode.GET_NONE, 40000, true, null);
        pickAnycastTargets(targets);
        long start=System.nanoTime();
        disp.callRemoteMethods(targets, put_call, put_options);
        long put_time=System.nanoTime()-start;
        avg_puts.add(put_time);
org.jgroups.blocksMethodCall<init>

Javadoc

Needed for deserialization

Popular methods of MethodCall

  • invoke
  • findMethod
    Called by the ProbeHandler impl. All args are strings. Needs to find a method where all parameter ty
  • getAllMethods
    The method walks up the class hierarchy and returns all methods of this class and those inherited fr
  • getMethod
    Returns the first method that matches the specified name and parameter types. The overriding methods
  • getName
    returns the name of the method to be invoked using this method call object
  • init
  • args
  • isPrimitiveType
  • method
  • methodId
  • methodName
  • mode
  • methodName,
  • mode,
  • readArgs,
  • readFrom,
  • readMethod,
  • readTypes,
  • setName,
  • writeArgs,
  • writeMethod

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSharedPreferences (Context)
  • scheduleAtFixedRate (Timer)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • JTable (javax.swing)
  • Runner (org.openjdk.jmh.runner)
  • Top 12 Jupyter Notebook Extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now