本文整理了Java中java.lang.SecurityManager.getThreadGroup()
方法的一些代码示例,展示了SecurityManager.getThreadGroup()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SecurityManager.getThreadGroup()
方法的具体详情如下:
包路径:java.lang.SecurityManager
类名称:SecurityManager
方法名:getThreadGroup
[英]Returns the current thread's thread group.
[中]返回当前线程的线程组。
代码示例来源:origin: apache/incubator-dubbo
public NamedThreadFactory(String prefix, boolean daemon) {
mPrefix = prefix + "-thread-";
mDaemon = daemon;
SecurityManager s = System.getSecurityManager();
mGroup = (s == null) ? Thread.currentThread().getThreadGroup() : s.getThreadGroup();
}
代码示例来源:origin: apache/incubator-dubbo
public NamedThreadFactory(String prefix, boolean daemon) {
mPrefix = prefix + "-thread-";
mDaemon = daemon;
SecurityManager s = System.getSecurityManager();
mGroup = (s == null) ? Thread.currentThread().getThreadGroup() : s.getThreadGroup();
}
代码示例来源:origin: netty/netty
public DefaultThreadFactory(String poolName, boolean daemon, int priority) {
this(poolName, daemon, priority, System.getSecurityManager() == null ?
Thread.currentThread().getThreadGroup() : System.getSecurityManager().getThreadGroup());
}
代码示例来源:origin: alibaba/canal
public NamedThreadFactory(String name, boolean daemon){
this.name = name;
this.daemon = daemon;
SecurityManager s = System.getSecurityManager();
group = (s != null) ? s.getThreadGroup() : Thread.currentThread().getThreadGroup();
}
代码示例来源:origin: apache/storm
public NettyRenameThreadFactory(String name) {
SecurityManager s = System.getSecurityManager();
group = (s != null) ? s.getThreadGroup() :
Thread.currentThread().getThreadGroup();
this.name = name;
}
代码示例来源:origin: springside/springside4
private NamedThreadFactory(String name) {
final SecurityManager s = System.getSecurityManager();
this.group = (s != null) ? s.getThreadGroup() : Thread.currentThread().getThreadGroup();
this.namePrefix = name;
}
代码示例来源:origin: redisson/redisson
public DefaultThreadFactory(String poolName, boolean daemon, int priority) {
this(poolName, daemon, priority, System.getSecurityManager() == null ?
Thread.currentThread().getThreadGroup() : System.getSecurityManager().getThreadGroup());
}
代码示例来源:origin: alibaba/Sentinel
public NamedThreadFactory(String namePrefix, boolean daemon) {
this.daemon = daemon;
SecurityManager s = System.getSecurityManager();
group = (s != null) ? s.getThreadGroup() :
Thread.currentThread().getThreadGroup();
this.namePrefix = namePrefix;
}
代码示例来源:origin: neo4j/neo4j
@Deprecated
public NamedThreadFactory( String threadNamePrefix, int priority, Monitor monitor, boolean daemon )
{
this.threadNamePrefix = threadNamePrefix;
SecurityManager securityManager = System.getSecurityManager();
group = (securityManager != null) ?
securityManager.getThreadGroup() :
Thread.currentThread().getThreadGroup();
this.priority = priority;
this.daemon = daemon;
this.monitor = monitor;
}
代码示例来源:origin: apache/zookeeper
DaemonThreadFactory(String name, int firstThreadNum) {
threadNumber.set(firstThreadNum);
SecurityManager s = System.getSecurityManager();
group = (s != null)? s.getThreadGroup() :
Thread.currentThread().getThreadGroup();
namePrefix = name + "-";
}
代码示例来源:origin: sohutv/cachecloud
public NamedThreadFactory(String prefix, boolean daemo) {
mPrefix = prefix + "-thread-";
mDaemo = daemo;
SecurityManager s = System.getSecurityManager();
mGroup = (s == null) ? Thread.currentThread().getThreadGroup() : s.getThreadGroup();
}
代码示例来源:origin: sohutv/cachecloud
public NamedThreadFactory(String prefix, boolean daemo) {
mPrefix = prefix + "-thread-";
mDaemo = daemo;
SecurityManager s = System.getSecurityManager();
mGroup = (s == null) ? Thread.currentThread().getThreadGroup() : s.getThreadGroup();
}
代码示例来源:origin: alibaba/jstorm
NettyRenameThreadFactory(String name) {
SecurityManager s = System.getSecurityManager();
group = (s != null) ? s.getThreadGroup() : Thread.currentThread().getThreadGroup();
this.name = name;
}
代码示例来源:origin: sohutv/cachecloud
public NamedThreadFactory(String prefix, boolean daemo) {
mPrefix = prefix + "-thread-";
mDaemo = daemo;
SecurityManager s = System.getSecurityManager();
mGroup = (s == null) ? Thread.currentThread().getThreadGroup() : s.getThreadGroup();
}
代码示例来源:origin: weibocom/motan
public DefaultThreadFactory(String prefix, boolean isDaemon, int priority) {
SecurityManager s = System.getSecurityManager();
this.threadGroup = (s != null) ? s.getThreadGroup() : Thread.currentThread().getThreadGroup();
this.namePrefix = prefix + "-" + poolNumber.getAndIncrement() + "-thread-";
this.isDaemon = isDaemon;
this.priority = priority;
}
代码示例来源:origin: looly/hutool
/**
* 获取当前线程的线程组
*
* @return 线程组
* @since 3.1.2
*/
public static ThreadGroup currentThreadGroup() {
final SecurityManager s = System.getSecurityManager();
return (null != s) ? s.getThreadGroup() : Thread.currentThread().getThreadGroup();
}
代码示例来源:origin: objectbox/objectbox-java
ObjectBoxThreadFactory() {
SecurityManager securityManager = System.getSecurityManager();
group = (securityManager != null) ? securityManager.getThreadGroup() :
Thread.currentThread().getThreadGroup();
}
代码示例来源:origin: looly/hutool
/**
* 获取当前线程的线程组
*
* @return 线程组
* @since 3.1.2
*/
public static ThreadGroup currentThreadGroup() {
final SecurityManager s = System.getSecurityManager();
return (null != s) ? s.getThreadGroup() : Thread.currentThread().getThreadGroup();
}
代码示例来源:origin: apache/hbase
public DaemonThreadFactory(String name) {
SecurityManager s = System.getSecurityManager();
group = (s != null) ? s.getThreadGroup() : Thread.currentThread().getThreadGroup();
namePrefix = name + poolNumber.getAndIncrement() + "-thread-";
}
代码示例来源:origin: neo4j/neo4j
@Override
public ThreadGroup getThreadGroup()
{
return managerExists() ? securityManager.getThreadGroup() : super.getThreadGroup();
}
内容来源于网络,如有侵权,请联系作者删除!