01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright
03: * notice. All rights reserved.
04: */
05: package com.tc.net.core;
06:
07: import com.tc.config.schema.dynamic.ConfigItem;
08: import com.tc.util.StringUtil;
09:
10: public class ConnectionAddressProvider {
11:
12: private final ConnectionInfo[] addresses;
13:
14: public ConnectionAddressProvider(ConfigItem source) {
15: this ((ConnectionInfo[]) source.getObject());
16: }
17:
18: public ConnectionAddressProvider(ConnectionInfo[] addresses) {
19: this .addresses = (addresses == null) ? ConnectionInfo.EMPTY_ARRAY
20: : addresses;
21: }
22:
23: public synchronized String toString() {
24: return "ConnectionAddressProvider("
25: + StringUtil.toString(addresses) + ")";
26: }
27:
28: public synchronized ConnectionAddressIterator getIterator() {
29: return new ConnectionAddressIterator(addresses);
30: }
31: }
|