@IgniteSpiMultipleInstancesSupport(value=true) @IgniteSpiConsistencyChecked(optional=false) @IgnoreIfPeerClassLoadingDisabled public class LocalDeploymentSpi extends IgniteSpiAdapter implements DeploymentSpi
register(ClassLoader, Class)
method. This SPI requires
no configuration.
Note that if peer class loading is enabled (which is default behavior,
see IgniteConfiguration.isPeerClassLoadingEnabled()
), then it is
enough to deploy a task only on one node and all other nodes will load
required classes from the node that initiated task execution.
GridLocalDeploymentSpi
with IgniteConfiguration
as it is used by default and has no
configuration parameters.DeploymentSpi
Modifier and Type | Field and Description |
---|---|
static String |
IGNITE_DEPLOYMENT_ADDITIONAL_CHECK
Enables additional check for resource name on resources removal.
|
ignite, igniteInstanceName
Constructor and Description |
---|
LocalDeploymentSpi() |
Modifier and Type | Method and Description |
---|---|
@Nullable DeploymentResource |
findResource(String rsrcName)
Finds class loader for the given class.
|
boolean |
register(ClassLoader ldr,
Class<?> rsrc)
Registers a class loader with this SPI.
|
void |
setListener(DeploymentListener lsnr)
Sets or unsets deployment event listener.
|
LocalDeploymentSpi |
setName(String name)
Sets SPI name.
|
void |
spiStart(@Nullable String igniteInstanceName)
This method is called to start SPI.
|
void |
spiStop()
This method is called to stop SPI.
|
String |
toString() |
boolean |
unregister(String rsrcName)
Unregisters all class loaders that have a class with given name or have
a class with give
ComputeTaskName value. |
addTimeoutObject, assertParameter, checkConfigurationConsistency0, clientFailureDetectionTimeout, configInfo, createSpiAttributeName, failureDetectionTimeout, failureDetectionTimeoutEnabled, failureDetectionTimeoutEnabled, getConsistentAttributeNames, getExceptionRegistry, getLocalNode, getName, getNodeAttributes, getSpiContext, ignite, initFailureDetectionTimeout, injectables, injectResources, isNodeStopping, onBeforeStart, onClientDisconnected, onClientReconnected, onContextDestroyed, onContextDestroyed0, onContextInitialized, onContextInitialized0, registerMBean, removeTimeoutObject, started, startInfo, startStopwatch, stopInfo, unregisterMBean
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getName, getNodeAttributes, onClientDisconnected, onClientReconnected, onContextDestroyed, onContextInitialized
public static final String IGNITE_DEPLOYMENT_ADDITIONAL_CHECK
public void spiStart(@Nullable @Nullable String igniteInstanceName) throws IgniteSpiException
spiStart
in interface IgniteSpi
igniteInstanceName
- Name of Ignite instance this SPI is being started for
(null
for default Ignite instance).IgniteSpiException
- Throws in case of any error during SPI start.public void spiStop() throws IgniteSpiException
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.
spiStop
in interface IgniteSpi
IgniteSpiException
- Thrown in case of any error during SPI stop.@Nullable public @Nullable DeploymentResource findResource(String rsrcName)
findResource
in interface DeploymentSpi
rsrcName
- Class name or class alias to find class loader for.null
if not deployed.public boolean register(ClassLoader ldr, Class<?> rsrc) throws IgniteSpiException
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.
register
in interface DeploymentSpi
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.True
if resource was registered.IgniteSpiException
- If registration failed.public boolean unregister(String rsrcName)
ComputeTaskName
value.unregister
in interface DeploymentSpi
rsrcName
- Either class name or ComputeTaskName
value for a class
whose class loader needs to be unregistered.True
if resource was unregistered.public void setListener(DeploymentListener lsnr)
setListener
in interface DeploymentSpi
lsnr
- Listener for deployment events. null
to unset the listener.public LocalDeploymentSpi setName(String name)
setName
in class IgniteSpiAdapter
name
- SPI name.this
for chaining.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.2 Release Date : February 6 2019