comparison rep/Forwarder.java @ 355:98607350f7d1

*** empty log message ***
author kono
date Fri, 17 Oct 2008 22:11:34 +0900
parents 0d47ff22ee0e
children 034acadc0cdc
comparison
equal deleted inserted replaced
354:6ea3aa6c795f 355:98607350f7d1
14 Forwarder next; 14 Forwarder next;
15 // REPCommands we sent to the next editor 15 // REPCommands we sent to the next editor
16 final int limit=100; 16 final int limit=100;
17 REPLogger ns = REPLogger.singleton(); 17 REPLogger ns = REPLogger.singleton();
18 SessionManager manager; 18 SessionManager manager;
19 public REP mode = null;
19 20
20 public Forwarder(SessionManager manager) { 21 public Forwarder(SessionManager manager) {
21 this.manager = manager; 22 this.manager = manager;
22 } 23 }
23 24
83 if (editor!=null) { 84 if (editor!=null) {
84 editor.manage(command); 85 editor.manage(command);
85 } else throw new IOException(); 86 } else throw new IOException();
86 } 87 }
87 88
89 public void setMode(REP cmd) {
90 mode = cmd;
91 }
92
93 public boolean isEditor() {
94 return mode==REP.SMCMD_JOIN||mode==REP.SMCMD_PUT;
95 }
96
97 public boolean isForwarder() {
98 return mode==REP.SMCMD_SM_JOIN||mode==REP.SMCMD_SM_JOIN_ACK;
99 }
100
101
88 } 102 }