/** * Gets an instance of default no-name grid. Note that * caller of this method should not assume that it will return the same * instance every time. * <p> * This method is identical to {@code G.grid(null)} apply. * * @return An instance of default no-name grid. This method never returns * {@code null}. * @throws GridIllegalStateException Thrown if default grid was not properly * initialized or grid instance was stopped or was not started. */ public static Grid grid() throws GridIllegalStateException { return grid((String)null); }
/** * Gets an instance of default no-name grid. Note that * caller of this method should not assume that it will return the same * instance every time. * <p> * This method is identical to {@code G.grid(null)} apply. * * @return An instance of default no-name grid. This method never returns * {@code null}. * @throws GridIllegalStateException Thrown if default grid was not properly * initialized or grid instance was stopped or was not started. */ public static Grid grid() throws GridIllegalStateException { return GridGainEx.grid(); }
/** * Gets a grid instance for given local node ID. Note that grid instance and local node have * one-to-one relationship where node has ID and instance has name of the grid to which * both grid instance and its node belong. Note also that caller of this method * should not assume that it will return the same instance every time. * * @param locNodeId ID of local node the requested grid instance is managing. * @return An instance of named grid. This method never returns * {@code null}. * @throws GridIllegalStateException Thrown if grid was not properly * initialized or grid instance was stopped or was not started. */ public static Grid grid(UUID locNodeId) throws GridIllegalStateException { return GridGainEx.grid(locNodeId); }
/** * Gets an named grid instance. If grid name is {@code null} or empty string, * then default no-name grid will be returned. Note that caller of this method * should not assume that it will return the same instance every time. * <p> * Note that Java VM can run multiple grid instances and every grid instance (and its * node) can belong to a different grid. Grid name defines what grid a particular grid * instance (and correspondingly its node) belongs to. * * @param name Grid name to which requested grid instance belongs to. If {@code null}, * then grid instance belonging to a default no-name grid will be returned. * @return An instance of named grid. This method never returns * {@code null}. * @throws GridIllegalStateException Thrown if default grid was not properly * initialized or grid instance was stopped or was not started. */ public static Grid grid(@Nullable String name) throws GridIllegalStateException { return GridGainEx.grid(name); }