public class Bridge
extends java.lang.Object
A notifyAll
call is made on
the Bridge object whenever the number of live hubs connected by
the bridge changes.
Modifier and Type | Field and Description |
---|---|
private static java.util.logging.Logger |
logger_ |
private ProxyManager[] |
proxyManagers_ |
Constructor and Description |
---|
Bridge(ClientProfile[] profiles)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
exportUrls(int index,
java.lang.String host)
Sets up a URL exporter for one of the hubs.
|
HubConnector[] |
getBridgeClients()
Returns the hub connectors representing the bridge client running
on each linked hub.
|
private int |
getConnectionCount()
Returns the number of hubs currently connected by this bridge.
|
ClientProfile[] |
getProfiles()
Returns the client profiles which define the hubs this bridge links.
|
private static boolean |
isLocalHost(java.lang.String host)
Indicates whether a given hostname corresponds to the local host.
|
static void |
main(java.lang.String[] args)
Main method.
|
static int |
runMain(java.lang.String[] args)
Does the work for the main method.
|
boolean |
start()
Starts this bridge running.
|
void |
stop()
Stops this bridge running.
|
private final ProxyManager[] proxyManagers_
private static final java.util.logging.Logger logger_
public Bridge(ClientProfile[] profiles) throws java.io.IOException
profiles
- array of SAMP profile objects, one for each
hub which is to participate in the bridgejava.io.IOException
public ClientProfile[] getProfiles()
public HubConnector[] getBridgeClients()
public void exportUrls(int index, java.lang.String host)
index
- index of the profile for which to export URLshost
- the name substitute for loopback host identifiers
on the host on which that profile's hub is runningpublic boolean start()
public void stop()
private int getConnectionCount()
private static boolean isLocalHost(java.lang.String host)
host
- hostname to testhost
is known to be the local hostpublic static void main(java.lang.String[] args) throws java.io.IOException
java.io.IOException
public static int runMain(java.lang.String[] args) throws java.io.IOException
java.io.IOException