summaryrefslogtreecommitdiff
path: root/qpid/java/common/src/main/java/org/apache/qpid/thread/Threading.java
blob: 0fb113d22c869272eea2ea4bdc8dd189d5eea22e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package org.apache.qpid.thread;

public final class Threading
{
    private static ThreadFactory threadFactory;
    
    static {
        try
        {
            Class threadFactoryClass = 
                Class.forName(System.getProperty("qpid.thread_factory", 
                                                 "org.apache.qpid.thread.DefaultThreadFactory"));
            
            threadFactory = (ThreadFactory)threadFactoryClass.newInstance();
        }
        catch(Exception e)
        {
            throw new Error("Error occured while loading thread factory",e);
        }
    }
    
    public static ThreadFactory getThreadFactory()
    {
        return threadFactory;
    }
}