/**
* 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: Module.java,v 1.3 2008/06/25 05:51:36 qcheng Exp $
*
*/
/**
* <p>
* A <code>Module</code> is the root of a logical subsystem of classes,
* together which provide a set of services that are orthogonal to those
* provided by other <code>Module</code>s. Any such subsystem of classes is
* expected to use a single <code>Module</code> instance throughout the life
* time of all classes within itself. An instance of <code>Module</code> is
* associated with a unique <code>id</code>, a unique <code>resource</code> and
* a unique <code>offset</code>. The unique <code>resource</code> is used as
* a configuration namespace qualifier that provides uniquely visible
* configuration to the subsystem if needed. This <code>resource</code> is also
* used as the Debug name in case the subsystem represented by this module
* must record debug messages, warnings and errors.
* </p><p>
* The correct way to use this class is to create static wrappers which define
* the <code>init()</code> methods and register the <code>Module</code> instance
* with the <code>ModuleList</code> class.
* </p>
*/
{
/**
* Returns a <code>IModuleAccess</code> instance that allows the caller
* to obtain <code>Module</code> specific services without being directly
* in possession of the underlying <code>Module</code> instance.
*
* @return a <code>IModuleAccess</code> instance
*/
return new ModuleAccess(this);
}
/**
* Returns the String representation of this <code>Module</code>.
*
* @return the String representation of this <code>Module</code>.
*/
}
/* (non-Javadoc)
* @see com.sun.identity.agents.arch.IModuleAccess#makeLocalizableString(int)
*/
}
/* (non-Javadoc)
* @see IModuleAccess#makeLocalizableString(int, java.lang.Object[])
*/
}
/* (non-Javadoc)
* @see com.sun.identity.agents.arch.IModuleAccess#getResource(int)
*/
}
/* (non-Javadoc)
* @see IModuleAccess#getResource(int, java.util.Locale)
*/
}
/**
* Tests for equality of this <code>Module</code> instance with the given
* <code>Object</code>. Returns <code>true</code> if and only if the
* given <code>Object</code> is an instance of <code>Module</code> with
* the same module code as this <code>Module</code> instance.
*
* @param object the object to be compared against.
*
* @return true if the given <code>Object</code> is an instance of
* <code>Module</code> with the same module code as this instance.
*/
boolean result = false;
}
return result;
}
/**
* Creates a <code>Module</code> instance and initializes the associated
* localization and debug resources.
*
* @param code the module code to be used for creating this module.
* @param moduleStringId the string identifier for the localized module name
* to be used.
* @param fixedName the fixed name of the module to be used for finding or
* creating the associated localization, configuration and debug resources.
*/
getModuleLocale()));
}
/**
* Returns the module code associated with this instance of a
* <code>Module</code>.
*
* @return the module code.
*/
byte getModuleCode() {
return _moduleCode;
}
/**
* Returns the fixed name associated with this instance of
* <code>Module</code>.
*
* @return the fixed name of this <code>Module</code>.
*/
return _moduleFixedName;
}
/* (non-Javadoc)
* @see com.sun.identity.agents.arch.IDebugAccess#isLogMessageEnabled()
*/
public boolean isLogMessageEnabled() {
return getDebug().messageEnabled();
}
/* (non-Javadoc)
* @see IDebugAccess#logMessage(java.lang.String)
*/
}
/* (non-Javadoc)
* @see IDebugAccess#logMessage(java.lang.String, java.lang.Throwable)
*/
}
/* (non-Javadoc)
* @see IDebugAccess#isLogWarningEnabled()
*/
public boolean isLogWarningEnabled() {
return getDebug().warningEnabled();
}
/* (non-Javadoc)
* @see IDebugAccess#logWarning(java.lang.String)
*/
}
/* (non-Javadoc)
* @see IDebugAccess#logWarning(java.lang.String, java.lang.Throwable)
*/
}
/* (non-Javadoc)
* @see IDebugAccess#logError(java.lang.String)
*/
}
/* (non-Javadoc)
* @see IDebugAccess#logError(java.lang.String, java.lang.Throwable)
*/
}
/**
* Returns the <code>Locale</code> of this <code>Module</code>.
* @return the <code>Locale</code> of this <code>Module</code>.
*/
return _moduleLocale;
}
/**
* Returns the <code>com.iplanet.am.util.Debug</code> instance associated
* with this <code>Module</code>.
*
* @return the <code>com.iplanet.am.util.Debug</code> instance associated
* with this <code>Module</code>.
*/
return _debug;
}
if (isLogMessageEnabled()) {
}
}
if(isLogMessageEnabled()) {
+ locale);
}
}
return _moduleResourceBundle;
}
}
+ "." + CONFIG_SUBKEY_LOCALE_LANG;
+ "." + CONFIG_SUBKEY_LOCALE_COUNTRY;
if((languageConfigValue == null)
if(getDebug().messageEnabled()) {
+ languageConfigKey + ", trying "
}
if((languageConfigValue == null)
if(getDebug().messageEnabled()) {
+ ", using default value: "
}
}
}
if((countryConfigValue == null)
if(getDebug().messageEnabled()) {
+ countryConfigKey + ", trying "
}
if((countryConfigValue == null)
if(getDebug().messageEnabled()) {
+ ", using default value: "
}
}
}
}
}
}
private int getModuleStringId() {
return _moduleStringId;
}
}
}
private byte _moduleCode;
private int _moduleStringId;
static {
}
}