Project

General

Profile

Download (3.35 KB) Statistics
| Branch: | Tag: | Revision:
1
package eu.etaxonomy.cdm.api.conversation;
2

    
3
import org.hibernate.Session;
4
import org.springframework.transaction.TransactionStatus;
5

    
6
public class ConversationHolderMock extends ConversationHolder {
7

    
8

    
9
	/**
10
	 * This method has to be called when starting a new unit-of-work. All required resources are
11
	 * bound so that SessionFactory.getCurrentSession() returns the right session for this conversation
12
	 */
13
	public void bind() {
14
		
15
	}
16
//	
17
//	public SessionHolder getSessionHolder(){
18
//		return null;
19
//	}
20
//	
21
//	/**
22
//	 * @return
23
//	 */
24
//	private DataSource getDataSource() {
25
//		return null;
26
//	}
27
//
28
//	/**
29
//	 * @return true if this longSession is bound to the session factory.
30
//	 */
31
//	public boolean isBound(){
32
//		return false;
33
//	}
34
//	
35
	/**
36
	 * Creates an instance of TransactionStatus and binds it to this conversation manager.
37
	 * At the moment we allow only on transaction per conversation holder.
38
	 * 
39
	 * @return the transaction status bound to this conversation holder
40
	 */
41
	public TransactionStatus startTransaction(){
42
		return null;
43
	}
44
//	
45
//	/** 
46
//	 * @return if there is a running transaction
47
//	 */
48
//	public boolean isTransactionActive(){
49
//		return false;
50
//	}
51
//	
52
//	/* (non-Javadoc)
53
//	 * @see org.hibernate.Session#evict(java.lang.Object object)
54
//	 */
55
//	public void evict(Object object){
56
//
57
//	}
58
//	
59
//	/* (non-Javadoc)
60
//	 * @see org.hibernate.Session#refresh(java.lang.Object object)
61
//	 */
62
//	public void refresh(Object object){
63
//		
64
//	}
65
//	
66
//	/* (non-Javadoc)
67
//	 * @see org.hibernate.Session#clear()
68
//	 */
69
//	public void clear(){
70
//		
71
//	}
72
//	
73
	/**
74
	 * Commit the running transaction.
75
	 */
76
	public void commit(){
77
		
78
	}
79
	
80
	/**
81
	 * Commit the running transaction but optionally start a
82
	 * new one right away.
83
	 * 
84
	 * @param restartTransaction whether to start a new transaction
85
	 */
86
	public TransactionStatus commit(boolean restartTransaction){
87
		return null;
88
	}
89

    
90
	/**
91
	 * @return the session associated with this conversation manager 
92
	 */
93
	private Session getSession() {
94
		return null;
95
	}
96
//	
97
//	/** 
98
//	 * @return the session factory that is bound to this conversation manager
99
//	 */
100
//	private SessionFactory getSessionFactory() {
101
//		return null;
102
//	}
103
//
104
//	public void delete(Object object){
105
//
106
//	}
107
//	
108
//	/**
109
//	 * Facades Session.lock()
110
//	 */
111
//	public void lock(Object persistentObject, LockMode lockMode) {
112
//		
113
//	}
114
//	
115
//	public void lock(String entityName, Object persistentObject, LockMode lockMode){
116
//		getSession().lock(entityName, persistentObject, lockMode);
117
//	}
118
//
119
//	/**
120
//	 * @return the definition
121
//	 */
122
//	public TransactionDefinition getDefinition() {
123
//		return null;
124
//	}
125
//
126
//	/**
127
//	 * @param definition the definition to set
128
//	 */
129
//	public void setDefinition(TransactionDefinition definition) {
130
//
131
//	}
132
//	
133
//	/**
134
//	 * Register to get updated after any interaction with the datastore
135
//	 */
136
//	public void registerForDataStoreChanges(IConversationEnabled observer) {
137
//
138
//	}
139
//	
140
//	/**
141
//	 * Register to get updated after any interaction with the datastore
142
//	 */
143
//	public void unregisterForDataStoreChanges(IConversationEnabled observer) {
144
//		
145
//	}
146
//	
147
	/**
148
	 * Free resources bound to this conversationHolder
149
	 */
150
	public void close(){
151

    
152
	}
153
//	
154
//	public boolean isClosed(){
155
//		return false;
156
//	}
157

    
158
}
(2-2/3)