DefaultThreadFactory(int threadPriority) {
   this.threadNumber = new AtomicInteger(1);
   this.threadPriority = threadPriority;
   SecurityManager s = System.getSecurityManager();
   this.group = s != null ? s.getThreadGroup() : Thread.currentThread().getThreadGroup();
   this.namePrefix = "uil-pool-" + poolNumber.getAndIncrement() + "-thread-";
 }
Esempio n. 2
0
 public CrawlerThreadFactory(String prefix, ThreadGroup group, boolean isDaemon) {
   tNo = new AtomicInteger(0);
   this.prefix = prefix;
   if (null != group) {
     this.group = group;
   } else {
     SecurityManager sm = System.getSecurityManager();
     group = (sm != null) ? sm.getThreadGroup() : Thread.currentThread().getThreadGroup();
   }
   this.isDaemon = isDaemon;
 }
 public NamedThreadFactory(final int priority) {
   this.priority = priority;
   final SecurityManager securityManager = System.getSecurityManager();
   if (securityManager == null) {
     final Thread currentThread = Thread.currentThread();
     this.parentGroup = currentThread.getThreadGroup();
   } else {
     this.parentGroup = securityManager.getThreadGroup();
   }
   this.namePrefix = "pool-" + poolNumber.getAndIncrement();
 }
 public EsThreadFactory(String namePrefix) {
   this.namePrefix = namePrefix;
   SecurityManager s = System.getSecurityManager();
   group = (s != null) ? s.getThreadGroup() : Thread.currentThread().getThreadGroup();
 }
 public LDAThreadFactory(String namePrePrefix) {
   SecurityManager s = System.getSecurityManager();
   group = (s != null) ? s.getThreadGroup() : Thread.currentThread().getThreadGroup();
   namePrefix = namePrePrefix + "-" + poolNumber.getAndIncrement() + "-thread-";
 }
 DefaultThreadFactory(int threadPriority, String threadNamePrefix) {
   this.threadPriority = threadPriority;
   SecurityManager s = System.getSecurityManager();
   group = (s != null) ? s.getThreadGroup() : Thread.currentThread().getThreadGroup();
   namePrefix = threadNamePrefix + poolNumber.getAndIncrement() + "-thread-";
 }
  public MojarraThreadFactory(String factoryName) {

    SecurityManager s = System.getSecurityManager();
    group = (s != null) ? s.getThreadGroup() : Thread.currentThread().getThreadGroup();
    namePrefix = "Mojarra-" + factoryName + '-' + poolNumber.getAndIncrement() + "-thread-";
  }
Esempio n. 8
0
 DefaultThreadFactory() {
   SecurityManager s = System.getSecurityManager();
   group = (s != null) ? s.getThreadGroup() : Thread.currentThread().getThreadGroup();
   namePrefix = "pool-" + poolNumber.getAndIncrement() + "-thread-";
 }
 public DaemonThreadFactory(String namePrefix) {
   SecurityManager s = System.getSecurityManager();
   this.group = (s != null) ? s.getThreadGroup() : Thread.currentThread().getThreadGroup();
   this.namePrefix =
       namePrefix != null ? namePrefix : "pool-" + poolNumber.getAndIncrement() + "-thread-";
 }
 public JUPnPThreadFactory() {
   SecurityManager s = System.getSecurityManager();
   group = (s != null) ? s.getThreadGroup() : Thread.currentThread().getThreadGroup();
 }
 public NamedThreadFactory(final String name) {
   SecurityManager s = System.getSecurityManager();
   group = (s != null) ? s.getThreadGroup() : Thread.currentThread().getThreadGroup();
   namePrefix = name + '-' + poolNumber.getAndIncrement() + "-thread-";
 }
 @Test
 public void provideThreadGroupOfOriginalSecurityManager() {
   ThreadGroup threadGroup = new ThreadGroup("dummy name");
   when(originalSecurityManager.getThreadGroup()).thenReturn(threadGroup);
   assertThat(managerWithOriginal.getThreadGroup(), is(threadGroup));
 }
 @Override
 public ThreadGroup getThreadGroup() {
   if (securityManager != null) return securityManager.getThreadGroup();
   return super.getThreadGroup();
 }
Esempio n. 14
0
 private NamedThreadFactory(String name) {
   final SecurityManager s = System.getSecurityManager();
   this.group = (s != null) ? s.getThreadGroup() : Thread.currentThread().getThreadGroup();
   this.namePrefix = name;
 }