x.x.x represents the version number.
JavaGroups.zip. This will create a directory JavaGroups.
export CLASSPATH=$CLASSPATH:/home/mydir
(JavaGroups would be in /home/mydir/JavaGroups).
Note that it is probably advisable to add a period (.:) to your CLASSPATH so that
class files in the current directory are found correctly (e.g. for the demo programs).
make available on your system.
make all in the JavaGroups directory. If you also want
to create the iBus adapter (class IbusChannel), type make ibus.
(You need to have the iBus classes if you want to do this).
If you want to create JavaGroups.jar, type make JavaGroups.jar.
This will create the JAR file in the parent directory.
make demos in the root directory.
JChannel which is a pure Java
implementation of a reliable protocol stack. Currently, the default transport does not offer
any reliability guarantees (contrary to Ensemble), but the interface for applications is the
same, regardless of the underlying group transport used.
See the documentation for more information on JChannel.
ENS_PORT,
ENS_GOSSIP_HOSTS and ENS_GOSSIP_PORT etc).
outboard executable somewhere in your PATH. JavaGroups will spawn this
executable in a separate process and therefore needs to find it.
gossip daemon before using JavaGroups in case Ensemble is not
enabled to use IP multicast (see the Ensemble documentation on how to enable/disable
Ensemble for IP multicast).
export CLASSPATH=$CLASSPATH:/mydirectory/ibus_xx.jar
javap JavaGroups.ChannelYou should see the following output if the class is found:
Compiled from Channel.java
public abstract synchronized class JavaGroups.Channel extends java.lang.Object implements JavaGroups.Transportable
/* ACC_SUPER bit set */
{
public abstract void Connect(long);
public abstract void Disconnect();
public abstract void Destroy();
public abstract void Cast(byte[]);
public abstract void Send(java.lang.Object, byte[]);
public abstract void Send(java.util.Vector, byte[]);
public abstract void Send(JavaGroups.Message);
public abstract JavaGroups.Message Receive(long);
public abstract java.util.Vector GetMembers();
public abstract int GetNumMembers();
public abstract void SetMembershipListener(JavaGroups.MembershipListener);
public abstract java.lang.Object GetAddress();
public abstract java.lang.String GetName();
public JavaGroups.Channel();
}
Javap lists the variables and methods of class Channel. If this does not work, the
JavaGroups classes have not been aded correctly to your CLASSPATH. Go back to the installation
instructions to correct this problem.
Draw program:
java DrawA drawing window should appear. Start a second instance. Both instances should change their membership (shown in the title bar) to 2. When drawing the mouse in one window, the second instance should also be updated. As the default group transport uses IP multicast, make sure that - if you want start the 2 instances in different subnets - IP multicast is enabled. If this is not the case, the 2 instances won't 'find' each other and the sample won't work. (See the documentation how to use gossip to solve this problem. Note that the CLASSPATH needs to contain a period (
.:) to find the local Draw class !. If this is not the case,
the JVM will complain that it cannot find class Draw !
Draw program can be run over Ensemble using the -type option when
starting it:
java Draw -type ensJavaGroups tries to start the
outboard executable and waits 2.5 seconds until outboard
is running. Then JavaGroups connects to outboard via a socket. There are several problems that might
occur when trying to run JavaGroups over outboard:
outboard executable is not found. It is probably not in your PATH.
Thread.sleep in file
./Ensemble/HotEnsemble.java and increase its timeout.
gossip daemon is not running. Start gossip before
running the program:
gossip&
IbusChannel). Also ensure
that you have the iBus JAR file in your CLASSPATH:
javap iBus.StackYou should see the contents of this class printed. Run the
Draw program using the
-type option:
java Draw -type ibusThe behavior of the samples should be the same as before.