The application execution scope is controlled using these Deployment Tool parameters:
For example using Figure 2.1, “Distributed Development Architecture”:
-
executes main on Node A, Node B, and Node C.domainname = MyDomain
domaingroup = MyGroup - executes main on Node
A and Node B.
domainnode = Node C - execute mains on node C
only.
The example below is run twice - once with domainname =
Development and once with domainnode = A. The
results are shown.
Example 2.1. Distributed Development
// $Revision: 1.1.2.2 $
package com.kabira.snippets.development;
/**
* Snippet to show program execution on multiple ActiveSpaces(R) Transactions
* nodes
* <p>
* <h2> Target Nodes</h2>
* <ul>
* <li> <b>domainname</b> = Development
* <li> <b>domainnode</b> = A
* </ul>
*/
public class DistributedDevelopment
{
/**
* Main entry point
*
* @param args Not used
*/
public static void main(String [] args)
{
System.out.println("Welcome to ActiveSpaces Transactions");
}
}
Here is the output using domainname =
.Development
[A] Welcome to ActiveSpaces® Transactions [C] Welcome to ActiveSpaces® Transactions [B] Welcome to ActiveSpaces® Transactions INFO: Application [com.kabira.snippets.development.DistributedDevelopment] running on node [A] exited with status [0] INFO: Application [com.kabira.snippets.development.DistributedDevelopment] running on node [C] exited with status [0] INFO: Application [com.kabira.snippets.development.DistributedDevelopment] running on node [B] exited with status [0] INFO: Run of distributed application [com.kabira.snippets.development.DistributedDevelopment] complete. INFO: Application [com.kabira.snippets.development.DistributedDevelopment] exited with status [0].
Here is the output using .domainnode =
A
[A] Welcome to ActiveSpaces® Transactions INFO: Application [com.kabira.snippets.development.DistributedDevelopment1] running on node [A] exited with status [0] INFO: Run of distributed application [com.kabira.snippets.development.DistributedDevelopment1] complete.
See the section called “Deployment example” for details on running this example from the command line.