XATransactionManager.java 2.0 KB
Newer Older
1
/*
2 3 4 5 6 7
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
8 9 10 11 12 13 14 15 16 17
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

18
package org.apache.shardingsphere.transaction.xa.spi;
19

20 21
import org.apache.shardingsphere.infra.spi.typed.TypedSPI;

22
import javax.sql.XADataSource;
23
import javax.transaction.TransactionManager;
24
import java.util.Properties;
25 26 27 28

/**
 * XA transaction manager.
 */
29
public interface XATransactionManager extends AutoCloseable, TypedSPI {
30
    
31
    /**
T
terrymanu 已提交
32
     * Initialize XA transaction manager.
33
     */
T
terrymanu 已提交
34
    void init();
35
    
36 37
    /**
     * Register recovery resource.
38
     *
39
     * @param dataSourceName data source name
T
terrymanu 已提交
40
     * @param xaDataSource XA data source
41 42 43 44 45
     */
    void registerRecoveryResource(String dataSourceName, XADataSource xaDataSource);
    
    /**
     * Remove recovery resource.
46
     *
47
     * @param dataSourceName data source name
48
     * @param xaDataSource   XA data source
49 50
     */
    void removeRecoveryResource(String dataSourceName, XADataSource xaDataSource);
T
terrymanu 已提交
51
    
52
    /**
53
     * Enlist single XA resource.
54
     * 
55
     * @param singleXAResource single XA resource
56
     */
57
    void enlistResource(SingleXAResource singleXAResource);
58 59 60 61 62 63 64
    
    /**
     * Get transaction manager.
     * 
     * @return transaction manager
     */
    TransactionManager getTransactionManager();
65
}