Posts
Building Abstractions with Procedures Section 2 - Part 1
Section 1.2 Procedures and the Processes They Generate Exercises in this section of SCIP. Exercise 1.9. Each of the following two procedures defines a method …
Building Abstractions with Procedures Section 1
Section 1.1 The Elements of Programing Exercises in this section of SICP. Exercise 1.1. Below is a sequence of expressions. What is the result printed by the …
LRU-based Replacement Algorithms Application of Flash Memory
Abstract Nowadays, NAND flash memory has been widely used as storage medium for embedded systems because of its small size, lightweight, shock resistance, power …
Spring IoC Container Part 3
DefaultSingletonBeanRegistry Last time we find that in the DefaultListableBeanFactory it provides map to save bean definitions. But when getting bean instance, …
Spring IoC Container Part 2
Log4J When using Spring framework, we must use Apache Common Logging to print log in console or binary files. As we known, Spring log configuration can change …
Spring IoC Container Part 1
Let’s look a simple code within Spring below: // create and configure beans ApplicationContext context = new ClassPathXmlApplicationContext(new String[] …
3.2 Bean Scopes
Bean scopes: singleton and prototype 1. singleton Only one instance in Spring IoC container. Only return the same Bean. One instance of the bean is created for …
4.1 Resource
Resource 1. Resource API public interface InputStreamSource { InputStream getInputStream() throws IOException; } public interface Resource extends …
4.2 Using Resource
Using Resource 1. ByteArrayResource Junit test: import org.junit.Test; import org.springframework.core.io.ByteArrayResource; import …
4.3 Access Resource
Access Resource 1. ResourceLoader Spring has a DefaultResourceLoader which can return ClassPathResource, UrlResource, and ServletContextResourceLoader which …