20fcb506b7d9f93c4b9ff49e147cd896659f5ea1
[taxeditor.git] / eu.etaxonomy.taxeditor.cdmlib / src / main / java / eu / etaxonomy / cdm / api / application / CdmApplicationRemoteConfiguration.java
1 /**
2 * Copyright (C) 2014 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
8 */
9
10 package eu.etaxonomy.cdm.api.application;
11
12 import javax.sql.DataSource;
13
14 import org.apache.log4j.Logger;
15 import org.hibernate.SessionFactory;
16 import org.springframework.beans.factory.annotation.Autowired;
17 import org.springframework.stereotype.Component;
18 import org.springframework.transaction.PlatformTransactionManager;
19 import org.springframework.transaction.TransactionStatus;
20
21 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
22 import eu.etaxonomy.cdm.api.conversation.ConversationHolderMock;
23 import eu.etaxonomy.cdm.ext.geo.IEditGeoService;
24 import eu.etaxonomy.taxeditor.service.ICachedCommonService;
25 import eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager;
26
27
28 /**
29 * CDM Application Configuration class which manages the configuration for remoting
30 * clients
31 *
32 */
33 @Component
34 public class CdmApplicationRemoteConfiguration extends CdmApplicationDefaultConfiguration {
35
36 @SuppressWarnings("unused")
37 private static final Logger logger = Logger.getLogger(CdmApplicationRemoteConfiguration.class);
38
39 @Autowired
40 IEditGeoService editGeoService;
41
42 @Autowired
43 private ICachedCommonService cachedCommonService;
44
45
46 @Autowired
47 protected ICdmEntitySessionManager cdmEntitySessionManager;
48
49 public CdmApplicationRemoteConfiguration() {
50 }
51
52 /* (non-Javadoc)
53 * @see eu.etaxonomy.cdm.api.application.CdmApplicationDefaultConfiguration#getTransactionManager()
54 */
55 @Override
56 public PlatformTransactionManager getTransactionManager() throws UnsupportedOperationException {
57 throw new UnsupportedOperationException("getTransactionManager is not implemented for CdmApplicationRemoteConfiguration");
58 }
59
60
61 /* (non-Javadoc)
62 * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#startTransaction()
63 */
64 @Override
65 public TransactionStatus startTransaction() throws UnsupportedOperationException {
66 throw new UnsupportedOperationException("startTransaction is not implemented for CdmApplicationRemoteConfiguration");
67 }
68
69
70 /* (non-Javadoc)
71 * @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#startTransaction()
72 */
73 @Override
74 public TransactionStatus startTransaction(Boolean readOnly) throws UnsupportedOperationException {
75 throw new UnsupportedOperationException("startTransaction is not implemented for CdmApplicationRemoteConfiguration");
76 }
77
78
79 /* (non-Javadoc)
80 * @see eu.etaxonomy.cdm.api.application.CdmApplicationDefaultConfiguration#commitTransaction(org.springframework.transaction.TransactionStatus)
81 */
82 @Override
83 public void commitTransaction(TransactionStatus txStatus) throws UnsupportedOperationException {
84 throw new UnsupportedOperationException("commitTransaction is not implemented for CdmApplicationRemoteConfiguration");
85 }
86
87 /* (non-Javadoc)
88 * @see eu.etaxonomy.cdm.api.application.CdmApplicationDefaultConfiguration#NewConversation()
89 */
90 @Override
91 public ConversationHolder NewConversation() {
92 return new ConversationHolderMock();
93 }
94
95 /**
96 * @return
97 */
98 public IEditGeoService getEditGeoService() {
99 return this.editGeoService;
100 }
101
102 /**
103 * @return
104 */
105 public ICachedCommonService getCachedCommonService(){
106 return this.cachedCommonService;
107 }
108
109
110 public ICdmEntitySessionManager getCdmEntitySessionManager() {
111 return this.cdmEntitySessionManager;
112 }
113
114 /* (non-Javadoc)
115 * @see eu.etaxonomy.cdm.api.application.CdmApplicationDefaultConfiguration#setDataSource(javax.sql.DataSource)
116 */
117 @Override
118 public void setDataSource(DataSource dataSource) {
119 }
120
121 /* (non-Javadoc)
122 * @see eu.etaxonomy.cdm.api.application.CdmApplicationDefaultConfiguration#setTransactionManager(org.springframework.transaction.PlatformTransactionManager)
123 */
124 @Override
125 public void setTransactionManager(PlatformTransactionManager transactionManager) {
126 }
127
128 /* (non-Javadoc)
129 * @see eu.etaxonomy.cdm.api.application.CdmApplicationDefaultConfiguration#setSessionFactory(org.hibernate.SessionFactory)
130 */
131 @Override
132 public void setSessionFactory(SessionFactory sessionFactory) {
133 }
134 }