1 28 29 package com.caucho.server.resin; 30 31 import com.caucho.config.ConfigException; 32 import com.caucho.server.port.Port; 33 import com.caucho.server.port.ProtocolConfig; 34 import com.caucho.util.L10N; 35 36 39 public class SrunPort extends Port { 40 private static L10N L = new L10N(SrunPort.class); 41 42 private int _index = -1; 43 private String _group = ""; 44 private boolean _isBackup; 45 private String _protocolName = "hmux"; 46 47 50 public void setProtocol(ProtocolConfig protocol) 51 throws ConfigException 52 { 53 if (protocol.getId().equals("srun")) 54 _protocolName = "srun"; 55 else if (protocol.getId().equals("hmux")) 56 _protocolName = "hmux"; 57 else 58 throw new ConfigException(L.l("`{0}' is an unknown srun protocol. The protocol must be:\n hmux - new Resin P2P srun protocol\n srun - old Resin protocol", 59 protocol)); 60 } 61 62 65 public String getSrunProtocol() 66 { 67 return _protocolName; 68 } 69 70 73 public void setIndex(int index) 74 { 75 _index = index - 1; 76 } 77 78 81 public int getIndex() 82 { 83 return _index; 84 } 85 86 89 public void setBackup(boolean isBackup) 90 { 91 _isBackup = isBackup; 92 } 93 94 97 public boolean isBackup() 98 { 99 return _isBackup; 100 } 101 102 public void setSrunIndex(int index) 104 { 105 setIndex(index); 106 } 107 108 public int getSrunIndex() 109 { 110 return getIndex(); 111 } 112 113 public void setSrunGroup(String group) 114 { 115 setGroup(group); 116 } 117 118 public String getSrunGroup() 119 { 120 return getGroup(); 121 } 122 123 126 public void setGroup(String group) 127 { 128 _group = group; 129 } 130 131 134 public String getGroup() 135 { 136 return _group; 137 } 138 } 139 | Popular Tags |