All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.atomikos.recovery.tcc.rest.TccRecoverableResource Maven / Gradle / Ivy

There is a newer version: 4.0.6
Show newest version
/**
 * Copyright (C) 2000-2017 Atomikos 
 *
 * LICENSE CONDITIONS
 *
 * See http://www.atomikos.com/Main/WhichLicenseApplies for details.
 */

package com.atomikos.recovery.tcc.rest;

import com.atomikos.datasource.RecoverableResource;
import com.atomikos.datasource.ResourceException;
import com.atomikos.icatch.RecoveryService;

public class TccRecoverableResource implements RecoverableResource {

	static final String NAME = "TccRecoverableResource";
	private boolean closed = false;
	
	@Override
	public void setRecoveryService(RecoveryService recoveryService)
			throws ResourceException {
	}

	@Override
	public void close() throws ResourceException {
		this.closed = true;
	}

	@Override
	public String getName() {
		return NAME;
	}

	@Override
	public boolean isClosed() {
		return closed;
	}

	@Override
	public void recover() {
		if(TccRecoveryManager.getInstance() != null) {
			TccRecoveryManager.getInstance().recover();	
		}
			
	}

	@Override
	public boolean isSameRM(RecoverableResource res) throws ResourceException {
		return getName().equals(res.getName());
	}


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy