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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? quickserver.java

?? 一個用java編寫的服務器,對于學習網絡編程的人來說是個很好的例子
?? JAVA
?? 第 1 頁 / 共 5 頁
字號:
			throw e;
		}		
	}

	/**
	 * Initialise all Object and Thread pools.
	 * @since 1.3
	 */
	public void initAllPools() throws Exception {
		logger.fine("Creating pools");
		if(getBlockingMode()==false) {			
			makeByteBufferPool(getBasicConfig().getObjectPoolConfig().getByteBufferObjectPoolConfig());
		}
		
		makeClientPool(getBasicConfig().getObjectPoolConfig().getThreadObjectPoolConfig());
		
		makeClientHandlerPool(
			getBasicConfig().getObjectPoolConfig().getClientHandlerObjectPoolConfig());
		
		//check if client data is poolable
		if(clientDataClass!=null) {
			try {
				clientData = (ClientData)clientDataClass.newInstance();
				if(PoolableObject.class.isInstance(clientData)==true) {
					PoolableObject po = (PoolableObject)clientData;
					if( po.isPoolable()==true) {						
						makeClientDataPool(po.getPoolableObjectFactory(),
							getBasicConfig().getObjectPoolConfig().getClientDataObjectPoolConfig() );
					} else {
						clientDataPool = null;
						logger.fine("ClientData is not poolable!");
					}
				}
			} catch(Exception e) {
				logger.warning("Error: "+e);
				throw e;
			}
		}

		try {
			makeDBObjectPool();
		} catch(Exception e) {
			logger.warning("Error in makeDBObjectPool() : "+e);
			logger.fine("StackTrace:\n"+MyString.getStackTrace(e));
			throw e;
		}
		logger.fine("Created pools");
	}


	/**
	 * Returns {@link org.quickserver.util.pool.thread.ClientPool} class that 
	 * managing the pool of threads for handling clients.
	 * @exception IllegalStateException if pool is not created yet.
	 * @since 1.3
	 */
	public ClientPool getClientPool() {
		if(pool==null)
			throw new IllegalStateException("No ClientPool available yet!");
		return pool;
	}

	/** 
	 * Makes the pool of ClientHandler
	 * @since 1.3
	 */
	private void makeClientHandlerPool(PoolConfig opConfig) throws Exception {
		logger.finer("Creating ClientHandler pool");
		PoolableObjectFactory factory = new ClientHandlerObjectFactory(getBlockingMode());
		clientHandlerPool = poolManager.makeClientHandlerPool(factory, opConfig);
		poolManager.initPool(clientHandlerPool, opConfig);
		clientHandlerPool = makeQSObjectPool(clientHandlerPool);
		clientIdentifier.setClientHandlerPool((QSObjectPool)clientHandlerPool);
	}

	/**
	 * Returns ObjectPool of {@link org.quickserver.net.server.ClientHandler} 
	 * class.
	 * @exception IllegalStateException if pool is not created yet.
	 * @since 1.3
	 */
	public ObjectPool getClientHandlerPool() {
		if(clientHandlerPool==null)
			throw new IllegalStateException("No ClientHandler Pool available yet!");
		return clientHandlerPool;
	}

	
	/**
	 * Sets the confiuration of the QuickServer.
	 * @since 1.3
	 */
	public void setConfig(QuickServerConfig config) {
		this.config = config;
	}

	/**
	 * Returns the confiuration of the QuickServer.
	 * @since 1.3
	 */
	public QuickServerConfig getConfig() {
		return config;
	}

	/** 
	 * Makes the pool of ClientData
	 * @since 1.3
	 */
	private void makeClientDataPool(PoolableObjectFactory factory, 
			PoolConfig opConfig) throws Exception {
		logger.finer("Creating ClientData pool");
		clientDataPool = poolManager.makeClientDataPool(factory, opConfig);
		poolManager.initPool(clientDataPool, opConfig);
		clientDataPool = makeQSObjectPool(clientDataPool);		
	}

	/**
	 * Returns ObjectPool of {@link org.quickserver.net.server.ClientData} 
	 * class. If ClientData was not poolable will return  null.
	 * @since 1.3
	 */
	public ObjectPool getClientDataPool() {
		return clientDataPool;
	}

	/**
	 * Returns {@link org.quickserver.sql.DBPoolUtil} object if
	 * {@link org.quickserver.util.xmlreader.DBObjectPoolConfig} was set.
	 * @return DBPoolUtil object if object could be loaded, else will return <code>null</code>
	 * @since 1.3
	 */
	public DBPoolUtil getDBPoolUtil() {
		return dBPoolUtil;
	}
	/**
	 * Sets {@link org.quickserver.util.xmlreader.DBObjectPoolConfig}
	 * @since 1.3
	 */
	public void setDBObjectPoolConfig(DBObjectPoolConfig dBObjectPoolConfig) {
		getConfig().setDBObjectPoolConfig(dBObjectPoolConfig);
	}

	/** 
	 * Makes the pool of Database Objects
	 * @since 1.3
	 */
	private void makeDBObjectPool() throws Exception {
		if(getConfig().getDBObjectPoolConfig()!=null) {
			logger.fine("Creating DBObject Pool");
			//logger.finest("Got:\n"+getConfig().getDBObjectPoolConfig().toXML(null));
			Class dbPoolUtilClass = getClass(
				getConfig().getDBObjectPoolConfig().getDbPoolUtil(), true);
			dBPoolUtil = (DBPoolUtil) dbPoolUtilClass.newInstance();
			dBPoolUtil.setDatabaseConnections(
				getConfig().getDBObjectPoolConfig().getDatabaseConnectionSet().iterator());
			dBPoolUtil.initPool();
		}
	}

	/**
	 * Tries to find the Client by the Id passed.
	 * <p>
	 * Note: This command is an expensive so do use it limitedly and
	 * cache the returned object. But before you start sending message to the 
	 * cached object do validate that ClientHandler with you is currently 
	 * connected and is pointing to the same clinet has it was before.
	 * This can be done as follows. <pre>
	foundClientHandler.isConnected(); //this method will through SocketException if not connected
	Date newTime = foundClientHandler.getClientConnectedTime();
	if(oldCachedTime!=newTime) {
		//Client had disconnected and ClientHandler was reused for
		//someother client, so write code to again find ur client
		foundClientHandler = handler.getServer().findFirstClientById("friendsid");
		...
	}</pre>
	 * </p>
	 * @see ClientIdentifiable
	 * @return ClientHandler object if client was found else <code>null</code>
	 * @since 1.3.1
	 */
	public ClientHandler findFirstClientById(String id) {
		return clientIdentifier.findFirstClientById(id);
	}

	/**
	 * Returns an iterator containing all the 
	 * {@link org.quickserver.net.server.ClientHandler} that
	 * are currently handling clients. 
	 * It is recommended not to change the collection under an iterator. 
	 *
	 * It is imperative that the user manually synchronize on the returned collection 
	 * when iterating over it: 
	 * <code><pre>
   Eg:

	ClientData foundClientData = null;
	Object syncObj = quickserver.getClientIdentifier().getObjectToSynchronize();
	synchronized(syncObj) {	
		Iterator iterator = quickserver.findAllClient();
		while(iterator.hasNext()) {
			foundClientHandler = (ClientHandler) iterator.next();
			....
		}
	}

	//OR

	ClientData foundClientData = null;
	ClientIdentifier clientIdentifier = quickserver.getClientIdentifier();
	synchronized(clientIdentifier.getObjectToSynchronize()) {	
		Iterator iterator = clientIdentifier.findAllClient();
		while(iterator.hasNext()) {
			foundClientHandler = (ClientHandler) iterator.next();
			....
		}
	}
   </code></pre>
	 * @since 1.3.1
	 */
	public Iterator findAllClient() {
		return clientIdentifier.findAllClient();
	}

	/**
	 * Tries to find the Client by the matching pattern passed to the Id.
	 * <p>
	 * Note: This command is an expensive so do use it limitedly and
	 * cache the returned object. But before you start sending message to the 
	 * cached object do validate that ClientHandler with you is currently 
	 * connected and is pointing to the same clinet has it was before.
	 * This can be done as follows. <pre>
	foundClientHandler.isConnected(); //this method will through SocketException if not connected
	Date newTime = foundClientHandler.getClientConnectedTime();
	if(oldCachedTime!=newTime) {
		//Client had disconnected and ClientHandler was reused for
		//someother client, so write code to again find ur client
		foundClientHandler = handler.getServer().findFirstClientById("friendsid");
		...
	}</pre>
	 * </p>
	 * @see ClientIdentifiable
	 * @return ClientHandler object if client was found else <code>null</code>
	 * @since 1.3.2
	 */
	public Iterator findAllClientById(String pattern) {
		return clientIdentifier.findAllClientById(pattern);
	}

	/**
	 * Tries to find the Client by the Key passed.
	 * <p>
	 * Note: This command is an expensive so do use it limitedly and
	 * cache the returned object. But before you start sending message to the 
	 * cached object do validate that ClientHandler with you is currently 
	 * connected and is pointing to the same clinet has it was before.
	 * This can be done as follows. <pre>
	foundClientHandler.isConnected(); //this method will through SocketException if not connected
	Date newTime = foundClientHandler.getClientConnectedTime();
	if(oldCachedTime!=newTime) {
		//Client had disconnected and ClientHandler was reused for
		//someother client, so write code to again find ur client
		foundClientHandler = handler.getServer().findClientByKey("friendskey");
		...
	}</pre>
	 * </p>
	 * @see ClientIdentifiable
	 * @return ClientHandler object if client was found else <code>null</code>
	 * @since 1.3.1
	 */
	public ClientHandler findClientByKey(String key) {
		return clientIdentifier.findClientByKey(key);
	}

	/**
	 * Tries to find the Client by the matching pattern passed to the key.
	 * <p>
	 * Note: This command is an expensive so do use it limitedly and
	 * cache the returned object. But before you start sending message to the 
	 * cached object do validate that ClientHandler with you is currently 
	 * connected and is pointing to the same clinet has it was before.
	 * This can be done as follows. <pre>
	foundClientHandler.isConnected(); //this method will through SocketException if not connected
	Date newTime = foundClientHandler.getClientConnectedTime();
	if(oldCachedTime!=newTime) {
		//Client had disconnected and ClientHandler was reused for
		//some other client, so write code to again find ur client
		foundClientHandler = handler.getServer().findFirstClientByKey("friendsid");
		...
	}</pre>
	 * </p>
	 * @see ClientIdentifiable
	 * @return ClientHandler object if client was found else <code>null</code>
	 * @since 1.4
	 */
	public Iterator findAllClientByKey(String pattern) {
		return clientIdentifier.findAllClientByKey(pattern);
	}

	/**
	 * Sets next client has a trusted client. 
	 * <p>This will skip any authentication and will not set any timout.</p>
	 * @since 1.3.2
	 */
	public void nextClientIsTrusted() {
		setSkipValidation(true);
	}
	/**
	 * @since 1.3.2
	 */
	private boolean getSkipValidation() {
		return skipValidation;
	}
	/**
	 * @since 1.3.2
	 */
	private synchronized void setSkipValidation(boolean validation) {
		skipValidation = validation;
	}

	/**
	 * Sets the communication logging flag.
	 * @see #getCommunicationLogging
	 * @since 1.3.2
	 */
	public void setCommunicationLogging(boolean communicationLogging) {
		this.communicationLogging = communicationLogging;
	}
	/**
	 * Returns the communication logging flag.
	 * @see #setCommunicationLogging
	 * @since 1.3.2
	 */
	public boolean getCommunicationLogging() {
		return communicationLogging;
	}

	/**
	 * Sets the SecurityManager class
	 * @param securityManagerClass the fully qualified name of the class 
	 * that extends {@link java.lang.SecurityManager}.
	 * @see #getSecurityManagerClass
	 * @since 1.3.3
	 */
	public void setSecurityManagerClass(String securityManagerClass) {
		if(securityManagerClass!=null)
			this.securityManagerClass = securityManagerClass;
	}
	/**
	 * Returns the SecurityManager class
	 * @see #setSecurityManagerClass
	 * @since 1.3.3
	 */
	public String getSecurityManagerClass() {
		return securityManagerClass;
	}

	public SecurityManager getSecurityManager() throws AppException {
		if(getSecurityManagerClass()==null)
			return null;
		SecurityManager sm = null;
		try {
			sm = (SecurityManager) 
				getClass(getSecurityManagerClass(), true).newInstance();
		} catch(ClassNotFoundException e) {
			throw new AppException(e.getMessage());
		} catch(InstantiationException e) {
			throw new AppException(e.getMessage());
		} catch(IllegalAccessException e) {
			throw new AppException(e.getMessage());
		}
		return sm;
	}

	/**
	 * Sets the Access constraints
	 * @since 1.3.3
	 */
	public void setAccessConstraintConfig(
			AccessConstraintConfig accessConstraintConfig) {
		this.accessConstraintConfig = accessConstraintConfig;
	}
	/**
	 * Returns Access constraints if present else <code>null</code>.
	 * @since 1.3.3
	 */
	public AccessConstraintConfig getAccessConstraintConfig() {
		return accessConstraintConfig;
	}

	/**
	 * Sets the classloader to be used to load the dynamicaly resolved 
	 * classes
	 * @since 1.3.3
	 */
	public void setClassLoader(ClassLoader classLoader) {
		this.classLoader = classLoader;
		Thread.currentThread().setContextClassLoader(classLoader);
	}

	/**
	 * Gets the classloader used to load the dynamicaly resolved 
	 * classes.
	 * @since 1.4.6
	 */
	public ClassLoader getClassLoader() {
		return classLoader;
	}

	/**
	 * Utility method to load a class
	 * @since 1.3.3
	 */
	 public Class getClass(String name, boolean reload) 
			throws ClassNotFoundException {
		if(name==null) throw new IllegalArgumentException("Class name can't be null!");
		logger.finest("Class: "+name+", reload: "+reload);
		if(reload==true && classLoader!=null) {
			return classLoader.loadClass(name);
		} else if(reload==true && classLoader==null && this.getClass().getClassLoader()!=null) {
			return this.getClass().getClassLoader().loadClass(name);
		} else if(reload==false && classLoader!=null) {
			return Class.forName(name, true, classLoader);
		} else /*if(reload==false && classLo

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美日韩在线看| 亚洲蜜臀av乱码久久精品| 综合中文字幕亚洲| 男人的j进女人的j一区| 北岛玲一区二区三区四区| 7777精品伊人久久久大香线蕉经典版下载 | 久久久久久久久99精品| 亚洲人成精品久久久久久| 久久激情五月激情| 欧美午夜电影在线播放| 国产精品视频你懂的| 美女爽到高潮91| 欧美日韩大陆一区二区| 悠悠色在线精品| 国产 日韩 欧美大片| 欧美大肚乱孕交hd孕妇| 午夜久久久久久久久| 色视频欧美一区二区三区| 亚洲国产精品精华液ab| 国产激情精品久久久第一区二区| 51精品国自产在线| 亚州成人在线电影| 在线国产电影不卡| 一区二区免费视频| 91麻豆123| 最新国产の精品合集bt伙计| 国产99精品国产| 久久久久久影视| 国内不卡的二区三区中文字幕 | 性久久久久久久久| 欧美色图天堂网| 亚洲精品国产精华液| 91在线视频观看| 亚洲乱码精品一二三四区日韩在线| 国产成人精品免费网站| 国产精品萝li| 色系网站成人免费| 亚洲v精品v日韩v欧美v专区| 欧美在线一二三| 亚洲永久免费av| 91官网在线免费观看| 一个色妞综合视频在线观看| 欧美午夜免费电影| 人人超碰91尤物精品国产| 日韩免费电影一区| 国内精品伊人久久久久av一坑| 精品国产一区二区三区不卡| 国产精品一区二区在线播放 | 成人免费观看视频| 国产精品另类一区| 91老司机福利 在线| 亚洲综合激情另类小说区| 欧美日韩一区二区欧美激情| 蜜臀久久久99精品久久久久久| 日韩欧美久久久| 成人午夜大片免费观看| 亚洲人成小说网站色在线| 欧美色窝79yyyycom| 精品一二三四区| 中文字幕中文字幕一区二区| 欧美又粗又大又爽| 久久精品久久精品| 综合激情成人伊人| 欧美日韩一区二区三区不卡 | 日韩亚洲国产中文字幕欧美| 精品亚洲国内自在自线福利| 国产精品国产三级国产aⅴ原创| 色婷婷亚洲综合| 六月丁香婷婷久久| 国产精品国产三级国产有无不卡| 欧美色老头old∨ideo| 久久99久久久欧美国产| 一区二区国产盗摄色噜噜| 日韩一区二区三区免费看| aaa亚洲精品| 男女视频一区二区| 亚洲免费视频中文字幕| 日韩欧美成人一区| 欧美天天综合网| 国产很黄免费观看久久| 亚洲成人你懂的| 国产精品你懂的在线| 欧美一区二区三区日韩| 92精品国产成人观看免费| 激情六月婷婷久久| 天天综合色天天综合| 综合亚洲深深色噜噜狠狠网站| 精品日韩99亚洲| 欧洲视频一区二区| 波多野结衣亚洲一区| 国模冰冰炮一区二区| 天堂久久一区二区三区| 亚洲精品精品亚洲| 国产精品拍天天在线| 精品国产乱码久久久久久免费| 在线观看国产精品网站| www.欧美日韩| 国产成人精品免费网站| 精品一区二区三区视频在线观看| 亚洲va欧美va国产va天堂影院| 国产精品欧美久久久久无广告| 亚洲精品一区二区三区影院| 欧美精品久久一区| 欧美日本国产一区| 欧美又粗又大又爽| 欧美综合视频在线观看| 日本二三区不卡| 99国产精品国产精品久久| 成人精品视频一区二区三区| 黑人精品欧美一区二区蜜桃| 久久国产精品99久久久久久老狼| 日韩福利电影在线观看| 天堂成人国产精品一区| 亚洲不卡av一区二区三区| 亚洲一区二区偷拍精品| 一个色妞综合视频在线观看| 一区二区三区精品| 亚洲一区二区三区爽爽爽爽爽| 亚洲一区二区三区四区五区黄| 亚洲一区二区三区美女| 同产精品九九九| 日本欧美一区二区三区乱码| 欧美aaaaa成人免费观看视频| 天天综合日日夜夜精品| 美日韩一级片在线观看| 国精产品一区一区三区mba视频| 国产精品白丝jk白祙喷水网站| 国产成人免费av在线| caoporm超碰国产精品| 色婷婷久久99综合精品jk白丝| 欧美这里有精品| 日韩三级免费观看| 久久久综合九色合综国产精品| 欧美国产日产图区| 亚洲在线视频免费观看| 蜜臀久久久99精品久久久久久| 国产在线播放一区二区三区| 高清不卡一区二区| 在线精品亚洲一区二区不卡| 欧美日韩aaa| 久久综合色天天久久综合图片| 欧美极品xxx| 樱花影视一区二区| 精品无人区卡一卡二卡三乱码免费卡| 国产精品538一区二区在线| 一本久道中文字幕精品亚洲嫩 | 天天操天天色综合| 国产一区二区视频在线播放| 成人h动漫精品一区二区| 色老汉av一区二区三区| 日韩一区二区电影网| 国产精品久久久久aaaa| 三级欧美在线一区| 成人午夜视频在线观看| 欧美色电影在线| 久久久久久久精| 亚洲一线二线三线久久久| 国产在线播放一区二区三区| 色噜噜狠狠成人中文综合| 欧美不卡激情三级在线观看| 国产精品久久久久9999吃药| 日本aⅴ精品一区二区三区| 99re热视频这里只精品 | 在线免费视频一区二区| 欧美成人精精品一区二区频| 最新日韩av在线| 久久精品国产99| 欧美日韩亚洲综合在线| 国产精品网站导航| 久久精品99久久久| 在线观看日韩精品| 中文字幕一区在线| 国产激情91久久精品导航| 91精品国产综合久久精品app| 中文字幕中文乱码欧美一区二区 | 日韩精品一区二区三区蜜臀| 亚洲少妇中出一区| 国产精品影视在线| 日韩一区二区在线观看| 亚洲成人资源网| 91极品美女在线| 亚洲欧洲日韩av| 国产成a人无v码亚洲福利| 精品国产青草久久久久福利| 亚洲6080在线| 欧美日韩免费高清一区色橹橹| 亚洲少妇最新在线视频| 成人18精品视频| 久久噜噜亚洲综合| 久久不见久久见免费视频7| 在线播放91灌醉迷j高跟美女| 亚洲欧美电影院| 91免费小视频| 中文字幕一区av| 91网站视频在线观看| 亚洲免费观看在线视频| 色综合一个色综合| 一区二区三区中文在线| 日本久久电影网| 亚洲一级二级三级在线免费观看|