use of org.apache.openejb.util.OptionsLog in project tomee by apache.
the class MulticastDiscoveryAgent method init.
@Override
public void init(final Properties props) {
final Options options = new Options(props);
options.setLogger(new OptionsLog(LOGGER));
host = props.getProperty("bind", host);
loopbackMode = options.get("loopback_mode", loopbackMode);
port = options.get("port", port);
heartRate = options.get("heart_rate", heartRate);
final Tracker.Builder builder = new Tracker.Builder();
builder.setGroup(props.getProperty("group", builder.getGroup()));
builder.setHeartRate(heartRate);
builder.setMaxMissedHeartbeats(options.get("max_missed_heartbeats", builder.getMaxMissedHeartbeats()));
builder.setMaxReconnectDelay(options.get("max_reconnect_delay", builder.getMaxReconnectDelay()));
builder.setReconnectDelay(options.get("reconnect_delay", builder.getReconnectDelay()));
builder.setExponentialBackoff(options.get("exponential_backoff", builder.getExponentialBackoff()));
builder.setMaxReconnectAttempts(options.get("max_reconnect_attempts", builder.getMaxReconnectAttempts()));
tracker = builder.build();
}
use of org.apache.openejb.util.OptionsLog in project tomee by apache.
the class MultipointDiscoveryAgent method init.
@Override
public void init(final Properties props) {
final Options options = new Options(props);
options.setLogger(new OptionsLog(LOGGER));
host = props.getProperty("bind", host);
port = options.get("port", port);
initialServers = options.get("initialServers", initialServers);
heartRate = options.get("heart_rate", heartRate);
discoveryHost = options.get("discoveryHost", host);
name = name != null ? name : options.get("discoveryName", MultipointServer.randomColor());
reconnectDelay = options.get("reconnectDelay", new Duration("30 seconds"));
final Set<URI> uris = new LinkedHashSet<>();
// Connect the initial set of peer servers
final StringTokenizer st = new StringTokenizer(initialServers, ",");
while (st.hasMoreTokens()) {
final String string = st.nextToken().trim();
if (string.startsWith("conn://")) {
final URI uri = URI.create(string);
uris.add(uri);
} else {
final URI uri = URI.create("conn://" + string);
uris.add(uri);
}
}
roots = uris;
final Tracker.Builder builder = new Tracker.Builder();
builder.setHeartRate(heartRate);
builder.setGroup(props.getProperty("group", builder.getGroup()));
builder.setMaxMissedHeartbeats(options.get("max_missed_heartbeats", builder.getMaxMissedHeartbeats()));
builder.setMaxReconnectDelay(options.get("max_reconnect_delay", builder.getMaxReconnectDelay()));
builder.setReconnectDelay(options.get("reconnect_delay", builder.getReconnectDelay()));
builder.setExponentialBackoff(options.get("exponential_backoff", builder.getExponentialBackoff()));
builder.setMaxReconnectAttempts(options.get("max_reconnect_attempts", builder.getMaxReconnectAttempts()));
builder.setDebug(debug);
tracker = builder.build();
}
use of org.apache.openejb.util.OptionsLog in project tomee by apache.
the class MulticastPulseAgent method init.
@Override
public void init(final Properties p) throws Exception {
final Options o = new Options(p);
o.setLogger(new OptionsLog(LOG));
this.ignore.add("localhost");
this.ignore.add("::1");
this.ignore.add("127.0.0.1");
try {
final String[] ignoreList = o.get("ignore", "").split(",");
for (final String s : ignoreList) {
if (null != s && s.trim().length() > 0) {
this.ignore.add(s.trim().toLowerCase());
}
}
} catch (final Exception e) {
LOG.warning("Invalid ignore parameter. Should be a lowercase single host or comma seperated list of hosts to ignore like: ignore=host1,host2,ipv4,ipv6");
}
this.multicast = o.get("bind", this.multicast);
this.port = o.get("port", this.port);
this.group = o.get("group", this.group);
final InetAddress ia = InetAddress.getByName(this.multicast);
this.address = new InetSocketAddress(ia, this.port);
this.buildPacket();
}
use of org.apache.openejb.util.OptionsLog in project tomee by apache.
the class OpenEJBHttpServer method init.
@Override
public void init(final Properties props) throws Exception {
final Options options = new Options(props);
options.setLogger(new OptionsLog(log));
print = options.getAll("print", OpenEJBHttpServer.Output.class);
indent = print.size() > 0 && options.get("" + "" + ".xml", false);
countStreams = options.get("stream.count", false);
}
Aggregations