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

org.jscep.client.inspect.DefaultCertStoreInspectorFactory Maven / Gradle / Ivy

There is a newer version: 2.5.6
Show newest version
package org.jscep.client.inspect;

import java.security.cert.CertStore;
import java.util.Collections;
import java.util.Map;
import java.util.WeakHashMap;

/**
 * Concrete factory for generating new DefaultCertStoreInspector instances.
 */
public class DefaultCertStoreInspectorFactory implements
        CertStoreInspectorFactory {
    private static final Map INSTANCES = Collections.synchronizedMap(new WeakHashMap());

    /**
     * {@inheritDoc}
     */
    @Override
    public CertStoreInspector getInstance(final CertStore store) {
        CertStoreInspector instance = INSTANCES.get(store);
        if (instance != null) {
            return instance;
        }
        instance = new DefaultCertStoreInspector(store);
        INSTANCES.put(store, instance);

        return instance;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy