GridGain™ 3.6.0e
Enterprise Edition

Interface GridLifecycleBean

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:

Resource Injection

Lifecycle beans can be injected using IoC (dependency injection) with grid resources. Both, field and method based injection are supported. The following grid resources can be injected: Refer to corresponding resource documentation for more information.


If you need to tie your application logic into GridGain lifecycle, you can configure lifecycle beans via standard grid configuration, add your application library dependencies into GRIDGAIN_HOME/libs/ext folder, and simply start GRIDGAIN_HOME/ggstart.{sh|bat} scripts.


Grid lifecycle beans can be configured programmatically as follows:
 Collection<GridLifecycleBean> lifecycleBeans = new ArrayList<GridLifecycleBean>();

 Collections.addAll(lifecycleBeans, new FooBarLifecycleBean1(), new FooBarLifecycleBean2());

 GridConfigurationAdapter cfg = new GridConfigurationAdapter();


 // Start grid with given configuration.
or from Spring XML configuration file as follows:
 <bean id="grid.cfg" class="org.gridgain.grid.GridConfigurationAdapter" scope="singleton">
    <property name="lifecycleBeans">
          <bean class=""/>
          <bean class=""/>

Wiki & Forum:



Method Summary
 void onLifecycleEvent(GridLifecycleEventType evt)
          This method is called when lifecycle event occurs.

Method Detail


void onLifecycleEvent(GridLifecycleEventType evt)
                      throws GridException
This method is called when lifecycle event occurs.

GridException - Thrown in case of any errors.
evt - Lifecycle event.

GridGain™ 3.6.0e
Enterprise Edition

GridGain - Real Time Big Data
Enterprise Edition, ver. 3.6.0e.13012012
2012 Copyright © GridGain Systems
Follow us:   Follow GridGain on Github Follow GridGain on Facebook Join GridGain User Group Follow GridGain on Twitter Follow GridGain on YouTube