001: /**
002: * All content copyright (c) 2003-2007 Terracotta, Inc., except as may otherwise be noted in a separate copyright
003: * notice. All rights reserved.
004: */package org.terracotta.modules;
005:
006: import org.osgi.framework.BundleContext;
007: import org.terracotta.modules.configuration.TerracottaConfiguratorModule;
008:
009: public class ExcludesConfiguration extends TerracottaConfiguratorModule {
010:
011: protected void addInstrumentation(final BundleContext context) {
012: super .addInstrumentation(context);
013: configAutoLockExcludes();
014: configPermanentExcludes();
015: configNonPortables();
016: }
017:
018: private void configNonPortables() {
019: configHelper
020: .addNonportablePattern("javax.servlet.GenericServlet");
021: }
022:
023: private void configAutoLockExcludes() {
024: configHelper
025: .addAutoLockExcludePattern("* java.lang.Throwable.*(..)");
026: }
027:
028: private void configPermanentExcludes() {
029: configHelper.addPermanentExcludePattern("java.awt.Component");
030: configHelper.addPermanentExcludePattern("java.lang.Thread");
031: configHelper
032: .addPermanentExcludePattern("java.lang.ThreadLocal");
033: configHelper
034: .addPermanentExcludePattern("java.lang.ThreadGroup");
035: configHelper.addPermanentExcludePattern("java.lang.Process");
036: configHelper
037: .addPermanentExcludePattern("java.lang.ClassLoader");
038: configHelper.addPermanentExcludePattern("java.lang.Runtime");
039: configHelper.addPermanentExcludePattern("java.io.FileReader");
040: configHelper.addPermanentExcludePattern("java.io.FileWriter");
041: configHelper
042: .addPermanentExcludePattern("java.io.FileDescriptor");
043: configHelper
044: .addPermanentExcludePattern("java.io.FileInputStream");
045: configHelper
046: .addPermanentExcludePattern("java.io.FileOutputStream");
047: configHelper
048: .addPermanentExcludePattern("java.net.DatagramSocket");
049: configHelper
050: .addPermanentExcludePattern("java.net.DatagramSocketImpl");
051: configHelper
052: .addPermanentExcludePattern("java.net.MulticastSocket");
053: configHelper
054: .addPermanentExcludePattern("java.net.ServerSocket");
055: configHelper.addPermanentExcludePattern("java.net.Socket");
056: configHelper.addPermanentExcludePattern("java.net.SocketImpl");
057: configHelper
058: .addPermanentExcludePattern("java.nio.channels.DatagramChannel");
059: configHelper
060: .addPermanentExcludePattern("java.nio.channels.FileChannel");
061: configHelper
062: .addPermanentExcludePattern("java.nio.channels.FileLock");
063: configHelper
064: .addPermanentExcludePattern("java.nio.channels.ServerSocketChannel");
065: configHelper
066: .addPermanentExcludePattern("java.nio.channels.SocketChannel");
067: configHelper
068: .addPermanentExcludePattern("java.util.logging.FileHandler");
069: configHelper
070: .addPermanentExcludePattern("java.util.logging.SocketHandler");
071: configHelper
072: .addPermanentExcludePattern("com.sun.crypto.provider..*");
073:
074: //
075: configHelper
076: .addPermanentExcludePattern("java.util.WeakHashMap+");
077: configHelper.addPermanentExcludePattern("java.lang.ref.*");
078:
079: // unsupported java.util.concurrent types
080: configHelper
081: .addPermanentExcludePattern("java.util.concurrent.AbstractExecutorService");
082: configHelper
083: .addPermanentExcludePattern("java.util.concurrent.ArrayBlockingQueue*");
084: configHelper
085: .addPermanentExcludePattern("java.util.concurrent.ConcurrentLinkedQueue*");
086: configHelper
087: .addPermanentExcludePattern("java.util.concurrent.ConcurrentSkipListMap*");
088: configHelper
089: .addPermanentExcludePattern("java.util.concurrent.ConcurrentSkipListSet*");
090: configHelper
091: .addPermanentExcludePattern("java.util.concurrent.CopyOnWriteArrayList*");
092: configHelper
093: .addPermanentExcludePattern("java.util.concurrent.CopyOnWriteArraySet*");
094: configHelper
095: .addPermanentExcludePattern("java.util.concurrent.CountDownLatch*");
096: configHelper
097: .addPermanentExcludePattern("java.util.concurrent.DelayQueue*");
098: configHelper
099: .addPermanentExcludePattern("java.util.concurrent.Exchanger*");
100: configHelper
101: .addPermanentExcludePattern("java.util.concurrent.ExecutorCompletionService*");
102: configHelper
103: .addPermanentExcludePattern("java.util.concurrent.LinkedBlockingDeque*");
104: configHelper
105: .addPermanentExcludePattern("java.util.concurrent.PriorityBlockingQueue*");
106: configHelper
107: .addPermanentExcludePattern("java.util.concurrent.ScheduledThreadPoolExecutor*");
108: configHelper
109: .addPermanentExcludePattern("java.util.concurrent.Semaphore*");
110: configHelper
111: .addPermanentExcludePattern("java.util.concurrent.SynchronousQueue*");
112: configHelper
113: .addPermanentExcludePattern("java.util.concurrent.ThreadPoolExecutor*");
114: configHelper
115: .addPermanentExcludePattern("java.util.concurrent.atomic.AtomicBoolean*");
116: configHelper
117: .addPermanentExcludePattern("java.util.concurrent.atomic.AtomicIntegerArray*");
118: configHelper
119: .addPermanentExcludePattern("java.util.concurrent.atomic.AtomicIntegerFieldUpdater*");
120: configHelper
121: .addPermanentExcludePattern("java.util.concurrent.atomic.AtomicLongArray*");
122: configHelper
123: .addPermanentExcludePattern("java.util.concurrent.atomic.AtomicLongFieldUpdater*");
124: configHelper
125: .addPermanentExcludePattern("java.util.concurrent.atomic.AtomicMarkableReference*");
126: configHelper
127: .addPermanentExcludePattern("java.util.concurrent.atomic.AtomicReference*");
128: configHelper
129: .addPermanentExcludePattern("java.util.concurrent.atomic.AtomicReferenceArray*");
130: configHelper
131: .addPermanentExcludePattern("java.util.concurrent.atomic.AtomicReferenceFieldUpdater*");
132: configHelper
133: .addPermanentExcludePattern("java.util.concurrent.atomic.AtomicStampedReference*");
134: configHelper
135: .addPermanentExcludePattern("java.util.concurrent.locks.AbstractQueuedLongSynchronizer*");
136: //configHelper.addPermanentExcludePattern("java.util.concurrent.locks.AbstractQueuedSynchronizer*");
137: configHelper
138: .addPermanentExcludePattern("java.util.concurrent.locks.LockSupport*");
139: }
140:
141: }
|