Category Archives: Spring

Spring AOP - 几种Advice的建立

Creating advice:     advice object包含了所有需要添加到aspect的逻辑代码,因为Spring中的joinpoint model是基于method interception的,所以在spring中advice object是可以加载在method调用的范围内的。Spring支持以下集中比较基本的advice类型。 Advice types in spring Advice type Interface Descritpion Around org.aopalliance.intercept.MethodInterceptor Intercepts calls to the target method Before org.springframework.aop.BeforeAdvice org.springframework.aop.MethodBeforeAdvice   Called before the target method is invoked After org.springframework.aop.AfterReturningAdvice Called after the … Continue reading

Posted in Spring | Leave a comment

SPRING FRAMEWORK CHANGELOG for jmx

Package org.springframework.jmx * fixed NotificationListenerHolder to correctly handle multiple specified object names * added "allowEagerInit" property to MBeanExporter, for autodetecting lazy-init beans and FactoryBean-produced objects * added "environment" property to MBeanClientInterceptor and NotificationListenerRegistar, allowing for JMX env entries * added … Continue reading

Posted in Spring | Leave a comment

Spring 2.5 标注开发的简单例子

Spring 2.5 标注开发的简单例子   研究了很久新出的 Spring 2.5, 总算大致明白了如何用标注定义 Bean, 但是如何定义和注入类型为 java.lang.String 的 bean 仍然未解决, 希望得到高人帮助. 总的来看 Java EE 5 的标注开发方式开来是得到了大家的认可了. @Service 相当于定义 bean, 自动根据 bean 的类名生成一个首字母小写的 bean @Autowired 则是自动注入依赖的类, 它会在类路径中找成员对应的类/接口的实现类, 如果找到多个, 需要用 @Qualifier("chineseMan") 来指定对应的 bean 的 ID. 一定程度上大大简化了代码的编写, 例如一对一的 bean … Continue reading

Posted in Spring | Leave a comment

Spring 2.5 标注开发的简单例子

Spring 2.5 标注开发的简单例子   研究了很久新出的 Spring 2.5, 总算大致明白了如何用标注定义 Bean, 但是如何定义和注入类型为 java.lang.String 的 bean 仍然未解决, 希望得到高人帮助. 总的来看 Java EE 5 的标注开发方式开来是得到了大家的认可了. @Service 相当于定义 bean, 自动根据 bean 的类名生成一个首字母小写的 bean @Autowired 则是自动注入依赖的类, 它会在类路径中找成员对应的类/接口的实现类, 如果找到多个, 需要用 @Qualifier("chineseMan") 来指定对应的 bean 的 ID. 一定程度上大大简化了代码的编写, 例如一对一的 bean … Continue reading

Posted in Spring | Leave a comment

SPRING CHANGELOG for mail

Package org.springframework.mail * ConfigurableMimeFileTypeMap explicitly closes the InputStream that it uses for "mime.types" resource reading   Package org.springframework.mock * SimpleNamingContextBuilder supports "deactivate()"+"activate()", with the standard JNDI provider exposed inbetween

Posted in Spring | Leave a comment

SPRING CHANGELOG for orm

Package org.springframework.orm * HibernateTemplate detects Spring-managed transactional Session even with SessionFactory proxy and allowCreate=false * HibernateTemplate's "loadAll" operation selects distinct root entities (avoiding duplicate entries in result list) * HibernateTemplate translates Hibernate's DataException into a Spring DataIntegrityViolationException (for consistency) * … Continue reading

Posted in Spring | Leave a comment

SPRING FRAMEWORK CHANGELOG for jdbc

Package org.springframework.jdbc * provided Jdbc4SqlXmlHandler as default implementation of the SqlXmlHandler interface * added SqlValue class to "jdbc.support" package, with SqlXmlValue derived from SqlValue instead of SqlTypeValue * SQLErrorCodesFactory always loads its "sql-error-codes.xml" files from Spring's class loader (-> static … Continue reading

Posted in Spring | Leave a comment

SPRING FRAMEWORK CHANGELOG for ejb

Package org.springframework.ejb * SpringBeanAutowiringInterceptor calls "InvocationContext.proceed()" in order to invoke subsequent interceptors as well   Package org.springframework.instrument * ShadowingClassLoader excludes "net.sf.cglib." package from shadowing by default   Package org.springframework.jdbc * provided Jdbc4SqlXmlHandler as default implementation of the SqlXmlHandler interface * … Continue reading

Posted in Spring | Leave a comment

SPRING FRAMEWORK CHANGELOG for instrument

Package org.springframework.instrument * ShadowingClassLoader excludes "net.sf.cglib." package from shadowing by default   Package org.springframework.jdbc * provided Jdbc4SqlXmlHandler as default implementation of the SqlXmlHandler interface * added SqlValue class to "jdbc.support" package, with SqlXmlValue derived from SqlValue instead of SqlTypeValue * … Continue reading

Posted in Spring | Leave a comment

SPRING FRAMEWORK CHANGELOG for jms

Package org.springframework.jms * JmsException message and logged JMSException message explicitly includes linked exception now if not already contained * SingleConnectionFactory only calls "Connection.stop()" on reset when the shared Connection has actually been started * SingleConnectionFactory explicitly creates Queue/TopicConnection when first … Continue reading

Posted in Spring | Leave a comment