...
Server impls can override a newly added method to load custom Bean definitions. For example, RebuildServer loads definitions of the default Rebuilder implementations. The trippi TriplestoreConnector class and the ModelBasedTripleGenerator class have some plain java refactorings (addition of setters and getters) to support extension and/or override of existing functionality (See also FCREPO-743 ). These bean definitions can be loaded from the Spring config directory, or can just be scanned classes:
Code Block |
---|
@Override protected void registerBeanDefinitions() throws ServerInitializationException{ for (String rebuilder:REBUILDERS){ try{ ScannedGenericBeanDefinition beanDefinition = Server.getScannedBeanDefinition(rebuilder); beanDefinition.setAutowireCandidate(true); beanDefinition.setAutowireMode(AbstractBeanDefinition.AUTOWIRE_BY_NAME); beanDefinition.setAttribute("id", rebuilder); beanDefinition.setAttribute("name", rebuilder); beanDefinition.setScope(BeanDefinition.SCOPE_SINGLETON); registerBeanDefinition(rebuilder, beanDefinition); } catch (IOException e){ throw new ServerInitializationException(e.toString(),e); } } } |
Non-module beans can be refactored to avoid reliance on the Server impl to locate information:
...