站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 jmx API Documentation 英文版文档

LoadMgr3 (JBoss/JMX API) - JBoss 4.0.1 sp1 jmx API Documentation 英文版文档


org.jboss.mx.loading
Class LoadMgr3

java.lang.Object
  extended byorg.jboss.mx.loading.LoadMgr3

public class LoadMgr3
extends Object

A utility class used by the UnifiedClassLoader3 to manage the thread based class loading tasks.

Version:
$Revision: 1.9 $
Author:
Scott.Stark@jboss.org

Nested Class Summary
static class LoadMgr3.PkgClassLoader
          A UCL and its relative ordering with respect to the class loading.
 
Constructor Summary
LoadMgr3()
           
 
Method Summary
static boolean beginLoadTask(ClassLoadingTask task, UnifiedLoaderRepository3 repository)
          Initiate the class loading task.
static void endLoadTask(ClassLoadingTask task)
          Complete a ClassLoadingTask.
static void nextTask(Thread t, ClassLoadingTask task, UnifiedLoaderRepository3 repository)
          Called by threads owning a UCL3.loadLock from within UCL3.loadClass to process ThreadTasks assigned to them.
static void registerLoaderThread(RepositoryClassLoader ucl, Thread t)
          Register that a thread owns the UCL3.loadClass monitor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoadMgr3

public LoadMgr3()
Method Detail

registerLoaderThread

public static void registerLoaderThread(RepositoryClassLoader ucl,
                                        Thread t)
Register that a thread owns the UCL3.loadClass monitor. This is called from within UCL3.loadClass(String,boolean) and this method creates entries in the loadClassThreads and loadTasksByThread maps.


beginLoadTask

public static boolean beginLoadTask(ClassLoadingTask task,
                                    UnifiedLoaderRepository3 repository)
                             throws ClassNotFoundException
Initiate the class loading task. This is called by UCL3.loadClass to initiate the process of loading the requested class. This first attempts to load the class from the repository cache, and then the class loaders in the repsository. If the package of the class is found in the repository then one or more ThreadTask are created to complete the ClassLoadingTask. The ThreadTask are assigned to the threads that own the associated UCL3 monitor. If no class loader serves the class package, then the requesting class loader is asked if it can load the class.

Returns:
true if the class could be loaded from the cache or requesting UCL3, false to indicate the calling thread must process the tasks assigned to it until the ClassLoadingTask state is FINISHED
Throws:
ClassNotFoundException - if there is no chance the class can be loaded from the current repository class loaders.

nextTask

public static void nextTask(Thread t,
                            ClassLoadingTask task,
                            UnifiedLoaderRepository3 repository)
                     throws InterruptedException
Called by threads owning a UCL3.loadLock from within UCL3.loadClass to process ThreadTasks assigned to them. This is the mechanism by which we avoid deadlock due to a given loadClass request requiring multiple UCLs to be involved. Any thread active in loadClass with the monitor held processes class loading tasks that must be handled by its UCL3. The active set of threads loading classes form a pool of cooperating threads.

Throws:
InterruptedException

endLoadTask

public static void endLoadTask(ClassLoadingTask task)
Complete a ClassLoadingTask. This is called by UCL3.loadClass to indicate that the thread is existing the loadClass method.



Copyright © 2002 JBoss Group, LLC. All Rights Reserved.