Remove a host from the mapper. @param name Virtual host name
(String name)
| 160 | * @param name Virtual host name |
| 161 | */ |
| 162 | public synchronized void removeHost(String name) { |
| 163 | name = renameWildcardHost(name); |
| 164 | // Find and remove the old host |
| 165 | MappedHost host = exactFind(hosts, name); |
| 166 | if (host == null || host.isAlias()) { |
| 167 | return; |
| 168 | } |
| 169 | MappedHost[] newHosts = hosts.clone(); |
| 170 | // Remove real host and all its aliases |
| 171 | int j = 0; |
| 172 | for (int i = 0; i < newHosts.length; i++) { |
| 173 | if (newHosts[i].getRealHost() != host) { |
| 174 | newHosts[j++] = newHosts[i]; |
| 175 | } |
| 176 | } |
| 177 | hosts = Arrays.copyOf(newHosts, j); |
| 178 | } |
| 179 | |
| 180 | /** |
| 181 | * Add an alias to an existing host. |