Class IgniteClientSpringBean

  • All Implemented Interfaces:
    AutoCloseable, IgniteClient, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle

    public class IgniteClientSpringBean
    extends Object
    implements IgniteClient, org.springframework.context.SmartLifecycle
    Represents Ignite client Spring bean that provides the ability to automatically start Ignite client during Spring Context initialization. It requires ClientConfiguration to be set before bean use (see setClientConfiguration(ClientConfiguration)}). A note should be taken that Ignite client instance is started after all other Spring beans have been initialized and right before Spring context is refreshed. That implies that it's not valid to reference IgniteClientSpringBean from any kind of Spring bean init methods like javax.annotation.PostConstruct. If it's required to reference IgniteClientSpringBean for other bean initialization purposes, it should be done from a ContextRefreshedEvent listener method declared in that bean.

    Spring XML Configuration Example

     <bean id="igniteClient" class="org.apache.ignite.IgniteClientSpringBean">
         <property name="clientConfiguration">
             <bean class="org.apache.ignite.configuration.ClientConfiguration">
                 <property name="addresses">
                     <list>
                         <value>127.0.0.1:10800</value>
                     </list>
                 </property>
             </bean>
         </property>
     </bean>