public class Scalaris extends Object
Instances of this class can be generated using a given connection to a
scalaris node (Scalaris(Connection)
) or without a
connection (Scalaris()
) in which case a new connection
is created using ConnectionFactory.createConnection()
.
Constructor and Description |
---|
Scalaris()
Constructor, uses the default connection returned by
ConnectionFactory.createConnection() . |
Scalaris(Connection conn)
Constructor, uses the given connection to an erlang node.
|
Modifier and Type | Method and Description |
---|---|
void |
closeConnection()
Closes the transaction's connection to a scalaris node.
|
List<String> |
getRandomNodes(int max)
Retrieves random nodes from Scalaris for use by
ConnectionFactory.addNode(String) or ScalarisVM . |
public Scalaris() throws ConnectionException
ConnectionFactory.createConnection()
.ConnectionException
- if the connection failspublic Scalaris(Connection conn)
conn
- connection to use for the transactionpublic List<String> getRandomNodes(int max) throws ConnectionException, UnknownException
ConnectionFactory.addNode(String)
or ScalarisVM
.max
- maximum number of nodes to return (> 0)ConnectionException
- if the connection is not active or a communication error
occurs or an exit signal was received or the remote node
sends a message containing an invalid cookieUnknownException
- if any other error occurspublic void closeConnection()
ConnectionException
s!