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

com.xmlcalabash.util.RuntimeRegistry Maven / Gradle / Ivy

There is a newer version: 1.1.20-p16-98
Show newest version
package com.xmlcalabash.util;

import com.xmlcalabash.core.XProcRuntime;

import java.util.HashMap;

/**
 * Created by ndw on 5/7/14.
 */
public class RuntimeRegistry {
    private static RuntimeRegistry instance = null;
    private HashMap registry = null;

    protected RuntimeRegistry() {
        registry = new HashMap ();
    }

    public synchronized static RuntimeRegistry getInstance() {
        if(instance == null) {
            instance = new RuntimeRegistry();
        }
        return instance;
    }

    public synchronized void registerRuntime(Object o, XProcRuntime runtime) {
        registry.put(o, runtime);
    }

    public synchronized void unregisterRuntime(Object o) {
        registry.remove(o);
    }

    public synchronized XProcRuntime getRuntime(Object o) {
        return registry.get(o);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy