public class DerbyManager implements IDerbyManager { private final Logger logger = LoggerFactory.getLogger(getClass()); @PostConstruct protected void init() { logger.info("initializing"); loadEmbeddedDriver(); } ....
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd "> <context:annotation-config/> <bean id="derbyManager" class="com.rits.derby.impl.DerbyManager"/> </beans>
Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Derby Manager Bundle-SymbolicName: com.rits.derby Bundle-Version: 1.0.0 Bundle-Vendor: RITS Import-Library: org.springframework.spring Import-Bundle: org.apache.commons.dbcp ,derbyclient ,com.rits.databases Import-Package: org.slf4j Export-Package: com.rits.derby
private static final boolean jsr250Present = ClassUtils.isPresent("javax.annotation.Resource", AnnotationConfigUtils.class.getClassLoader()); // and later ... // Check for JSR-250 support, and if present add the CommonAnnotationBeanPostProcessor. if (jsr250Present && !registry.containsBeanDefinition(COMMON_ANNOTATION_PROCESSOR_BEAN_NAME)) { RootBeanDefinition def = new RootBeanDefinition(CommonAnnotationBeanPostProcessor.class); def.setSource(source); beanDefs.add(registerPostProcessor(registry, def, COMMON_ANNOTATION_PROCESSOR_BEAN_NAME)); }