ITeye博客

机敏

liuzhaomin · 共 164 篇文章

方法替换MethodReplacer

package com.astute.sparrow.spring.ioc.method_injection; import org.springframework.beans.BeansException; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.BeanFactoryAware; import org.springframework.beans.factory.ObjectFactory; import org.springframewor…

2011-06-19 10:08 · 评论(0)

ObjectFactoryCreatingFactoryBean

package com.astute.sparrow.spring.ioc.method_injection; import org.springframework.beans.BeansException; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.BeanFactoryAware; import org.springframework.beans.factory.ObjectFactory; import org.springframewor…

2011-06-18 21:43 · 评论(0)

ObjectFactoryCreatingFactoryBean

/** * A FactoryBean implementation that * returns a value which is an ObjectFactory * that in turn returns a bean sourced from a BeanFactory. * * As such, this may be used to avoid having a client object directly calling BeanFactory#getBean(String) to get * a (typically prototype) bean from a BeanF…

2011-06-18 21:22 · 评论(0)

BeanFactoryAware

package com.astute.sparrow.spring.ioc.method_injection; import org.springframework.beans.BeansException; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.BeanFactoryAware; import org.springframework.beans.factory.annotation.Autowired; import org.springf…

2011-06-18 20:24 · 评论(0)

Spring方法注入method_injection

package com.astute.sparrow.spring.ioc.method_injection; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Component; @Component("a") public class A { @Autowired @Qualifier("b") private …

2011-06-18 19:37 · 评论(0)

Spring类路径扫描注入Bean

package com.astute.sparrow.spring.ioc.method_injection; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Component; @Component("a") public class A { @Autowired @Qualifier("b") private …

2011-06-18 19:00 · 评论(0)

Spring xml注入

构造方法注入: <bean id="a" class="com.astute.sparrow.spring.ioc.test.A"> <constructor-arg type="int"> <value>12345</value> </constructor-arg> </bean> <bean id="a" class="com.astute.sparrow.spring.ioc.test.A"> <constructor-arg index="0" value="abcde"/> <constructor-arg index="1" value="12345"/> </bean> Se…

2011-06-18 13:15 · 评论(0)

Spring ioc注解方式获取bean

package com.ls.spring.ioc.dummy; import org.springframework.stereotype.Component; @Component public class B { public void put() { System.out.println("B is outing..."); } } package com.ls.spring.ioc.dummy; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.ster…

2011-06-18 09:19 · 评论(1)

xml配置格式加载

package com.ls.spring.ioc.dummy; import org.springframework.stereotype.Component; @Component public class B { public void put() { System.out.println("B is outing..."); } } package com.ls.spring.ioc.dummy; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.ster…

2011-06-18 09:17 · 评论(0)

Properties配置格式加载

package com.ls.spring.ioc.dummy; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class A { @Autowired private B b; public A() { super(); } public A(B b) { super(); this.b = b; } public B getB() { return b; } public vo…

2011-06-18 09:15 · 评论(0)

使用编码方式创建和绑定Bean

package com.astute.sparrow.spring.ioc.test; public class B { public void output() { System.out.println("B.output"); } } package com.astute.sparrow.spring.ioc.test; public class A { private B b; public A() { } public A(B b) { super(); this.b = b; } public B getB() { return b; } public void setB(B b)…

2011-06-17 13:31 · 评论(0)

eclipse快捷键

1. Ctrl + / 所选择的行用 "//"注释 2. Ctrl + Shift + / 所选择的行 用 "/* */" 来注释 3. Alt + / 补全提示 , 参数提示, 方法提示 4 Ctrl + d 删除整行 5 ctrl + F11 快速运行 6 全局 调试上次启动 F11 7 ctrl + shift + o 自动导入未导入(import)的类。 8 全局 单步跳过 F6 9 Tab 使选中的代码向右 10 Shift +Tab 使选中的代码向左 11 鼠标放在对应的类上 按 F3 会跳到对应的类定义文件中(前提是Attatch Source 已经配置好),和 按住 Ctrl…

2011-06-15 16:31 · 评论(0)

免安装Oracle客户端使用PL/SQL连接Oracle

免安装Oracle客户端使用PL/SQL连接Oracle 免安装Oracle客户端使用PL/SQL连接Oracle 大家都知道,用PL/SQL连接Oracle,是需要安装Oracle客户端软件的。有没要想过不安装Oracle客户端直接连接Oracle呢? 利用Oracle 提供的Instant Client Package 只需要在Oracle下载一个叫Instant Client Package的软件就可以了,这个软件不需要安装,只要解压就可以用了,很方便,就算重装了系统还是可以用的。 下载地址: http://www.oracle.com/technology/software/tech…

2011-06-14 16:09 · 评论(0)

NIO字符集操作

示例程序 在打开相应的文件、将输入数据读入名为 inputData 的 ByteBuffer 之后,我们的程序必须创建 ISO-8859-1 (Latin1) 字符集的一个实例: Charset latin1 = Charset.forName( "ISO-8859-1" ); 然后,创建一个解码器(用于读取)和一个编码器 (用于写入): CharsetDecoder decoder = latin1.newDecoder(); CharsetEncoder encoder = latin1.newEncoder(); 为了将字节数据解码为一组字符,我们把 ByteBuffer 传递给 Ch…

2011-05-16 01:30 · 评论(0)

MultiPortEcho ibm dw nio入门异步io的例子

ibm dw nio入门异步io的例子 package com.ls.java.newio; import java.io.*; import java.net.*; import java.nio.*; import java.nio.channels.*; import java.util.*; public class MultiPortEcho { private int ports[]; private ByteBuffer echoBuffer = ByteBuffer.allocate(1024); public MultiPortEcho(int ports[]) throw…

2011-05-15 23:05 · 评论(0)