public interface IgniteSpi
Grid SPI's can be injected using IoC (dependency injection) with ignite resources. Both, field and method based injection are supported. The following ignite resources can be injected:
Refer to corresponding resource documentation for more information.Modifier and Type | Method and Description |
---|---|
String |
getName()
Gets SPI name.
|
Map<String,Object> |
getNodeAttributes()
This method is called before SPI starts (before method
spiStart(String)
is called). |
void |
onContextDestroyed()
Callback invoked prior to stopping grid before SPI context is destroyed.
|
void |
onContextInitialized(IgniteSpiContext spiCtx)
Callback invoked when SPI context is initialized.
|
void |
spiStart(String gridName)
This method is called to start SPI.
|
void |
spiStop()
This method is called to stop SPI.
|
String getName()
Map<String,Object> getNodeAttributes() throws IgniteSpiException
spiStart(String)
is called). It allows SPI implementation to add attributes to a local
node. Kernal collects these attributes from all SPI implementations
loaded up and then passes it to discovery SPI so that they can be
exchanged with other nodes.IgniteSpiException
- Throws in case of any error.void spiStart(@Nullable String gridName) throws IgniteSpiException
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.void onContextInitialized(IgniteSpiContext spiCtx) throws IgniteSpiException
This method is invoked after spiStart(String)
method is
completed, so SPI should be fully functional at this point. Use this
method for post-start initialization, such as subscribing a discovery
listener, sending a message to remote node, etc...
spiCtx
- Spi context.IgniteSpiException
- If context initialization failed (grid will be stopped).void onContextDestroyed()
If IgniteSpiAdapter
is used for SPI implementation, then it will
replace actual context with dummy no-op context which is usually good-enough
since grid is about to shut down.
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.
IgniteSpiException
- Thrown in case of any error during SPI stop.
Follow @ApacheIgnite
Ignite Fabric : ver. 1.2.0-incubating Release Date : June 16 2015