线程上下文ThreadContext

线程上下文ThreadContext


2024年4月11日发(作者:电脑闪屏按什么键恢复)

import ist;

import p;

import ;

import ;

import ;

import Event;

import Listener;

import ;

import tory;

public abstract class ThreadContext {

private static Log log =

();

public static void init() {

final Bundle coreBundle = ndle;

dleContext().addBundleListener(new

BundleListener() {

@Override

public void bundleChanged(BundleEvent arg0) {

int eventType = e();

Bundle bundle = dle();

// 如果插件的状态是正在停止或已经停止

if (eventType == D

|| eventType ==

NG) {

if ((coreBundle)) {

removeAllFilter();

} else {

removeBundleAllThread

(bundle);

}

}

}

});

}

private static List threadList = new

ArrayList();

private static Map> bundleThreadListMap =

new HashMap>();

/**

* 得到线程列表

*

* @return

*/

public static List getThreadList() {

return threadList;

}

/**

* 移除所有的线程

*/

public static void removeAllFilter() {

for (Bundle bundle : ()

.toArray(new Bundle[0])) {

removeBundleAllThread(bundle);

}

}

/**

* 移除某Bundle所有的线程

*

* @param bundle

*/

public static void removeBundleAllThread(Bundle bundle) {

if (!nsKey(bundle))

return;

Thread[] bundleThreadArray =

(bundle).toArray(

new Thread[0]);


发布者:admin,转转请注明出处:http://www.yc00.com/xitong/1712769704a2118829.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信