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

com.axway.apim.actions.rest.Transaction Maven / Gradle / Ivy

package com.axway.apim.actions.rest;

import java.util.HashMap;

/**
 * Helper class which can be used for any purpose to store information and to be pulled out later. 
 * It's a Singleton and created when the tools logs-in for the first time into the API-Manager.
 * 
 * @author [email protected]
 */
public class Transaction {
	private static Transaction instance;
	
	private HashMap context = new HashMap();
	
	private Transaction() {}
	
	public static synchronized Transaction getInstance () {
		if (Transaction.instance == null) {
			Transaction.instance = new Transaction ();
		}
		return Transaction.instance;
	}
	
	public static synchronized void deleteInstance () {
		Transaction.instance = null;
	}
	
	public void beginTransaction() {
		this.context.clear();
	}
	public void stopTransaction() {
		this.context.clear();
	}
	
	public void put(Object key, Object value) {
		this.context.put(key, value);
	}
	
	public Object get(Object key) {
		return this.context.get(key);
	}	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy