lazy init : XML Bean Property « Spring « Java






lazy init

       
File: context.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="
                http://www.springframework.org/schema/beans
                http://www.springframework.org/schema/beans/spring-beans.xsd">
    
    <bean id="destructiveBean" lazy-init="false" class="java.lang.String">
         
    </bean>
</beans>


File: Main.java

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {
  public static void main(String[] args) throws Exception {
    ApplicationContext ctx = new ClassPathXmlApplicationContext("context.xml");

    ctx.getBean("destructiveBean");
  }
}




           
       








Spring-lazy-init.zip( 2,597 k)

Related examples in the same category

1.Property Setting: URL
2.PropertySetting: String Array
3.Property Setting: Stream From URL
4.Property Setting: Properties
5.Property Setting: Integer
6.Property Setting: File
7.Property Setting: Class type
8.Property Setting: Byte Array
9.Property Setting: Boolean
10.Property Setting: BigDecimal
11.Properties Setting: Date
12.Load property File In Context
13.Fill Value To List
14.Fill Map
15.Fill Set
16.Fill Properties
17.Fill List To Another List
18.Fill Calendar Object To List
19.Create List Map In Context
20.Bean Injection: Map
21.Bean Injection Collection: Set
22.Bean Injection: Collection Properties
23.Bean Injection Collection: Map
24.Bean Injection Collection: List