亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? sharehosterplugin.java

?? Azureus is a powerful, full-featured, cross-platform java BitTorrent client
?? JAVA
字號(hào):
/*
 * File    : ShareHosterPlugin.java
 * Created : 05-Jan-2004
 * By      : parg
 * 
 * Azureus - a Java Bittorrent client
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details ( see the LICENSE file ).
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

package com.aelitis.azureus.plugins.sharing.hoster;

/**
 * @author parg
 *
 */

import java.util.*;

import org.gudy.azureus2.plugins.*;
import org.gudy.azureus2.plugins.logging.*;
import org.gudy.azureus2.plugins.torrent.*;
import org.gudy.azureus2.plugins.tracker.*;
import org.gudy.azureus2.plugins.sharing.*;
import org.gudy.azureus2.plugins.download.*;

import org.gudy.azureus2.core3.internat.MessageText;
import org.gudy.azureus2.core3.util.Debug;

public class 
ShareHosterPlugin
	implements Plugin, PluginListener, ShareManagerListener
{
	protected PluginInterface	plugin_interface;
	protected LoggerChannel		log;
	protected Tracker			tracker;
	protected ShareManager		share_manager;
	protected DownloadManager	download_manager;

	protected Map				resource_dl_map = new HashMap();
	protected Map				resource_tt_map = new HashMap();
	
	protected Download			download_being_removed;
	protected TrackerTorrent	torrent_being_removed;
		
	protected boolean			initialised	= false;
	
	public void 
	initialize(
		PluginInterface _plugin_interface )
	{
		plugin_interface = _plugin_interface;
		
		plugin_interface.getPluginProperties().setProperty( "plugin.name", "Share Hoster" );

		log	= plugin_interface.getLogger().getChannel("ShareHosterPlugin");
		
		log.log( LoggerChannel.LT_INFORMATION, "ShareHosterPlugin: initialisation starts");
		
		plugin_interface.addListener( this );
	}
	
	public void
	initializationComplete()
	{
		log.log( LoggerChannel.LT_INFORMATION, "ShareHosterPlugin: initialisation complete");
		
		try{
			tracker	=  plugin_interface.getTracker();
	
			download_manager = plugin_interface.getDownloadManager();
			
			share_manager = plugin_interface.getShareManager();
						
			share_manager.addListener( this );
			
			share_manager.initialise();
			
			initialised	= true;
			
			ShareResource[]	shares = share_manager.getShares();
			
			for ( int i=0;i<shares.length;i++){
				
				resourceAdded( shares[i] );
			}
			
		}catch( ShareException e ){
			
			Debug.printStackTrace( e );
			
			log.log( e );
		}
	}
	
	public void
	closedownInitiated()
	{
	}
	
	public void
	closedownComplete()
	{
	}
	
	public void
	resourceAdded(
		final ShareResource		resource )
	{
		log.log( LoggerChannel.LT_INFORMATION, "Resource added:".concat(resource.getName()));
		
		if ( initialised ){
			
			try{
				
				resource.addDeletionListener(
					new ShareResourceWillBeDeletedListener()
					{
						public void
						resourceWillBeDeleted(
							ShareResource	resource )
						
							throws ShareResourceDeletionVetoException
						{
							canResourceBeDeleted( resource );
						}
					});
				
				Download	new_download = null;
				
				int	type = resource.getType();
				
				if ( type == ShareResource.ST_FILE ){
					
					ShareResourceFile	file_resource = (ShareResourceFile)resource;
					
					ShareItem	item = file_resource.getItem();
			
					Torrent torrent = item.getTorrent();
					
					Download	download = download_manager.getDownload( torrent );
					
					if ( download == null ){
						
						new_download = download_manager.addNonPersistentDownload( torrent, item.getTorrentFile(), file_resource.getFile());
					}
				}else if ( type == ShareResource.ST_DIR ){
				
					ShareResourceDir	dir_resource = (ShareResourceDir)resource;
					
					ShareItem	item = dir_resource.getItem();
					
					Torrent torrent = item.getTorrent();
					
					Download	download = download_manager.getDownload( torrent );
					
					if ( download == null ){
						
						new_download = download_manager.addNonPersistentDownload( torrent, item.getTorrentFile(), dir_resource.getDir());
					}
				}
				
				if ( new_download != null ){

					final Download	f_new_download = new_download;
					
					resource_dl_map.put( resource, new_download );
					
					resource.addChangeListener(
						new ShareResourceListener()
						{
							public void
							shareResourceChanged(
								ShareResource			resource,
								ShareResourceEvent		event )
							{
								if ( event.getType() == ShareResourceEvent.ET_ATTRIBUTE_CHANGED ){
							
									TorrentAttribute	attribute = (TorrentAttribute)event.getData();
									
									// System.out.println( "sh: res -> ds: " + attribute.getName() + "/" + resource.getAttribute( attribute ));
									
									f_new_download.setAttribute(
											attribute,
											resource.getAttribute( attribute ));
								}
							}
						});
						
					TorrentAttribute[]	attributes = resource.getAttributes();
					
					for (int i=0;i<attributes.length;i++){
						
						TorrentAttribute	ta = attributes[i];
									
						new_download.setAttribute( ta,	resource.getAttribute( ta ));
					}
					
					new_download.addPropertyListener(
						new DownloadPropertyListener()
						{
							public void
							propertyChanged(
								Download				download,
								DownloadPropertyEvent	event )
							{
								if ( event.getType() == DownloadPropertyEvent.PT_TORRENT_ATTRIBUTE ){
									
									TorrentAttribute	at = (TorrentAttribute)event.getData();
									
									// System.out.println( "sh: rs -> res " + at.getName() + "/" + download.getAttribute( at ));
									
									resource.setAttribute( at, download.getAttribute( at ));
						
								}
							}
						});
					
					Torrent	dl_torrent = new_download.getTorrent();
					
					if ( dl_torrent != null ){
						
						TrackerTorrent	tt = tracker.host(dl_torrent, false );
						
						tt.addRemovalListener(
								new TrackerTorrentWillBeRemovedListener()
								{
									public void
									torrentWillBeRemoved(
										TrackerTorrent	tt )
									
										throws TrackerTorrentRemovalVetoException
									{
										if ( tt != torrent_being_removed ){
											
											throw( new TrackerTorrentRemovalVetoException(
													MessageText.getString("plugin.sharing.torrent.remove.veto")));
										}
									}								
								});
						
						resource_tt_map.put( resource, tt );
					}
					
					new_download.addDownloadWillBeRemovedListener(
							new DownloadWillBeRemovedListener()
							{
								public void
								downloadWillBeRemoved(
									Download	dl )
								
									throws DownloadRemovalVetoException
								{
									if ( dl != download_being_removed ){
										
										throw( new DownloadRemovalVetoException(
													MessageText.getString("plugin.sharing.download.remove.veto")));
									}
								}
							});
				}
				
			}catch( Throwable e ){
				
				Debug.printStackTrace( e );
			}
		}
	}
	
	protected void
	canResourceBeDeleted(
		ShareResource	resource )
	
		throws ShareResourceDeletionVetoException
	{
		Download	dl = (Download)resource_dl_map.get(resource);
		
		if ( dl != null ){
			
			try{
				download_being_removed	= dl;
				
				dl.canBeRemoved();
				
			}catch( DownloadRemovalVetoException e ){
				
				throw( new ShareResourceDeletionVetoException( e.getMessage()));
				
			}finally{
				
				download_being_removed	= null;
			}
		}
		
		TrackerTorrent	tt = (TrackerTorrent)resource_tt_map.get(resource);
		
		if ( tt != null ){
		
			try{
				torrent_being_removed	= tt;
				
				tt.canBeRemoved();
				
			}catch( TrackerTorrentRemovalVetoException e ){
				
				throw( new ShareResourceDeletionVetoException( e.getMessage()));
				
			}finally{
				
				torrent_being_removed	= null;
			}
		}	
	}
	
	public void
	resourceModified(
		ShareResource		resource )
	{
		log.log( LoggerChannel.LT_INFORMATION, "Resource modified:".concat(resource.getName()));
		
		if ( initialised ){
			
			resourceDeleted( resource );
			
			resourceAdded( resource );
		}
	}
	
	public void
	resourceDeleted(
		ShareResource		resource )
	{
		log.log( LoggerChannel.LT_INFORMATION, "Resource deleted:".concat(resource.getName()));
		
		if ( initialised ){
		
			Download	dl = (Download)resource_dl_map.get(resource);
			
			if ( dl != null ){
				
				try{
					download_being_removed	= dl;
					
						// the resource has gone! stop torrent if running to permit 
						// deletion
					
					try{
						dl.stop();
						
					}catch( Throwable e ){
						
						// ignore this as it might already be stopped
					}
					
					dl.remove();
					
				}catch( Throwable e ){
					
					Debug.printStackTrace( e );
					
				}finally{
					
					download_being_removed	= null;
				}
				
				resource_dl_map.remove( resource );
			}	
			
			TrackerTorrent	tt = (TrackerTorrent)resource_tt_map.get(resource);
			
			if ( tt != null ){
				
				try{
					torrent_being_removed	= tt;
					
					tt.remove();
					
				}catch( Throwable e ){
					
					Debug.printStackTrace( e );
					
				}finally{
					
					torrent_being_removed	= null;
				}
				
				resource_tt_map.remove( resource );
			}	
		}
	}

	public void
	reportProgress(
		int		percent_complete )
	{
	}
	
	public void
	reportCurrentTask(
		String	task_description )
	{
		log.log( LoggerChannel.LT_INFORMATION, "Current Task:".concat(task_description) );
	}
}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
天天影视网天天综合色在线播放| 国产精品影视网| 日韩一级免费观看| 日本91福利区| 欧美变态tickling挠脚心| 蜜桃视频在线观看一区| 99精品国产一区二区三区不卡| 欧美精品一区二区在线播放| 五月天一区二区| 欧美一级夜夜爽| 麻豆国产欧美一区二区三区| 久久精品人人做人人爽97| 国产在线麻豆精品观看| 久久久久久久久久久黄色| 成人黄色小视频| 久久精品国产在热久久| 国产精品全国免费观看高清| av中文字幕在线不卡| 日韩码欧中文字| 欧美日韩中文另类| 激情综合网激情| 中文字幕中文字幕中文字幕亚洲无线| 国产suv精品一区二区三区| 图片区日韩欧美亚洲| 日本高清不卡aⅴ免费网站| 亚洲成人免费在线观看| 国产精品视频看| 日韩精品一区二区三区视频 | 综合电影一区二区三区| 日韩午夜在线影院| 欧美日韩视频一区二区| 91在线你懂得| 岛国av在线一区| 国产不卡视频一区| 国产丶欧美丶日本不卡视频| 91福利视频在线| 国产一区二区三区免费| 久久无码av三级| 正在播放一区二区| 久久综合久久99| 久久久蜜臀国产一区二区| 欧美日本乱大交xxxxx| av高清久久久| 93久久精品日日躁夜夜躁欧美| 国产在线不卡一卡二卡三卡四卡| 日本欧美久久久久免费播放网| 综合欧美亚洲日本| 亚洲激情六月丁香| 亚洲尤物视频在线| 亚洲午夜免费视频| 美脚の诱脚舐め脚责91| 高清成人在线观看| 欧美一区二区三区日韩视频| 国产精品色在线观看| 亚洲激情图片一区| 美女爽到高潮91| 国产91清纯白嫩初高中在线观看| av激情亚洲男人天堂| 欧美一激情一区二区三区| 国产精品网曝门| 蜜臀av性久久久久蜜臀aⅴ| 99久久国产免费看| 久久久精品国产免大香伊| 亚洲成人综合网站| 国产成人精品aa毛片| 色婷婷亚洲综合| 久久精品日韩一区二区三区| 性欧美疯狂xxxxbbbb| 捆绑调教一区二区三区| 在线观看日韩精品| 欧美国产日本视频| 卡一卡二国产精品| 日韩一区二区免费电影| 性做久久久久久久免费看| 欧美精品久久天天躁| 亚洲成人激情av| 国产在线观看一区二区| 91精品国产麻豆国产自产在线| 亚洲免费成人av| 在线观看免费成人| 亚洲高清一区二区三区| 色狠狠av一区二区三区| 亚洲综合色成人| 久久99精品国产.久久久久| 久久久久国产精品免费免费搜索| 国产馆精品极品| 欧美韩日一区二区三区四区| 成人亚洲一区二区一| 亚洲欧美在线高清| 色域天天综合网| 日韩福利电影在线| www亚洲一区| av动漫一区二区| 午夜久久久久久久久久一区二区| 在线播放视频一区| 成人av在线一区二区三区| 亚洲精品精品亚洲| 欧美mv日韩mv国产网站| 国产精品一区二区在线播放| 亚洲欧美一区二区视频| 欧美日韩三级视频| 国产999精品久久| 亚洲成人黄色影院| 欧美国产日本韩| 精品蜜桃在线看| 色一区在线观看| 成人网在线播放| 日本不卡123| 亚洲另类中文字| 国产精品久久久久一区二区三区共 | 国产91在线观看| 秋霞午夜av一区二区三区| 国产精品不卡一区二区三区| 国产亚洲欧美日韩在线一区| 欧美一区二区日韩一区二区| 波多野结衣91| 国产成人在线网站| 蜜桃av一区二区| 亚洲综合色区另类av| 一区二区三区中文字幕电影| 国产午夜精品福利| 亚洲人123区| 亚洲成a人片在线观看中文| 一区二区三区在线播| 亚洲欧洲性图库| 亚洲色图欧美激情| 亚洲国产日日夜夜| 日韩成人伦理电影在线观看| 亚洲.国产.中文慕字在线| 日韩电影一区二区三区四区| 精品一区二区三区免费观看| 蜜桃久久久久久| 91在线视频观看| 欧美精品在线一区二区三区| 欧美大片在线观看| 久久先锋资源网| 中文字幕永久在线不卡| 国产精品视频一二三| 亚洲午夜一区二区三区| 国产成人精品一区二| 欧美猛男gaygay网站| 国产网站一区二区三区| 国产精品高清亚洲| 日本亚洲三级在线| 成人av电影免费观看| 99国产精品久久| 欧美大胆一级视频| 免费在线观看不卡| 欧美在线免费观看视频| 国产三级欧美三级日产三级99| 国产精品免费视频一区| 美女网站在线免费欧美精品| 91免费观看视频在线| 亚洲国产成人在线| 麻豆精品久久久| 日韩亚洲欧美成人一区| 日韩国产精品91| 91精品国产一区二区人妖| 亚洲尤物视频在线| 91久久精品一区二区二区| 精品第一国产综合精品aⅴ| 捆绑调教一区二区三区| 久久综合国产精品| 成人av在线看| 亚洲精品免费播放| 欧美午夜精品免费| 天使萌一区二区三区免费观看| 色88888久久久久久影院野外| 国产精品国产自产拍高清av王其| 黄色成人免费在线| 一本久久综合亚洲鲁鲁五月天| 亚洲精品久久久蜜桃| 欧美午夜精品电影| 性感美女极品91精品| 国产人伦精品一区二区| 99精品一区二区| 亚洲欧洲精品天堂一级 | 亚洲精品欧美在线| 欧美一区二区三区的| 日韩电影在线观看网站| 精品免费日韩av| 在线国产亚洲欧美| 日本vs亚洲vs韩国一区三区 | 亚洲视频免费看| 日韩欧美激情一区| 国产精品18久久久久久久久| 国产精品高潮呻吟久久| 欧美日韩精品一区二区三区蜜桃| 极品少妇一区二区| 日韩黄色片在线观看| 一区二区在线观看不卡| 国产亚洲欧美日韩日本| 欧美日韩不卡视频| 大陆成人av片| 精品一二线国产| 久久99久久99小草精品免视看| 丝袜诱惑亚洲看片| 亚洲猫色日本管| 亚洲色图一区二区三区| 2021国产精品久久精品|