@GridSpiMultipleInstancesSupport(value=true) @GridSpiConsistencyChecked(optional=false) @GridIgnoreIfPeerClassLoadingDisabled public class GridLocalDeploymentSpi extends GridSpiAdapter implements GridDeploymentSpi, GridLocalDeploymentSpiMBean
register(ClassLoader, Class) method. This SPI requires
no configuration.
Note that if peer class loading is enabled (which is default behavior,
see GridConfiguration.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 GridConfiguration as it is used by default and has no
configuration parameters.GridDeploymentSpi| Constructor and Description |
|---|
GridLocalDeploymentSpi() |
| Modifier and Type | Method and Description |
|---|---|
GridDeploymentResource |
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(GridDeploymentListener 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
GridComputeTaskName value. |
assertParameter, checkConfigurationConsistency0, configInfo, createSpiAttributeName, getConsistentAttributeNames, getGridGainHome, getLocalNodeId, getName, getNodeAttributes, getSpiContext, getStartTimestamp, getStartTimestampFormatted, getUpTime, getUpTimeFormatted, injectables, onContextDestroyed, onContextDestroyed0, onContextInitialized, onContextInitialized0, registerMBean, setName, startInfo, startStopwatch, stopInfo, unregisterMBeanclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetName, getNodeAttributes, onContextDestroyed, onContextInitializedgetGridGainHome, getLocalNodeId, getName, getStartTimestamp, getStartTimestampFormatted, getUpTime, getUpTimeFormattedpublic void spiStart(@Nullable String gridName) throws GridSpiException
spiStart in interface GridSpigridName - Name of grid instance this SPI is being started for
(null for default grid).GridSpiException - Throws in case of any error during SPI start.public void spiStop()
throws GridSpiException
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 GridSpiGridSpiException - Thrown in case of any error during SPI stop.@Nullable public GridDeploymentResource findResource(String rsrcName)
findResource in interface GridDeploymentSpirsrcName - Class name or class alias to find class loader for.null if not deployed.public boolean register(ClassLoader ldr, Class<?> rsrc) throws GridSpiException
The array of classes passed in should be checked for presence of
GridComputeTaskName annotations. The classes that have this annotation
should be accessible by this name from GridDeploymentSpi.findResource(String) method.
register in interface GridDeploymentSpildr - Class loader to register.rsrc - Class that should be checked for aliases.
Currently the only alias in the system is GridComputeTaskName for
task classes; in future, there may be others.True if resource was registered.GridSpiException - If registration failed.public boolean unregister(String rsrcName)
GridComputeTaskName value.unregister in interface GridDeploymentSpirsrcName - Either class name or GridComputeTaskName value for a class
whose class loader needs to be unregistered.True if resource was unregistered.public void setListener(GridDeploymentListener lsnr)
setListener in interface GridDeploymentSpilsnr - Listener for deployment events. null to unset the listener.Copyright © 2014. All rights reserved.