public class GridTcpDiscoverySharedFsIpFinder extends GridTcpDiscoveryIpFinderAdapter
setPath(String))GridTcpDiscoveryIpFinderAdapter.setShared(boolean))
If getPath() is not provided, then DFLT_PATH will be used and
only local nodes will discover each other. To enable discovery over network
you must provide a path to a shared directory explicitly.
The directory will contain empty files named like the following 192.168.1.136#1001.
Note that this finder is shared by default (see GridTcpDiscoveryIpFinder.isShared().
| Modifier and Type | Field and Description |
|---|---|
static String |
DELIM
Delimiter to use between address and port tokens in file names.
|
static String |
DFLT_PATH
Default path for discovering of local nodes (testing only).
|
| Constructor and Description |
|---|
GridTcpDiscoverySharedFsIpFinder()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getPath()
Gets path.
|
Collection<InetSocketAddress> |
getRegisteredAddresses()
Gets all addresses registered in this finder.
|
void |
registerAddresses(Collection<InetSocketAddress> addrs)
Registers new addresses.
|
void |
setPath(String path)
Sets path.
|
String |
toString() |
void |
unregisterAddresses(Collection<InetSocketAddress> addrs)
Unregisters provided addresses.
|
close, initializeLocalAddresses, isShared, onSpiContextDestroyed, onSpiContextInitialized, setShared, spiContextpublic static final String DFLT_PATH
GRIDGAIN_HOME/work folder if GRIDGAIN_HOME system or environment variable specified,
otherwise it is relative to work folder under system java.io.tmpdir folder.public static final String DELIM
public GridTcpDiscoverySharedFsIpFinder()
public String getPath()
@GridSpiConfiguration(optional=true) public void setPath(String path)
path - Shared path.public Collection<InetSocketAddress> getRegisteredAddresses() throws GridSpiException
null.GridSpiException - In case of error.public void registerAddresses(Collection<InetSocketAddress> addrs) throws GridSpiException
Implementation should accept duplicates quietly, but should not register address if it is already registered.
addrs - Addresses to register. Not null and not empty.GridSpiException - In case of error.public void unregisterAddresses(Collection<InetSocketAddress> addrs) throws GridSpiException
Implementation should accept addresses that are currently not registered quietly (just no-op).
addrs - Addresses to unregister. Not null and not empty.GridSpiException - In case of error.public String toString()
toString in class GridTcpDiscoveryIpFinderAdapterCopyright © 2014. All rights reserved.