Does anyone know how to get a list of Coldfusion Threads (created with the 
cfthread tag), programatically. I don't have access to the Server Monitor. If a 
thread is aborted, I need to know it was aborted, I have a thread that runs 
once every 24 hours. I know you can access thread data with the CF object 
"cfide.adminapi.administrator", but you need the Server Monitor password. I 
have tried to do it with java, but haven't been able to get the info I need 
when I use the enumerate() function of the Thread class. Here is the java code 
if anyone is interested:
class allthreads
{
        public static void main (String [] args) 
        {
                Thread x = new Thread();
                //System.out.println("active count: " + x.activeCount());       
        
        
                // Find the root thread group
                ThreadGroup root = 
Thread.currentThread().getThreadGroup().getParent();
                while (root.getParent() != null) 
                {
                        root = root.getParent();
                }
                
                // Visit each thread group
                visit(root, 0);
        }
    
    // This method recursively visits all thread groups under `group'.
    public static void visit(ThreadGroup group, int level) 
        {
        // Get threads in `group'
        int numThreads = group.activeCount();
        Thread[] threads = new Thread[numThreads*2];
        numThreads = group.enumerate(threads, false);
    
        // Enumerate each thread in `group'
        for (int i=0; i<numThreads; i++) 
                {
            // Get thread
            Thread thread = threads[i];
                        
                        System.out.println("Thread Name: " + thread.getName());
        }
    
        // Get thread subgroups of `group'
        int numGroups = group.activeGroupCount();
        ThreadGroup[] groups = new ThreadGroup[numGroups*2];
        numGroups = group.enumerate(groups, false);
    
        // Recursively visit each subgroup
        for (int i=0; i<numGroups; i++) 
                {
            visit(groups[i], level+1);
                        
                        System.out.println("root group name:" + 
group.getName());
        }
    }
}


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325736
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to