[jboss-user] [Clustering/JBoss] - Re: Communication between nodes

bstansberry@jboss.com do-not-reply at jboss.com
Fri May 1 13:09:53 EDT 2009


No, you can't get access to the JChannel, and if you did that send() call wouldn't work.  HAServiceMBeanSupport provides a callMethodOnPartition method that lets you invoke an RPC on the group; you could pass the target node as a param.

If you can use AS 5.1 (now in CR1 release) HAPartition also exposes methods for making RPCs solely on target nodes:

    /**
     * Calls method synchronously on target node only.
     * @param serviceName Name of the target service name on which calls are de-multiplexed
     * @param methodName name of the Java method to be called on remote services
     * @param args array of Java Object representing the set of parameters to be
     * given to the remote method
     * @param types The types of the parameters
     * node of the partition or only on remote nodes
     * @param targetNode is the target of the call
     * @return the value returned by the target method
     * @throws Exception Throws if a communication exception occurs
     */
   public Object callMethodOnNode(String serviceName, String methodName,
           Object[] args, Class[] types, long methodTimeout, ClusterNode targetNode) throws Throwable;

   /**
     * Calls method on target node only.
     * @param serviceName Name of the target service name on which calls are de-multiplexed
     * @param methodName name of the Java method to be called on remote services
     * @param args array of Java Object representing the set of parameters to be
     * given to the remote method
     * @param types The types of the parameters
     * node of the partition or only on remote nodes
     * @param targetNode is the target of the call
     * 
     * @throws Exception Throws if a communication exception occurs
     */
   public void callAsyncMethodOnNode(String serviceName, String methodName,
           Object[] args, Class[] types, long methodTimeout, ClusterNode targetNode) throws Throwable;

There's no convenience method to expose that via HAServiceMBeanSupport, but that's not hard for you to implement.

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4228065#4228065

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4228065



More information about the jboss-user mailing list