/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: DataStoreProviderManager.java,v 1.4 2008/08/06 17:28:13 exu Exp $
*
*/
/**
* This is a singleton class used to manage DataStore providers.
* @supported.all.api
*/
public final class DataStoreProviderManager {
/**
* Default.
*/
/**
* Prefix for provider attribute.
*/
"com.sun.identity.plugin.datastore.class.";
/**
* Attribute name for default provider.
*/
"com.sun.identity.plugin.datastore.class.default";
new DataStoreProviderManager();
"libDataStoreProvider");
private DataStoreProviderManager() {
providerMap = new HashMap();
try {
} catch (DataStoreProviderException de) {
+ "exception obtaining default provider:", de);
}
}
/**
* Gets the singleton instance of <code>DataStoreProviderManager</code>.
* @return The singleton <code>DataStoreProviderManager</code> instance
* @throws DataStoreProviderException if unable to get the singleton
* <code>DataStoreProviderManager</code> instance.
*/
throws DataStoreProviderException
{
return instance;
}
/**
* Gets the provider associated with the component.
* When <code>null</code> componentName is passed in, default provider
* is returned.
* @param componentName component name, such as saml, saml2, id-ff, disco,
* authnsvc, and idpp.
* @return datastore provider for the calling component
* @throws DataStoreProviderException if an error occurred.
*
*/
throws DataStoreProviderException
{
return defaultProvider;
} else {
return provider;
}
try {
} catch (Exception e) {
+ "r.getDataStoreProvider: exception while "
throw new DataStoreProviderException(e);
}
}
if (debug.messageEnabled()) {
+ "ger.getDataStoreProvider: no provider specified "
}
}
synchronized(providerMap) {
}
return provider;
}
}
throws DataStoreProviderException
{
throw new DataStoreProviderException(
}
try {
className).newInstance());
} catch (Exception e) {
throw new DataStoreProviderException(e);
}
}
}