Class LocalDeploymentSpi

    • Field Detail

      • IGNITE_DEPLOYMENT_ADDITIONAL_CHECK

        @SystemProperty("Enables an additional check of a resource name on resources removal")
        public static final String IGNITE_DEPLOYMENT_ADDITIONAL_CHECK
        Enables additional check for resource name on resources removal.
        See Also:
        Constant Field Values
    • Constructor Detail

      • LocalDeploymentSpi

        public LocalDeploymentSpi()
    • Method Detail

      • spiStart

        public void spiStart​(@Nullable
                             @Nullable String igniteInstanceName)
                      throws IgniteSpiException
        This method is called to start SPI. After this method returns successfully kernel assumes that SPI is fully operational.
        Specified by:
        spiStart in interface IgniteSpi
        Parameters:
        igniteInstanceName - Name of Ignite instance this SPI is being started for (null for default Ignite instance).
        Throws:
        IgniteSpiException - Throws in case of any error during SPI start.
      • spiStop

        public void spiStop()
                     throws IgniteSpiException
        This method is called to stop SPI. After this method returns kernel assumes that this SPI is finished and all resources acquired by it are released.

        Note that this method can be called at any point including during recovery of failed start. It should make no assumptions on what state SPI will be in when this method is called.

        Specified by:
        spiStop in interface IgniteSpi
        Throws:
        IgniteSpiException - Thrown in case of any error during SPI stop.
      • findResource

        @Nullable
        public @Nullable DeploymentResource findResource​(String rsrcName)
        Finds class loader for the given class.
        Specified by:
        findResource in interface DeploymentSpi
        Parameters:
        rsrcName - Class name or class alias to find class loader for.
        Returns:
        Deployed class loader, or null if not deployed.
      • register

        public boolean register​(ClassLoader ldr,
                                Class<?> rsrc)
                         throws IgniteSpiException
        Registers a class loader with this SPI. This method exists to be able to add external class loaders to deployment SPI. Deployment SPI may also have its own class loaders. For example, in case of GAR deployment, every GAR file is loaded and deployed with a separate class loader maintained internally by the SPI.

        The array of classes passed in should be checked for presence of ComputeTaskName annotations. The classes that have this annotation should be accessible by this name from DeploymentSpi.findResource(String) method.

        Specified by:
        register in interface DeploymentSpi
        Parameters:
        ldr - Class loader to register.
        rsrc - Class that should be checked for aliases. Currently the only alias in the system is ComputeTaskName for task classes; in future, there may be others.
        Returns:
        True if resource was registered.
        Throws:
        IgniteSpiException - If registration failed.
      • unregister

        public boolean unregister​(String rsrcName)
        Unregisters all class loaders that have a class with given name or have a class with give ComputeTaskName value.
        Specified by:
        unregister in interface DeploymentSpi
        Parameters:
        rsrcName - Either class name or ComputeTaskName value for a class whose class loader needs to be unregistered.
        Returns:
        True if resource was unregistered.
      • setListener

        public void setListener​(DeploymentListener lsnr)
        Sets or unsets deployment event listener. Grid implementation will use this listener to properly add and remove various deployments.
        Specified by:
        setListener in interface DeploymentSpi
        Parameters:
        lsnr - Listener for deployment events. null to unset the listener.