Author: bfoster
Date: Thu Jun 16 17:58:53 2011
New Revision: 1136569
URL: http://svn.apache.org/viewvc?rev=1136569&view=rev
Log:
- added autodetect that plug-in jars are on classpath and loads it Spring
config xml file
---------------
OODT-194
Modified:
oodt/branches/protocol/protocol-api/src/main/java/org/apache/oodt/cas/protocol/config/SpringProtocolConfig.java
oodt/branches/protocol/protocol-api/src/main/resources/policy/protocol-action-beans.xml
oodt/branches/protocol/protocol-api/src/main/resources/policy/protocol-config.xml
Modified:
oodt/branches/protocol/protocol-api/src/main/java/org/apache/oodt/cas/protocol/config/SpringProtocolConfig.java
URL:
http://svn.apache.org/viewvc/oodt/branches/protocol/protocol-api/src/main/java/org/apache/oodt/cas/protocol/config/SpringProtocolConfig.java?rev=1136569&r1=1136568&r2=1136569&view=diff
==============================================================================
---
oodt/branches/protocol/protocol-api/src/main/java/org/apache/oodt/cas/protocol/config/SpringProtocolConfig.java
(original)
+++
oodt/branches/protocol/protocol-api/src/main/java/org/apache/oodt/cas/protocol/config/SpringProtocolConfig.java
Thu Jun 16 17:58:53 2011
@@ -42,7 +42,10 @@ public class SpringProtocolConfig implem
public SpringProtocolConfig(String configFile) {
Validate.notNull(configFile, "SpringProtocolConfig configFile
cannnot be NULL");
factoryMap = new HashMap<String, List<ProtocolFactory>>();
- FileSystemXmlApplicationContext appContext = new
FileSystemXmlApplicationContext(configFile);
+ loadFactories(new FileSystemXmlApplicationContext(configFile));
+ }
+
+ private void loadFactories(FileSystemXmlApplicationContext appContext) {
Collection<ProtocolFactory> protocolFactories =
appContext.getBeansOfType(ProtocolFactory.class).values();
for (ProtocolFactory factory : protocolFactories) {
List<ProtocolFactory> factories =
factoryMap.get(factory.getSchema());
Modified:
oodt/branches/protocol/protocol-api/src/main/resources/policy/protocol-action-beans.xml
URL:
http://svn.apache.org/viewvc/oodt/branches/protocol/protocol-api/src/main/resources/policy/protocol-action-beans.xml?rev=1136569&r1=1136568&r2=1136569&view=diff
==============================================================================
---
oodt/branches/protocol/protocol-api/src/main/resources/policy/protocol-action-beans.xml
(original)
+++
oodt/branches/protocol/protocol-api/src/main/resources/policy/protocol-action-beans.xml
Thu Jun 16 17:58:53 2011
@@ -12,6 +12,7 @@
<bean
class="org.apache.oodt.commons.spring.postprocessor.SetIdBeanPostProcessor"/>
- <bean id="Download"
class="org.apache.oodt.cas.protocol.action.DownloadAction"/>
+ <bean id="Download"
class="org.apache.oodt.cas.protocol.action.DownloadAction"/>
+ <bean id="GetSupportedFactories"
class="org.apache.oodt.cas.protocol.action.GetSupportedFactoriesAction"/>
</beans>
\ No newline at end of file
Modified:
oodt/branches/protocol/protocol-api/src/main/resources/policy/protocol-config.xml
URL:
http://svn.apache.org/viewvc/oodt/branches/protocol/protocol-api/src/main/resources/policy/protocol-config.xml?rev=1136569&r1=1136568&r2=1136569&view=diff
==============================================================================
---
oodt/branches/protocol/protocol-api/src/main/resources/policy/protocol-config.xml
(original)
+++
oodt/branches/protocol/protocol-api/src/main/resources/policy/protocol-config.xml
Thu Jun 16 17:58:53 2011
@@ -10,12 +10,8 @@
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
- <import resource="protocol-action-beans.xml"/>
- <import resource="protocol-cmd-line-beans.xml"/>
-
- <!-- list ProtocolFactories here -->
- <bean class="org.apache.oodt.cas.protocol.some.factory">
-
- </bean>
+ <import resource="protocol-action-beans.xml"/>
+ <import resource="protocol-cmd-line-beans.xml"/>
+ <import resource="classpath*:**/*-protocol-config.xml"/>
</beans>
\ No newline at end of file