/** 
 * 
 * Copyright 2004 Protique Ltd
 * 
 * Licensed 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 
 * 
 * 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. 
 * 
 **/
package org.codehaus.activemq.store;

import org.codehaus.activemq.message.ActiveMQXid;
import org.codehaus.activemq.service.Service;
import org.codehaus.activemq.service.Transaction;
import org.codehaus.activemq.service.TransactionManager;

import javax.transaction.xa.XAException;

/**
 * Represents a durable store of a prepare log for XA
 *
 * @version $Revision: 1.1 $
 */
public interface PreparedTransactionStore extends Service {

    public ActiveMQXid[] getXids() throws XAException;

    public void remove(ActiveMQXid xid) throws XAException;

    public void put(ActiveMQXid xid, Transaction transaction) throws XAException;

    /**
     * Called on recovery to re-load any transactions which have prepared but
     * not yet commited
     *
     * @param transactionManager
     */
    public void loadPreparedTransactions(TransactionManager transactionManager) throws XAException;
}
