changeset 80:f7a9b323458b

*** empty log message ***
author pin
date Tue, 11 Dec 2007 12:35:01 +0900
parents d1877cfd131d
children 13819571691d
files rep/SessionList.java rep/SessionManager.java rep/xml/SessionXMLDecoder.java test/XMLTest.java
diffstat 4 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/rep/SessionList.java	Tue Dec 11 12:35:01 2007 +0900
+++ b/rep/SessionList.java	Tue Dec 11 12:35:01 2007 +0900
@@ -41,7 +41,7 @@
 	private SocketChannel smchannel;
 	private boolean channelequals = false;
 	private LinkedList<Session> tmpSessionList = new LinkedList<Session>();
-	private String host;
+	private String maxHost;
 	
 	public SessionList(){
 		makeDefaultSession();
@@ -275,14 +275,14 @@
 		return sessionLinkedList.get(sid - 1);
 	}
 
-	public void setHost(String myHost) {
+	public void setMaxHost(String myHost) {
 		// TODO Auto-generated method stub
-		host = myHost;
+		maxHost = myHost;
 	}
 
 	public String getHost() {
 		// TODO Auto-generated method stub
-		return host;
+		return maxHost;
 	}
 
 	public void setList(LinkedList<Session> list) {
--- a/rep/SessionManager.java	Tue Dec 11 12:35:01 2007 +0900
+++ b/rep/SessionManager.java	Tue Dec 11 12:35:01 2007 +0900
@@ -296,6 +296,7 @@
 	}
 	
 	private boolean setMaxHost(SocketChannel channel, String host) {
+		if(maxHost == null) maxHost = myHost;
 		if(host.compareTo(maxHost) < 0){
 			//host > MaxHost なら maxHost = host
 			//masterを設定する。
--- a/rep/xml/SessionXMLDecoder.java	Tue Dec 11 12:35:01 2007 +0900
+++ b/rep/xml/SessionXMLDecoder.java	Tue Dec 11 12:35:01 2007 +0900
@@ -50,7 +50,7 @@
 			
 			//sessionlist = createSessionList(root);
 			sessionlist = generateSessionList(root);
-			sessionlist.setHost(getSessionManagerHost(root));
+			sessionlist.setMaxHost(getSessionManagerHost(root));
 			
 		} catch (Exception e) {
 			e.printStackTrace();
--- a/test/XMLTest.java	Tue Dec 11 12:35:01 2007 +0900
+++ b/test/XMLTest.java	Tue Dec 11 12:35:01 2007 +0900
@@ -26,7 +26,7 @@
 		session.addEditor(editor2);
 		
 		SessionList sessionlist = new SessionList();
-		sessionlist.setHost("naha.ie.u-ryukyu.ac.jp");
+		sessionlist.setMaxHost("naha.ie.u-ryukyu.ac.jp");
 		sessionlist.addSession(session);
 		
 		/*** SessionList から XML へ ***/