Search in sources :

Example 1 with DebugProviderImpl

use of com.sun.identity.shared.debug.impl.DebugProviderImpl in project OpenAM by OpenRock.

the class Debug method initialize.

/**
     * Initializes the Debug Service by locating the SPI implementations and
     * instantiating the appropriate classes.
     */
private static synchronized void initialize() {
    if (!serviceInitialized) {
        String providerName = SystemPropertiesManager.get(DebugConstants.CONFIG_DEBUG_PROVIDER);
        IDebugProvider provider = null;
        boolean providerLoadFailed = false;
        Exception exceptionCatched = null;
        if (providerName != null && providerName.trim().length() > 0) {
            try {
                provider = (IDebugProvider) Class.forName(providerName).newInstance();
            } catch (ClassNotFoundException cnex) {
                providerLoadFailed = true;
                exceptionCatched = cnex;
            } catch (InstantiationException iex) {
                providerLoadFailed = true;
                exceptionCatched = iex;
            } catch (IllegalAccessException iaex) {
                providerLoadFailed = true;
                exceptionCatched = iaex;
            } catch (ClassCastException ccex) {
                providerLoadFailed = true;
                exceptionCatched = ccex;
            }
        }
        if (provider == null) {
            if (providerLoadFailed) {
                ResourceBundle bundle = com.sun.identity.shared.locale.Locale.getInstallResourceBundle("amUtilMsgs");
                StdDebugFile.printError(Debug.class.getSimpleName(), bundle.getString("com.iplanet" + ".services" + ".debug.invalidprovider"), exceptionCatched);
            }
            provider = new DebugProviderImpl();
        }
        setDebugProvider(provider);
        serviceInitialized = true;
    }
}
Also used : ResourceBundle(java.util.ResourceBundle) DebugProviderImpl(com.sun.identity.shared.debug.impl.DebugProviderImpl)

Example 2 with DebugProviderImpl

use of com.sun.identity.shared.debug.impl.DebugProviderImpl in project OpenAM by OpenRock.

the class DebugTestTemplate method initializeProvider.

/**
     * Initialize the debug provider
     *
     * @param debugConfigPath
     */
public void initializeProvider(String debugConfigPath) throws InvalidDebugConfigurationException {
    DebugConfigurationFromProperties debugConfig = new DebugConfigurationFromProperties(debugConfigPath);
    debugFileProvider = new DebugFileProviderForTest(debugConfig, TimeService.SYSTEM);
    provider = new DebugProviderImpl(debugFileProvider);
}
Also used : DebugConfigurationFromProperties(com.sun.identity.shared.debug.file.impl.DebugConfigurationFromProperties) DebugProviderImpl(com.sun.identity.shared.debug.impl.DebugProviderImpl)

Example 3 with DebugProviderImpl

use of com.sun.identity.shared.debug.impl.DebugProviderImpl in project OpenAM by OpenRock.

the class DebugTestTemplate method initializeProvider.

/**
     * Initialize the debug provider
     *
     * @param debugConfigPath
     */
public void initializeProvider(String debugConfigPath) throws InvalidDebugConfigurationException {
    DebugConfigurationFromProperties debugConfig = new DebugConfigurationFromProperties(debugConfigPath);
    debugFileProvider = new DebugFileProviderForTest(debugConfig, TimeService.SYSTEM);
    provider = new DebugProviderImpl(debugFileProvider);
}
Also used : DebugConfigurationFromProperties(com.sun.identity.shared.debug.file.impl.DebugConfigurationFromProperties) DebugProviderImpl(com.sun.identity.shared.debug.impl.DebugProviderImpl)

Aggregations

DebugProviderImpl (com.sun.identity.shared.debug.impl.DebugProviderImpl)3 DebugConfigurationFromProperties (com.sun.identity.shared.debug.file.impl.DebugConfigurationFromProperties)2 ResourceBundle (java.util.ResourceBundle)1