Class GridClientFactory
- java.lang.Object
-
- org.apache.ignite.internal.client.GridClientFactory
-
public class GridClientFactory extends Object
Client factory opens and closes clients. It also tracks all currently opened clients as well.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static GridClientstart(GridClientConfiguration cfg)Starts a client with given configuration.static GridClientBeforeNodeStartstartBeforeNodeStart(GridClientConfiguration cfg)Starts a client before node start with given configuration.static voidstop(UUID clientId)Waits for all pending requests for a particular client to be completed (no new requests will be accepted) and then closes the client.static voidstop(UUID clientId, boolean wait)Stops particular client.static voidstopAll()Waits for all open clients to finish their operations and stops them, This method is equivalent tostopAll(true)method invocation.static voidstopAll(boolean wait)Stops all currently open clients.
-
-
-
Method Detail
-
start
public static GridClient start(GridClientConfiguration cfg) throws GridClientException
Starts a client with given configuration. Starting client will be assigned a randomly generated UUID which can be obtained byGridClient.id()method.- Parameters:
cfg- Client configuration.- Returns:
- Started client.
- Throws:
GridClientException- If client could not be created.
-
startBeforeNodeStart
public static GridClientBeforeNodeStart startBeforeNodeStart(GridClientConfiguration cfg) throws GridClientException
Starts a client before node start with given configuration. If node has already started, there will be an error.- Parameters:
cfg- Client configuration.- Returns:
- Started client.
- Throws:
GridClientException- If client could not be created.
-
stopAll
public static void stopAll()
Waits for all open clients to finish their operations and stops them, This method is equivalent tostopAll(true)method invocation.- See Also:
stopAll(boolean)
-
stopAll
public static void stopAll(boolean wait)
Stops all currently open clients.- Parameters:
wait- Iftruethen each client will wait to finish all ongoing requests before closing (however, no new requests will be accepted). Iffalse, clients will be closed immediately and all ongoing requests will be failed.
-
stop
public static void stop(UUID clientId)
Waits for all pending requests for a particular client to be completed (no new requests will be accepted) and then closes the client. This method is equivalent tostop(clientId, true).- Parameters:
clientId- Identifier of client to close.- See Also:
stop(UUID, boolean)
-
stop
public static void stop(UUID clientId, boolean wait)
Stops particular client.- Parameters:
clientId- Client identifier to close.wait- Iftruethen client will wait to finish all ongoing requests before closing (however, no new requests will be accepted). Iffalse, client will be closed immediately and all ongoing requests will be failed.
-
-