CdmApplicationDefaultConfiguration : moved autowiring for sessionFactory and transact...
authorCherian Mathew <c.mathew@bgbm.org>
Fri, 14 Feb 2014 16:47:29 +0000 (16:47 +0000)
committerCherian Mathew <c.mathew@bgbm.org>
Fri, 14 Feb 2014 16:47:29 +0000 (16:47 +0000)
to allow for remoting
CdmApplicationController : catching UnsupportedOperationException for database service call to allow for remoting
defaultApplicationContext : added CdmApplicationRemoteConfiguration exclude to application component scan
httpInvokerServices.xml : corrected bean names
cdmlib-remote-servlet : removed http invoker services config to separate xml file for ease to switch to remoting

cdmlib-remote-webapp/src/main/webapp/WEB-INF/cdmlib-remote-servlet.xml
cdmlib-remote-webapp/src/main/webapp/WEB-INF/web.xml
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/application/CdmApplicationController.java
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/application/CdmApplicationDefaultConfiguration.java
cdmlib-services/src/main/resources/eu/etaxonomy/cdm/defaultApplicationContext.xml
cdmlib-services/src/main/resources/eu/etaxonomy/cdm/httpInvokerServices.xml

index 495c1c2dfb52dbc2e5417cf42d1dd6dc2fc66d6a..ca3fc4b8c3d6b5c23f51bb1f1d4c8ac3905d5069 100644 (file)
@@ -64,7 +64,7 @@
        ======= Remoting =======
        -->
        
-       <!-- <import resource="classpath:/eu/etaxonomy/cdm/remoting-services.xml"/>-->
+       <import resource="classpath:/eu/etaxonomy/cdm/remoting-services.xml"/>
        
        
   <!--
index 379eeaa0acdf120ba0222ac78d67fe0a7d63ffb3..a72fbc4748da0f800f4235f2f1411bf4f3c146f0 100644 (file)
@@ -1,8 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
-         http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
     <description>cdmlib-remote web-application instance</description>
     <display-name>cdmlib-remote-webapp</display-name>
 
index 7bc1336916d5ae1313cc47dcec7800e40c61e9a2..c52a12645be42adbfca67ee4dbf92beb58b67fd3 100644 (file)
@@ -352,7 +352,12 @@ public class CdmApplicationController implements ICdmApplicationConfiguration{
             }\r
         }\r
         configuration = (ICdmApplicationConfiguration)applicationContext.getBean("cdmApplicationDefaultConfiguration");\r
-        getDatabaseService().setApplicationController(this);\r
+        try {\r
+               //FIXME:Remoting catching exection to allow for remoting\r
+               getDatabaseService().setApplicationController(this);\r
+        } catch(UnsupportedOperationException uoe) {\r
+               logger.warn("getDatabaseService() is not implmented for current application context");\r
+        }\r
     }\r
 \r
 \r
index cb170445cd6634316119fe705c488c2600b09f7c..999f2a5973454cd10033efe966d4f7a3df8d764d 100644 (file)
@@ -92,7 +92,7 @@ public class CdmApplicationDefaultConfiguration implements ICdmApplicationConfig
     @Autowired\r
     //@Qualifier("termService")\r
     private ITermService termService;\r
-    @Autowired\r
+    //@Autowired\r
     private HibernateTransactionManager transactionManager;\r
     @Autowired\r
     //@Qualifier("descriptionService")\r
@@ -108,7 +108,7 @@ public class CdmApplicationDefaultConfiguration implements ICdmApplicationConfig
     private ICommonService commonService;\r
     @Autowired\r
     private ILocationService locationService;\r
-    @Autowired\r
+    //@Autowired\r
     private SessionFactory sessionFactory;\r
     @Autowired\r
     private DataSource dataSource;\r
@@ -206,6 +206,11 @@ public class CdmApplicationDefaultConfiguration implements ICdmApplicationConfig
     public IReferenceService getReferenceService() {\r
         return this.referenceService;\r
     }\r
+    \r
+    @Autowired\r
+    public void setSessionFactory(SessionFactory sessionFactory) {\r
+       this.sessionFactory = sessionFactory;\r
+    }\r
 \r
     /* (non-Javadoc)\r
      * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getTaxonService()\r
@@ -310,6 +315,11 @@ public class CdmApplicationDefaultConfiguration implements ICdmApplicationConfig
     public PlatformTransactionManager getTransactionManager() {\r
         return this.transactionManager;\r
     }\r
+    \r
+    @Autowired\r
+    public void setTransactionManager(PlatformTransactionManager transactionManager) {\r
+        this.transactionManager = (HibernateTransactionManager) transactionManager;\r
+    }\r
 \r
     /*\r
      * (non-Javadoc)\r
index 4e68128724bb3f615f6ed9c3530703c78be05289..39573ec863e74a7bfd0ec4288b76737bf7457775 100644 (file)
   <context:component-scan base-package="eu/etaxonomy/cdm/api/service">\r
   </context:component-scan>\r
 \r
-  <context:component-scan base-package="eu/etaxonomy/cdm/api/application"/>\r
-\r
+  <context:component-scan base-package="eu/etaxonomy/cdm/api/application">\r
+    <!-- FIXME:Remoting Temp workaround to make remoting work-->\r
+       <context:exclude-filter type="regex" expression="eu\.etaxonomy\.cdm\.api\.application\.CdmApplicationRemoteConfiguration" /> \r
+  </context:component-scan>\r
+  \r
   <!-- EditGeoService was moved to ext. It is no longer available here -->\r
 \r
   <bean id="conversationHolder" class="eu.etaxonomy.cdm.api.conversation.ConversationHolder" scope="prototype"/>\r
index 531bc2349b1047da3665ef1fed29f5d492a9bc36..a448130279f47b463b41bc3d02ba9904459597cf 100644 (file)
        <bean id="httpGrantedAuthorityService"\r
                class="org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter">\r
                <property name="service">\r
-                       <ref bean="grantedAuthorityService" />\r
+                       <ref bean="grantedAuthorityServiceImpl" />\r
                </property>\r
                <property name="serviceInterface">\r
                        <value>eu.etaxonomy.cdm.api.service.IGrantedAuthorityService</value>\r
        <bean id="httpDatabaseService"\r
                class="org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter">\r
                <property name="service">\r
-                       <ref bean="databaseService" />\r
+                       <ref bean="databaseServiceHibernateImpl" />\r
                </property>\r
                <property name="serviceInterface">\r
                        <value>eu.etaxonomy.cdm.api.service.IDatabaseService</value>\r