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

📄 installablepluginimpl.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:   InstallablePluginImpl.java

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

import org.gudy.azureus2.core3.util.*;
import org.gudy.azureus2.plugins.*;
import org.gudy.azureus2.plugins.installer.*;
import org.gudy.azureus2.plugins.update.UpdateCheckInstance;
import org.gudy.azureus2.pluginsimpl.update.PluginUpdatePlugin;

// Referenced classes of package org.gudy.azureus2.pluginsimpl.local.installer:
//			PluginInstallerImpl

public abstract class InstallablePluginImpl
	implements InstallablePlugin
{

	private PluginInstallerImpl installer;

	protected InstallablePluginImpl(PluginInstallerImpl _installer)
	{
		installer = _installer;
	}

	public boolean isAlreadyInstalled()
	{
		PluginInterface pi = getAlreadyInstalledPlugin();
		if (pi == null)
			return false;
		String version = getVersion();
		if (version == null || version.length() == 0)
			return false;
		String existing_version = pi.getPluginVersion();
		if (existing_version == null)
			return true;
		else
			return Constants.compareVersions(existing_version, version) >= 0;
	}

	public PluginInterface getAlreadyInstalledPlugin()
	{
		return installer.getAlreadyInstalledPlugin(getId());
	}

	public void install(boolean shared)
		throws PluginException
	{
		installer.install(this, shared);
	}

	public void install(boolean shared, boolean low_noise, final boolean wait_until_done)
		throws PluginException
	{
		final AESemaphore sem = new AESemaphore("FPI");
		final PluginException error[] = {
			null
		};
		installer.install(new InstallablePlugin[] {
			this
		}, shared, low_noise, null, new PluginInstallationListener() {

			final AESemaphore val$sem;
			final PluginException val$error[];
			final boolean val$wait_until_done;
			final InstallablePluginImpl this$0;

			public void completed()
			{
				sem.release();
			}

			public void cancelled()
			{
				failed(new PluginException("Install cancelled"));
			}

			public void failed(PluginException e)
			{
				error[0] = e;
				sem.release();
				if (!wait_until_done)
					Debug.out("Install failed", e);
			}

			
			{
				this$0 = InstallablePluginImpl.this;
				sem = aesemaphore;
				error = apluginexception;
				wait_until_done = flag;
				super();
			}
		});
		if (wait_until_done)
		{
			sem.reserve();
			if (error[0] != null)
				throw error[0];
		}
	}

	public void uninstall()
		throws PluginException
	{
		installer.uninstall(this);
	}

	public PluginInstaller getInstaller()
	{
		return installer;
	}

	public abstract void addUpdate(UpdateCheckInstance updatecheckinstance, PluginUpdatePlugin pluginupdateplugin, Plugin plugin, PluginInterface plugininterface);
}

⌨️ 快捷键说明

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