|
GridGain 3.6.0e
Enterprise Edition |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface GridLifecycleBean
A bean that reacts to grid lifecycle events defined in GridLifecycleEventType.
Use this bean whenever you need to plug some custom logic before or after
grid startup and stopping routines.
There are four events you can react to:
GridLifecycleEventType.BEFORE_GRID_START invoked before grid startup
routine is initiated. Note that grid is not available during this event,
therefore if you injected a grid instance via GridInstanceResource
annotation, you cannot use it yet.
GridLifecycleEventType.AFTER_GRID_START invoked right after grid
has started. At this point, if you injected a grid instance via
GridInstanceResource annotation, you can start using it. Note that
you should not be using GridFactory to get grid instance from
lifecycle bean.
GridLifecycleEventType.BEFORE_GRID_STOP invoked right before grid
stop routine is initiated. Grid is still available at this stage, so
if you injected a grid instance via GridInstanceResource annotation,
you can use it.
GridLifecycleEventType.AFTER_GRID_STOP invoked right after grid
has stopped. Note that grid is not available during this event.
GridLoggerResourceGridLocalNodeIdResourceGridHomeResourceGridMBeanServerResourceGridExecutorServiceResourceGridMarshallerResourceGridSpringApplicationContextResourceGridSpringResourceGridInstanceResource
GRIDGAIN_HOME/libs/ext folder, and
simply start GRIDGAIN_HOME/ggstart.{sh|bat} scripts.
Collection<GridLifecycleBean> lifecycleBeans = new ArrayList<GridLifecycleBean>(); Collections.addAll(lifecycleBeans, new FooBarLifecycleBean1(), new FooBarLifecycleBean2()); GridConfigurationAdapter cfg = new GridConfigurationAdapter(); cfg.setLifecycleBeans(lifecycleBeans); // Start grid with given configuration. G.start(cfg);or from Spring XML configuration file as follows:
<bean id="grid.cfg" class="org.gridgain.grid.GridConfigurationAdapter" scope="singleton">
...
<property name="lifecycleBeans">
<list>
<bean class="foo.bar.FooBarLifecycleBean1"/>
<bean class="foo.bar.FooBarLifecycleBean2"/>
</list>
</property>
...
</bean>
| Wiki | |
| Forum |

| Method Summary | |
|---|---|
void |
onLifecycleEvent(GridLifecycleEventType evt)
This method is called when lifecycle event occurs. |
| Method Detail |
|---|
void onLifecycleEvent(GridLifecycleEventType evt)
throws GridException
GridException - Thrown in case of any errors.evt - Lifecycle event.
|
GridGain 3.6.0e
Enterprise Edition |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
|
GridGain - Real Time Big Data
|
|
|