@IgniteSpiMultipleInstancesSupport(value=true) @IgniteSpiConsistencyChecked(optional=false) @IgnoreIfPeerClassLoadingDisabled public class LocalDeploymentSpi extends IgniteSpiAdapter implements DeploymentSpi, LocalDeploymentSpiMBean
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
gridName, ignite, nodeId
Constructor and Description |
---|
LocalDeploymentSpi() |
Modifier and Type | Method and Description |
---|---|
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.
|
void |
spiStart(String gridName)
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, configInfo, createSpiAttributeName, getConsistentAttributeNames, getExceptionRegistry, getIgniteHome, getLocalNodeId, getName, getNodeAttributes, getSpiContext, getStartTimestamp, getStartTimestampFormatted, getUpTime, getUpTimeFormatted, injectables, injectResources, isNodeStopping, onContextDestroyed, onContextDestroyed0, onContextInitialized, onContextInitialized0, registerMBean, removeTimeoutObject, setName, startInfo, startStopwatch, stopInfo, unregisterMBean
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getName, getNodeAttributes, onContextDestroyed, onContextInitialized
getIgniteHome, getLocalNodeId, getName, getStartTimestamp, getStartTimestampFormatted, getUpTime, getUpTimeFormatted
public void spiStart(@Nullable String gridName) throws IgniteSpiException
spiStart
in interface IgniteSpi
gridName
- Name of grid instance this SPI is being started for
(null
for default grid).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 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.
Follow @ApacheIgnite
Ignite Fabric : ver. 1.2.0-incubating Release Date : June 16 2015