01: /*
02: * Copyright 2002-2007 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.springframework.transaction.support;
18:
19: import org.springframework.transaction.PlatformTransactionManager;
20:
21: /**
22: * Extension of the {@link org.springframework.transaction.PlatformTransactionManager}
23: * interface, indicating a native resource transaction manager, operating on a single
24: * target resource. Such transaction managers differ from JTA transaction managers in
25: * that they do not use XA transaction enlistment for an open number of resources but
26: * rather focus on leveraging the native power and simplicity of a single target resource.
27: *
28: * <p>This interface is mainly used for abstract introspection of a transaction manager,
29: * giving clients a hint on what kind of transaction manager they have been given
30: * and on what concrete resource the transaction manager is operating on.
31: *
32: * @author Juergen Hoeller
33: * @since 2.0.4
34: * @see TransactionSynchronizationManager
35: */
36: public interface ResourceTransactionManager extends
37: PlatformTransactionManager {
38:
39: /**
40: * Return the resource factory that this transaction manager operates on,
41: * e.g. a JDBC DataSource or a JMS ConnectionFactory.
42: * <p>This target resource factory is usually used as resource key for
43: * {@link TransactionSynchronizationManager}'s resource bindings per thread.
44: * @return the target resource factory (never <code>null</code>)
45: * @see TransactionSynchronizationManager#bindResource
46: * @see TransactionSynchronizationManager#getResource
47: */
48: Object getResourceFactory();
49:
50: }
|