Class IgnitionEx


  • public class IgnitionEx
    extends Object
    This class is part of an internal API and can be modified at any time without backward compatibility. This class defines a factory for the main Ignite API. It controls Grid life cycle and allows listening for grid events.

    Grid Loaders

    Although user can apply grid factory directly to start and stop grid, grid is often started and stopped by grid loaders. Grid loaders can be found in org.apache.ignite.startup package, for example:
    • CommandLineStartup
    • ServletStartup

    Examples

    Use start() method to start grid with default configuration. You can also use IgniteConfiguration to override some default configuration. Below is an example on how to start grid with URI deployment.
     GridConfiguration cfg = new GridConfiguration();
    • Method Detail

      • setClientMode

        public static void setClientMode​(boolean clientMode)
        Sets client mode flag.
        Parameters:
        clientMode - Client mode flag.
      • isClientMode

        public static boolean isClientMode()
        Gets client mode flag.
        Returns:
        Client mode flag.
      • state

        public static IgniteState state()
        Gets state of grid default grid.
        Returns:
        Default grid state.
      • state

        public static IgniteState state​(@Nullable
                                        @Nullable String name)
        Gets states of named Ignite instance. If name is null, then state of default no-name Ignite instance is returned.
        Parameters:
        name - Ignite instance name. If name is null, then state of default no-name Ignite instance is returned.
        Returns:
        Grid state.
      • stop

        public static boolean stop​(boolean cancel,
                                   @Nullable
                                   @Nullable ShutdownPolicy shutdown)
        Stops default grid. This method is identical to G.stop(null, cancel) apply. Note that method does not wait for all tasks to be completed.
        Parameters:
        cancel - If true then all jobs currently executing on default grid will be cancelled by calling ComputeJob.cancel() method. Note that just like with Thread.interrupt(), it is up to the actual job to exit from execution
        shutdown - If this parameter is set explicitly this policy will use for stopping node. If this parameter is null common cluster policy will be use.
        Returns:
        true if default grid instance was indeed stopped, false otherwise (if it was not started).
      • stop

        public static boolean stop​(@Nullable
                                   @Nullable String name,
                                   boolean cancel,
                                   @Nullable
                                   @Nullable ShutdownPolicy shutdown,
                                   boolean stopNotStarted)
        Stops named Ignite instance. If cancel flag is set to true then all jobs currently executing on local node will be interrupted. If Ignite instance name is null, then default no-name Ignite instance will be stopped. If wait parameter is set to true then Ignite instance will wait for all tasks to be finished.
        Parameters:
        name - Ignite instance name. If null, then default no-name Ignite instance will be stopped.
        cancel - If true then all jobs currently will be cancelled by calling ComputeJob.cancel() method. Note that just like with Thread.interrupt(), it is up to the actual job to exit from execution. If false, then jobs currently running will not be canceled. In either case, grid node will wait for completion of all jobs running on it before stopping.
        shutdown - If this parameter is set explicitly this policy will use for stopping node. If this parameter is null common cluster policy will be use.
        stopNotStarted - If true and node start did not finish then interrupts starting thread.
        Returns:
        true if named Ignite instance was indeed found and stopped, false otherwise (the instance with given name was not found).
      • stop

        @Deprecated
        public static boolean stop​(@Nullable
                                   @Nullable String name,
                                   boolean cancel,
                                   boolean stopNotStarted,
                                   long timeoutMs)
        Deprecated.
        Behavior of the method is the almost same as stop(boolean, ShutdownPolicy). If node stopping process will not be finished within timeoutMs whole JVM will be killed.
        Parameters:
        timeoutMs - Timeout to wait graceful stopping.
      • stopAll

        public static void stopAll​(boolean cancel,
                                   @Nullable
                                   @Nullable ShutdownPolicy shutdown)
        Stops all started grids. If cancel flag is set to true then all jobs currently executing on local node will be interrupted. If wait parameter is set to true then grid will wait for all tasks to be finished.

        Note: it is usually safer and more appropriate to stop grid instances individually instead of blanket operation. In most cases, the party that started the grid instance should be responsible for stopping it.

        Parameters:
        cancel - If true then all jobs currently executing on all grids will be cancelled by calling ComputeJob.cancel() method. Note that just like with Thread.interrupt(), it is up to the actual job to exit from execution
        shutdown - If this parameter is set explicitly this policy will use for stopping node. If this parameter is null common cluster policy will be use.
      • restart

        public static void restart​(boolean cancel)
        Restarts all started grids. If cancel flag is set to true then all jobs currently executing on the local node will be interrupted. If wait parameter is set to true then grid will wait for all tasks to be finished.

        Note: it is usually safer and more appropriate to stop grid instances individually instead of blanket operation. In most cases, the party that started the grid instance should be responsible for stopping it.

        Note also that restarting functionality only works with the tools that specifically support Ignite's protocol for restarting. Currently only standard ignite.{sh|bat} scripts support restarting of JVM Ignite's process.

        Parameters:
        cancel - If true then all jobs currently executing on all grids will be cancelled by calling ComputeJob.cancel() method. Note that just like with Thread.interrupt(), it is up to the actual job to exit from execution.
        See Also:
        Ignition.RESTART_EXIT_CODE
      • kill

        public static void kill​(boolean cancel)
        Stops all started grids. If cancel flag is set to true then all jobs currently executing on the local node will be interrupted. If wait parameter is set to true then grid will wait for all tasks to be finished.

        Note: it is usually safer and more appropriate to stop grid instances individually instead of blanket operation. In most cases, the party that started the grid instance should be responsible for stopping it.

        Note that upon completion of this method, the JVM with forcefully exist with exit code Ignition.KILL_EXIT_CODE.

        Parameters:
        cancel - If true then all jobs currently executing on all grids will be cancelled by calling ComputeJob.cancel() method. Note that just like with Thread.interrupt(), it is up to the actual job to exit from execution.
        See Also:
        Ignition.KILL_EXIT_CODE
      • start

        public static Ignite start()
                            throws IgniteCheckedException
        Starts grid with default configuration. By default this method will use grid configuration defined in IGNITE_HOME/config/default-config.xml configuration file. If such file is not found, then all system defaults will be used.
        Returns:
        Started grid.
        Throws:
        IgniteCheckedException - If default grid could not be started. This exception will be thrown also if default grid has already been started.
      • start

        public static Ignite start​(@Nullable
                                   @Nullable GridSpringResourceContext springCtx)
                            throws IgniteCheckedException
        Starts grid with default configuration. By default this method will use grid configuration defined in IGNITE_HOME/config/default-config.xml configuration file. If such file is not found, then all system defaults will be used.
        Parameters:
        springCtx - Optional Spring application context, possibly null. Spring bean definitions for bean injection are taken from this context. If provided, this context can be injected into grid tasks and grid jobs using @SpringApplicationContextResource annotation.
        Returns:
        Started grid.
        Throws:
        IgniteCheckedException - If default grid could not be started. This exception will be thrown also if default grid has already been started.
      • start

        public static Ignite start​(IgniteConfiguration cfg)
                            throws IgniteCheckedException
        Starts grid with given configuration. Note that this method is no-op if grid with the name provided in given configuration is already started.
        Parameters:
        cfg - Grid configuration. This cannot be null.
        Returns:
        Started grid.
        Throws:
        IgniteCheckedException - If grid could not be started. This exception will be thrown also if named grid has already been started.
      • start

        public static Ignite start​(IgniteConfiguration cfg,
                                   boolean failIfStarted)
                            throws IgniteCheckedException
        Starts a grid with given configuration. If the grid is already started and failIfStarted set to TRUE an exception will be thrown.
        Parameters:
        cfg - Grid configuration. This cannot be null.
        failIfStarted - When flag is true and grid with specified name has been already started the exception is thrown. Otherwise the existing instance of the grid is returned.
        Returns:
        Started grid or existing grid.
        Throws:
        IgniteCheckedException - If grid could not be started. This exception will be thrown also if named grid has already been started.
      • getOrStart

        public static T2<Ignite,​Boolean> getOrStart​(IgniteConfiguration cfg)
                                                   throws IgniteException
        Gets or starts new grid instance if it hasn't been started yet.
        Parameters:
        cfg - Grid configuration. This cannot be null.
        Returns:
        Tuple with: grid instance and flag to indicate the instance is started by this call. So, when the new ignite instance is started the flag is true. If an existing instance is returned the flag is false.
        Throws:
        IgniteException - If grid could not be started.
      • start

        public static Ignite start​(IgniteConfiguration cfg,
                                   @Nullable
                                   @Nullable GridSpringResourceContext springCtx)
                            throws IgniteCheckedException
        Starts grid with given configuration. Note that this method will throw and exception if grid with the name provided in given configuration is already started.
        Parameters:
        cfg - Grid configuration. This cannot be null.
        springCtx - Optional Spring application context, possibly null. Spring bean definitions for bean injection are taken from this context. If provided, this context can be injected into grid tasks and grid jobs using @SpringApplicationContextResource annotation.
        Returns:
        Started grid.
        Throws:
        IgniteCheckedException - If grid could not be started. This exception will be thrown also if named grid has already been started.
      • start

        public static T2<Ignite,​Boolean> start​(IgniteConfiguration cfg,
                                                     @Nullable
                                                     @Nullable GridSpringResourceContext springCtx,
                                                     boolean failIfStarted)
                                              throws IgniteCheckedException
        Starts grid with given configuration. If the grid is already started and failIfStarted set to TRUE an exception will be thrown.
        Parameters:
        cfg - Grid configuration. This cannot be null.
        springCtx - Optional Spring application context, possibly null. Spring bean definitions for bean injection are taken from this context. If provided, this context can be injected into grid tasks and grid jobs using @SpringApplicationContextResource annotation.
        failIfStarted - Throw or not an exception if grid is already started.
        Returns:
        Tuple with: grid instance and flag to indicate the instance is started by this call. So, when the new ignite instance is started the flag is true. If an existing instance is returned the flag is false.
        Throws:
        IgniteCheckedException - If grid could not be started. This exception will be thrown also if named grid has already been started.
      • start

        public static Ignite start​(@Nullable
                                   @Nullable String springCfgPath)
                            throws IgniteCheckedException
        Starts all grids specified within given Spring XML configuration file. If grid with given name is already started, then exception is thrown. In this case all instances that may have been started so far will be stopped too.

        Usually Spring XML configuration file will contain only one Grid definition. Note that Grid configuration bean(s) is retrieved form configuration file by type, so the name of the Grid configuration bean is ignored.

        Parameters:
        springCfgPath - Spring XML configuration file path or URL.
        Returns:
        Started grid. If Spring configuration contains multiple grid instances, then the 1st found instance is returned.
        Throws:
        IgniteCheckedException - If grid could not be started or configuration read. This exception will be thrown also if grid with given name has already been started or Spring XML configuration file is invalid.
      • start

        public static Ignite start​(@Nullable
                                   @Nullable String springCfgPath,
                                   @Nullable
                                   @Nullable String igniteInstanceName)
                            throws IgniteCheckedException
        Starts all grids specified within given Spring XML configuration file. If grid with given name is already started, then exception is thrown. In this case all instances that may have been started so far will be stopped too.

        Usually Spring XML configuration file will contain only one Grid definition. Note that Grid configuration bean(s) is retrieved form configuration file by type, so the name of the Grid configuration bean is ignored.

        Parameters:
        springCfgPath - Spring XML configuration file path or URL.
        igniteInstanceName - Ignite instance name that will override default.
        Returns:
        Started grid. If Spring configuration contains multiple grid instances, then the 1st found instance is returned.
        Throws:
        IgniteCheckedException - If grid could not be started or configuration read. This exception will be thrown also if grid with given name has already been started or Spring XML configuration file is invalid.
      • loadConfigurations

        public static IgniteBiTuple<Collection<IgniteConfiguration>,​? extends GridSpringResourceContext> loadConfigurations​(URL springCfgUrl)
                                                                                                                           throws IgniteCheckedException
        Loads all grid configurations specified within given Spring XML configuration file.

        Usually Spring XML configuration file will contain only one Grid definition. Note that Grid configuration bean(s) is retrieved form configuration file by type, so the name of the Grid configuration bean is ignored.

        Parameters:
        springCfgUrl - Spring XML configuration file path or URL. This cannot be null.
        Returns:
        Tuple containing all loaded configurations and Spring context used to load them.
        Throws:
        IgniteCheckedException - If grid could not be started or configuration read. This exception will be thrown also if grid with given name has already been started or Spring XML configuration file is invalid.
      • loadConfigurations

        public static IgniteBiTuple<Collection<IgniteConfiguration>,​? extends GridSpringResourceContext> loadConfigurations​(InputStream springCfgStream)
                                                                                                                           throws IgniteCheckedException
        Loads all grid configurations specified within given input stream.

        Usually Spring XML input stream will contain only one Grid definition. Note that Grid configuration bean(s) is retrieved form configuration input stream by type, so the name of the Grid configuration bean is ignored.

        Parameters:
        springCfgStream - Input stream contained Spring XML configuration. This cannot be null.
        Returns:
        Tuple containing all loaded configurations and Spring context used to load them.
        Throws:
        IgniteCheckedException - If grid could not be started or configuration read. This exception will be thrown also if grid with given name has already been started or Spring XML configuration file is invalid.
      • loadConfigurations

        public static IgniteBiTuple<Collection<IgniteConfiguration>,​? extends GridSpringResourceContext> loadConfigurations​(String springCfgPath)
                                                                                                                           throws IgniteCheckedException
        Loads all grid configurations specified within given Spring XML configuration file.

        Usually Spring XML configuration file will contain only one Grid definition. Note that Grid configuration bean(s) is retrieved form configuration file by type, so the name of the Grid configuration bean is ignored.

        Parameters:
        springCfgPath - Spring XML configuration file path. This cannot be null.
        Returns:
        Tuple containing all loaded configurations and Spring context used to load them.
        Throws:
        IgniteCheckedException - If grid could not be started or configuration read. This exception will be thrown also if grid with given name has already been started or Spring XML configuration file is invalid.
      • loadConfiguration

        public static IgniteBiTuple<IgniteConfiguration,​GridSpringResourceContext> loadConfiguration​(URL springCfgUrl)
                                                                                                    throws IgniteCheckedException
        Loads first found grid configuration specified within given Spring XML configuration file.

        Usually Spring XML configuration file will contain only one Grid definition. Note that Grid configuration bean(s) is retrieved form configuration file by type, so the name of the Grid configuration bean is ignored.

        Parameters:
        springCfgUrl - Spring XML configuration file path or URL. This cannot be null.
        Returns:
        First found configuration and Spring context used to load it.
        Throws:
        IgniteCheckedException - If grid could not be started or configuration read. This exception will be thrown also if grid with given name has already been started or Spring XML configuration file is invalid.
      • loadConfiguration

        public static IgniteBiTuple<IgniteConfiguration,​GridSpringResourceContext> loadConfiguration​(String springCfgPath)
                                                                                                    throws IgniteCheckedException
        Loads first found grid configuration specified within given Spring XML configuration file.

        Usually Spring XML configuration file will contain only one Grid definition. Note that Grid configuration bean(s) is retrieved form configuration file by type, so the name of the Grid configuration bean is ignored.

        Parameters:
        springCfgPath - Spring XML configuration file path. This cannot be null.
        Returns:
        First found configuration and Spring context used to load it.
        Throws:
        IgniteCheckedException - If grid could not be started or configuration read. This exception will be thrown also if grid with given name has already been started or Spring XML configuration file is invalid.
      • start

        public static Ignite start​(String springCfgPath,
                                   @Nullable
                                   @Nullable String igniteInstanceName,
                                   @Nullable
                                   @Nullable GridSpringResourceContext springCtx,
                                   @Nullable
                                   @Nullable ClassLoader ldr)
                            throws IgniteCheckedException
        Starts all grids specified within given Spring XML configuration file. If grid with given name is already started, then exception is thrown. In this case all instances that may have been started so far will be stopped too.

        Usually Spring XML configuration file will contain only one Grid definition. Note that Grid configuration bean(s) is retrieved form configuration file by type, so the name of the Grid configuration bean is ignored.

        Parameters:
        springCfgPath - Spring XML configuration file path or URL. This cannot be null.
        igniteInstanceName - Ignite instance name that will override default.
        springCtx - Optional Spring application context, possibly null.
        ldr - Optional class loader that will be used by default. Spring bean definitions for bean injection are taken from this context. If provided, this context can be injected into grid tasks and grid jobs using @SpringApplicationContextResource annotation.
        Returns:
        Started grid. If Spring configuration contains multiple grid instances, then the 1st found instance is returned.
        Throws:
        IgniteCheckedException - If grid could not be started or configuration read. This exception will be thrown also if grid with given name has already been started or Spring XML configuration file is invalid.
      • start

        public static Ignite start​(URL springCfgUrl)
                            throws IgniteCheckedException
        Starts all grids specified within given Spring XML configuration file URL. If grid with given name is already started, then exception is thrown. In this case all instances that may have been started so far will be stopped too.

        Usually Spring XML configuration file will contain only one Grid definition. Note that Grid configuration bean(s) is retrieved form configuration file by type, so the name of the Grid configuration bean is ignored.

        Parameters:
        springCfgUrl - Spring XML configuration file URL. This cannot be null.
        Returns:
        Started grid. If Spring configuration contains multiple grid instances, then the 1st found instance is returned.
        Throws:
        IgniteCheckedException - If grid could not be started or configuration read. This exception will be thrown also if grid with given name has already been started or Spring XML configuration file is invalid.
      • start

        public static Ignite start​(URL springCfgUrl,
                                   @Nullable
                                   @Nullable ClassLoader ldr)
                            throws IgniteCheckedException
        Starts all grids specified within given Spring XML configuration file URL. If grid with given name is already started, then exception is thrown. In this case all instances that may have been started so far will be stopped too.

        Usually Spring XML configuration file will contain only one Grid definition. Note that Grid configuration bean(s) is retrieved form configuration file by type, so the name of the Grid configuration bean is ignored.

        Parameters:
        springCfgUrl - Spring XML configuration file URL. This cannot be null.
        ldr - Optional class loader that will be used by default.
        Returns:
        Started grid. If Spring configuration contains multiple grid instances, then the 1st found instance is returned.
        Throws:
        IgniteCheckedException - If grid could not be started or configuration read. This exception will be thrown also if grid with given name has already been started or Spring XML configuration file is invalid.
      • start

        public static Ignite start​(URL springCfgUrl,
                                   @Nullable
                                   @Nullable String igniteInstanceName,
                                   @Nullable
                                   @Nullable GridSpringResourceContext springCtx,
                                   @Nullable
                                   @Nullable ClassLoader ldr)
                            throws IgniteCheckedException
        Starts all grids specified within given Spring XML configuration file URL. If grid with given name is already started, then exception is thrown. In this case all instances that may have been started so far will be stopped too.

        Usually Spring XML configuration file will contain only one Grid definition. Note that Grid configuration bean(s) is retrieved form configuration file by type, so the name of the Grid configuration bean is ignored.

        Parameters:
        springCfgUrl - Spring XML configuration file URL. This cannot be null.
        igniteInstanceName - Ignite instance name that will override default.
        springCtx - Optional Spring application context, possibly null.
        ldr - Optional class loader that will be used by default. Spring bean definitions for bean injection are taken from this context. If provided, this context can be injected into grid tasks and grid jobs using @SpringApplicationContextResource annotation.
        Returns:
        Started grid. If Spring configuration contains multiple grid instances, then the 1st found instance is returned.
        Throws:
        IgniteCheckedException - If grid could not be started or configuration read. This exception will be thrown also if grid with given name has already been started or Spring XML configuration file is invalid.
      • start

        public static Ignite start​(InputStream springCfgStream)
                            throws IgniteCheckedException
        Starts all grids specified within given Spring XML configuration input stream. If grid with given name is already started, then exception is thrown. In this case all instances that may have been started so far will be stopped too.

        Usually Spring XML configuration input stream will contain only one Grid definition. Note that Grid configuration bean(s) is retrieved form configuration input stream by type, so the name of the Grid configuration bean is ignored.

        Parameters:
        springCfgStream - Input stream containing Spring XML configuration. This cannot be null.
        Returns:
        Started grid. If Spring configuration contains multiple grid instances, then the 1st found instance is returned.
        Throws:
        IgniteCheckedException - If grid could not be started or configuration read. This exception will be thrown also if grid with given name has already been started or Spring XML configuration file is invalid.
      • start

        public static Ignite start​(InputStream springCfgStream,
                                   @Nullable
                                   @Nullable String igniteInstanceName,
                                   @Nullable
                                   @Nullable GridSpringResourceContext springCtx,
                                   @Nullable
                                   @Nullable ClassLoader ldr)
                            throws IgniteCheckedException
        Starts all grids specified within given Spring XML configuration input stream. If grid with given name is already started, then exception is thrown. In this case all instances that may have been started so far will be stopped too.

        Usually Spring XML configuration input stream will contain only one Grid definition. Note that Grid configuration bean(s) is retrieved form configuration input stream by type, so the name of the Grid configuration bean is ignored.

        Parameters:
        springCfgStream - Input stream containing Spring XML configuration. This cannot be null.
        igniteInstanceName - Ignite instance name that will override default.
        springCtx - Optional Spring application context, possibly null.
        ldr - Optional class loader that will be used by default. Spring bean definitions for bean injection are taken from this context. If provided, this context can be injected into grid tasks and grid jobs using @SpringApplicationContextResource annotation.
        Returns:
        Started grid. If Spring configuration contains multiple grid instances, then the 1st found instance is returned.
        Throws:
        IgniteCheckedException - If grid could not be started or configuration read. This exception will be thrown also if grid with given name has already been started or Spring XML configuration file is invalid.
      • loadSpringBean

        public static <T> T loadSpringBean​(String springXmlPath,
                                           String beanName)
                                    throws IgniteCheckedException
        Loads spring bean by name.
        Parameters:
        springXmlPath - Spring XML file path.
        beanName - Bean name.
        Returns:
        Bean instance.
        Throws:
        IgniteCheckedException - In case of error.
      • loadSpringBean

        public static <T> T loadSpringBean​(URL springXmlUrl,
                                           String beanName)
                                    throws IgniteCheckedException
        Loads spring bean by name.
        Parameters:
        springXmlUrl - Spring XML file URL.
        beanName - Bean name.
        Returns:
        Bean instance.
        Throws:
        IgniteCheckedException - In case of error.
      • loadSpringBean

        public static <T> T loadSpringBean​(InputStream springXmlStream,
                                           String beanName)
                                    throws IgniteCheckedException
        Loads spring bean by name.
        Parameters:
        springXmlStream - Input stream containing Spring XML configuration.
        beanName - Bean name.
        Returns:
        Bean instance.
        Throws:
        IgniteCheckedException - In case of error.
      • grid

        public static Ignite grid()
                           throws IgniteIllegalStateException
        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.
        Returns:
        An instance of default no-name grid. This method never returns null.
        Throws:
        IgniteIllegalStateException - Thrown if default grid was not properly initialized or grid instance was stopped or was not started.
      • allGrids

        public static List<Ignite> allGrids()
        Gets a list of all grids started so far.
        Returns:
        List of all grids started so far.
      • allGridsx

        public static List<Ignite> allGridsx()
        Gets a list of all grids started so far.
        Returns:
        List of all grids started so far.
      • grid

        public static Ignite grid​(UUID locNodeId)
                           throws IgniteIllegalStateException
        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.
        Parameters:
        locNodeId - ID of local node the requested grid instance is managing.
        Returns:
        An instance of named grid. This method never returns null.
        Throws:
        IgniteIllegalStateException - Thrown if grid was not properly initialized or grid instance was stopped or was not started.
      • gridxx

        public static IgniteKernal gridxx​(UUID locNodeId)
        Gets grid instance without waiting its initialization and not throwing any exception.
        Parameters:
        locNodeId - ID of local node the requested grid instance is managing.
        Returns:
        Grid instance or null.
      • grid

        public static Ignite grid​(@Nullable
                                  @Nullable String name)
                           throws IgniteIllegalStateException
        Gets an named grid instance. If grid name is 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.

        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.

        Parameters:
        name - Grid name to which requested grid instance belongs to. If null, then grid instance belonging to a default no-name grid will be returned.
        Returns:
        An instance of named grid. This method never returns null.
        Throws:
        IgniteIllegalStateException - Thrown if default grid was not properly initialized or grid instance was stopped or was not started.
      • gridx

        public static IgniteKernal gridx​(@Nullable
                                         @Nullable String name)
        Gets grid instance without waiting its initialization.
        Parameters:
        name - Grid name.
        Returns:
        Grid instance.
      • addListener

        public static void addListener​(IgnitionListener lsnr)
        Adds a lsnr for grid life cycle events.

        Note that unlike other listeners in Ignite this listener will be notified from the same thread that triggers the state change. Because of that it is the responsibility of the user to make sure that listener logic is light-weight and properly handles (catches) any runtime exceptions, if any are expected.

        Parameters:
        lsnr - Listener for grid life cycle events. If this listener was already added this method is no-op.
      • removeListener

        public static boolean removeListener​(IgnitionListener lsnr)
        Removes lsnr added by addListener(IgnitionListener) method.
        Parameters:
        lsnr - Listener to remove.
        Returns:
        true if lsnr was added before, false otherwise.
      • dependencyResolver

        public static void dependencyResolver​(DependencyResolver rslvr)
        Sets custom dependency resolver which provides overridden dependencies
        Parameters:
        rslvr - Dependency resolver.
      • dependencyResolver

        public static DependencyResolver dependencyResolver()
        Custom dependency resolver.
        Returns:
        Returns null if resolver wasn't added.
      • hasKernalStarted

        public static boolean hasKernalStarted​(String name)
        Parameters:
        name - Grid name (possibly null for default grid).
        Returns:
        true when all managers, processors, and plugins have started and ignite kernal start method has fully completed.
      • initializeDefaultMBeanServer

        public static void initializeDefaultMBeanServer​(IgniteConfiguration myCfg)
        Initialize default mbean server.