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

📄 systemmanager.java

📁 JAVA解析MSNP15协议
💻 JAVA
字号:
package jm.framework.msn;

import java.net.InetSocketAddress;

import jm.framework.msn.msg.group.MsgGroupFactory;
import jm.framework.msn.msg.group.ThreadGroupFactory;
import jm.framework.msn.msg.group.UserGroupFactory;

/**
 * 系统管理进程
 * 梦界家园MSNP15
 * @author ISHome
 * @since 0.5.0.1
 * @version 0.1
 */
public class SystemManager {
	/** 系统进程*/
	private static SystemManager instance;
	public static SystemManager getInstance() {
		if (instance == null) {
			instance = new SystemManager();
		}
		return instance;
	}	

	/** 信息队列*/
	private MsgGroupFactory messageGroup;
	public MsgGroupFactory getMessageGroup() {
		if (messageGroup == null) {
			messageGroup = new MsgGroupFactory();
		}
		return messageGroup;
	}
	
	/** 线程工厂*/
	private ThreadGroupFactory threadGroup;
	public ThreadGroupFactory getThreadGroup() {
		if (threadGroup == null) {
			threadGroup = new ThreadGroupFactory();
		}
		return threadGroup;
	}
	
	/** 用户*/	
	private UserGroupFactory userGroup;
	public UserGroupFactory getUserGroup() {
		if (userGroup == null) {
			userGroup = new UserGroupFactory();
		}
		return userGroup;
	}
	
	/** 服务器地址*/
	private InetSocketAddress serverAddress;
	public InetSocketAddress getServerAddress() {
		if (serverAddress == null) {
			final int DEFAULT_PORT = 1863;
			final String SERVER_NAME = "messenger.hotmail.com";//"207.46.109.35";//
			serverAddress = new InetSocketAddress(SERVER_NAME, DEFAULT_PORT);
		}
		return serverAddress;
	}
	/**
	 * 更新服务器地址
	 * @param host
	 * @param port
	 * @return
	 */
	public void reloadServerAddress(String host, int port) {
		serverAddress = new InetSocketAddress(host, port);
	}

}

⌨️ 快捷键说明

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