|
GridGain 2.1.0
Java API Specification |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
@Apache20LicenseCompatible 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.
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
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. GridFactory.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>
Documentation
Email Support
Online Forums
Issue Tracking
Author: 2005-2008 Copyright © GridGain Systems. All Rights Reserved. ver. 2.1.0

| Method Summary | |
|---|---|
void |
onLifecycleEvent(GridLifecycleEventType evt)
This method is called when lifecycle event occurs. |
| Method Detail |
|---|
void onLifecycleEvent(GridLifecycleEventType evt)
evt - Lifecycle event.
|
GridGain 2.1.0
Java API Specification |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
|
GridGain - Grid Computing Made Simple, ver. 2.1.0.19122008
2005-2008 Copyright © GridGain Systems. All Rights Reserved. |
|
|