/**
* 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: ModuleList.java,v 1.2 2008/06/25 05:51:37 qcheng Exp $
*
*/
/**
* Represents a list of registered <code>Module</code>s at runtime for reference
* purposes. The <code>ModuleList</code> class initializes and registers all
* the configured <code>Module</code>s during static initialization and makes
* them available for reference by other classes within the system at a later
* time.
*/
public class ModuleList {
/**
* Adds a <code>Module</code> in the list of registered
* <code>Module</code>s.
* Note that if a <code>Module</code> is registered with the same module
* code as an already registered <code>Module</code>, an
* <code>IllegalStateException</code> is thrown by this method.
*
* @param module to be registered.
* @throws <code>IllegalStateException</code> if there is an attempt to
* register a <code>Module</code> with the same module code as an already
* registered <code>Module</code>.
*/
throw new IllegalStateException(
"Attempt to re-register the Module: "
+ module);
}
if(getBaseModule().isLogMessageEnabled()) {
}
}
/**
* Retrieves a registered <code>Module</code> that was registered during
* the Agent runtime initialization.
*
* @param code the module code associated with the <code>Module</code> to
* be retrieved.
*
* @return the associated <code>Module</code> with the given module code, or
* <code>null</code> if no such module was registered.
*/
}
/**
* Initializes the registered <code>Module</code>s in the system. This
* method is automatically executed by the static initializer of
* <code>ModuleList</code>.
*/
private synchronized static void initializeModules() {
if( !isInitialized()) {
String[] moduleList =
try {
if(getBaseModule().isLogMessageEnabled()) {
"Loading Module: " + nextModuleLoader);
}
new Object[]{});
"Exception while registering module: "
+ nextModuleLoader, ex);
}
}
}
}
}
private static boolean isInitialized() {
return _initialized;
}
private static void markInitialized() {
_initialized = true;
}
return _baseModule;
}
return _moduleMap;
}
private static boolean _initialized = false;
static {
}
}