public static synchronized Enumeration < Stack > getStacks ( ) { List < Stack > result = new CopyOnWriteArrayList < Stack > ( ) ; if ( ! initialized ) { initialize ( ) ; } // Gets the classloader of the code that called this method, may be null. ClassLoader callerCL = ClassLoader . getSystemClassLoader ( ) ; // Walk through the loaded stacks. for ( StackInfo di : stacks ) { // If the caller does not have permission to load the stack then skip it. if ( getCallerClass ( callerCL , di . stackClassName ) != di . stackClass ) { println ( new StringBuilder ( ) . append ( " skipping: " ) . append ( di ) . toString ( ) ) ; continue ; } result . add ( di . stack ) ; } return Collections . enumeration ( result ) ; }
Retrieves an Enumeration with all of the currently loaded Diameter stacks to which the current caller has access .