⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 plugindeprecation.java

📁 java 文件下载器。可自定义
💻 JAVA
字号:
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   PluginDeprecation.java

package org.gudy.azureus2.pluginsimpl.local.deprecate;

import java.util.*;
import org.gudy.azureus2.core3.config.COConfigurationManager;
import org.gudy.azureus2.core3.config.StringList;
import org.gudy.azureus2.core3.config.impl.StringListImpl;
import org.gudy.azureus2.core3.internat.MessageText;
import org.gudy.azureus2.core3.util.Constants;
import org.gudy.azureus2.core3.util.Debug;
import org.gudy.azureus2.plugins.PluginInterface;
import org.gudy.azureus2.plugins.logging.Logger;
import org.gudy.azureus2.plugins.logging.LoggerChannel;
import org.gudy.azureus2.plugins.ui.*;
import org.gudy.azureus2.plugins.ui.components.*;
import org.gudy.azureus2.plugins.ui.model.BasicPluginViewModel;
import org.gudy.azureus2.pluginsimpl.local.PluginInitializer;
import org.gudy.azureus2.ui.swt.plugins.UISWTInstance;

// Referenced classes of package org.gudy.azureus2.pluginsimpl.local.deprecate:
//			PluginDeprecationException

public class PluginDeprecation
{

	private static final String CONFIG_KEY = "PluginDeprecationWarnings";
	private static final String FORUM_STABLE_LINK = "http://forum.vuze.com/forum.jspa?forumID=3";
	private static final String FORUM_BETA_LINK = "http://forum.vuze.com/forum.jspa?forumID=4";
	private static final int IGNORE = 0;
	private static final int NOTIFY_ONCE = 1;
	private static final int NOTIFY_EVERY = 2;
	private static final int NOTIFY_AND_DIE = 3;
	private static final int DIE = 4;
	private static BasicPluginViewModel model = null;
	private static LoggerChannel channel = null;
	private static Map behaviour_mapping = new HashMap();
	private static Set persistent_warnings;
	private static Set instance_warnings = Collections.synchronizedSet(new HashSet());

	public PluginDeprecation()
	{
	}

	private static void register(String identifier, int stable_behaviour, int beta_behaviour)
	{
		behaviour_mapping.put(identifier, new Integer(Constants.isCVSVersion() ? beta_behaviour : stable_behaviour));
	}

	public static void call(String identifier, Object context)
	{
		call(identifier, context.getClass().getName());
	}

	public static void call(String identifier, String context)
	{
		Integer behaviour = (Integer)behaviour_mapping.get(identifier);
		if (behaviour == null)
			throw new IllegalArgumentException((new StringBuilder()).append("unknown deprecated call identifier: ").append(identifier).toString());
		int b = behaviour.intValue();
		if (b == 0)
			return;
		boolean persistent_notify = b == 1;
		boolean notify = b != 4;
		boolean raise_error = b == 3 || b == 4;
		String persistent_id = (new StringBuilder()).append(context).append(":").append(identifier).toString();
		if (notify && !instance_warnings.contains(context) && (!persistent_notify || !persistent_warnings.contains(persistent_id)))
		{
			instance_warnings.add(context);
			if (!persistent_notify && persistent_warnings.remove(persistent_id))
				COConfigurationManager.setParameter("PluginDeprecationWarnings", new StringListImpl(persistent_warnings));
			synchronized (org/gudy/azureus2/pluginsimpl/local/deprecate/PluginDeprecation)
			{
				if (model == null)
				{
					PluginInterface pi = PluginInitializer.getDefaultInterface();
					model = pi.getUIManager().createBasicPluginViewModel(MessageText.getString("PluginDeprecation.view"));
					model.getStatus().setVisible(false);
					model.getProgress().setVisible(false);
					model.getActivity().setVisible(false);
					model.getLogArea().appendText(MessageText.getString("PluginDeprecation.log.start", new String[] {
						Constants.isCVSVersion() ? "http://forum.vuze.com/forum.jspa?forumID=4" : "http://forum.vuze.com/forum.jspa?forumID=3"
					}));
					UIManagerListener uiml = new UIManagerListener(pi) {

						final PluginInterface val$pi;

						public void UIAttached(UIInstance inst)
						{
							if (inst instanceof UISWTInstance)
							{
								((UISWTInstance)inst).openView(PluginDeprecation.model);
								pi.getUIManager().removeUIListener(this);
							}
						}

						public void UIDetached(UIInstance uiinstance)
						{
						}

			
			{
				pi = plugininterface;
				super();
			}
					};
					pi.getUIManager().addUIListener(uiml);
				}
				String log_details = MessageText.getString("PluginDeprecation.log.details", new String[] {
					identifier, context, Debug.getStackTrace(false, false)
				});
				model.getLogArea().appendText(log_details);
				if (channel == null)
					channel = PluginInitializer.getDefaultInterface().getLogger().getChannel("PluginDeprecation");
				channel.logAlert(2, MessageText.getString("PluginDeprecation.alert"));
				Debug.out((new PluginDeprecationException((new StringBuilder()).append("Deprecated plugin call - ").append(persistent_id).toString())).fillInStackTrace());
			}
			if (persistent_notify)
			{
				persistent_warnings.add(persistent_id);
				COConfigurationManager.setParameter("PluginDeprecationWarnings", new StringListImpl(persistent_warnings));
			}
		}
		if (raise_error)
			throw new PluginDeprecationException(persistent_id);
		else
			return;
	}

	static 
	{
		persistent_warnings = Collections.synchronizedSet(new HashSet());
		register("property listener", 0, 2);
		register("createPluginView", 0, 2);
		register("getSWTManager", 0, 0);
		register("openTorrentFile", 0, 2);
		register("openTorrentURL", 0, 2);
		register("setDisabled", 0, 1);
		register("isDisabled", 0, 1);
		register("isBuiltIn", 0, 1);
		register("isMandatory", 0, 1);
		register("isOperational", 0, 1);
		register("isShared", 0, 1);
		register("unload", 0, 1);
		register("reload", 0, 1);
		register("uninstall", 0, 1);
		register("isUnloadable", 0, 1);
		persistent_warnings.addAll(Arrays.asList(COConfigurationManager.getStringListParameter("PluginDeprecationWarnings").toArray()));
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -