public void customize() { this.group.socketBinding( new SocketBinding("http") .port(fraction.httpPort())); this.group.socketBinding( new SocketBinding("https") .port(fraction.httpsPort())); }
private void configureSocketBinding(PathAddress address, SocketBinding binding, List<ModelNode> list) { ModelNode node = new ModelNode(); node.get(OP_ADDR).set(address.append("socket-binding", binding.name()).toModelNode()); node.get(OP).set(ADD); node.get(PORT).set(new ValueExpression(binding.portExpression())); if (binding.iface() != null) { node.get(INTERFACE).set(binding.iface()); } if (binding.multicastAddress() != null) { node.get(MULTICAST_ADDRESS).set(binding.multicastAddress()); } if (binding.multicastPortExpression() != null) { node.get(MULTICAST_PORT).set(new ValueExpression(binding.multicastPortExpression())); } list.add(node); }
@Override public void customize() { this.group.socketBinding( new SocketBinding("modcluster") .port(0) .multicastAddress(this.fraction.multicastAddress()) .multicastPort(this.fraction.multicastPort())); } }
void socketBinding(String groupName, SocketBinding binding) { List<SocketBinding> list = this.socketBindings.get(groupName); if (list == null) { list = new ArrayList<>(); this.socketBindings.put(groupName, list); } for (SocketBinding each : list) { if (each.name().equals(binding.name())) { throw new RuntimeException("Socket binding '" + binding.name() + "' already configured for '" + each.portExpression() + "'"); } } list.add(binding); }
protected void applyConfiguration(ConfigKey root, SocketBinding binding) { ConfigKey key = root.append(binding.name()); applyConfiguration(key.append("port"), (port) -> { binding.port(port.toString()); }); applyConfiguration(key.append("multicast-port"), (port) -> { binding.multicastPort(port.toString()); }); applyConfiguration(key.append("multicast-address"), (addr) -> { binding.multicastAddress(addr.toString()); }); applyConfiguration(key.append("interface"), (iface) -> { binding.iface(iface.toString()); }); }
public void customize() { this.group.socketBinding( new SocketBinding("management-http") .iface(iface.get()) .port(fraction.httpPort())); this.group.socketBinding(new SocketBinding("management-https") .port(fraction.httpsPort())); if (fraction.isHttpDisable()) { fraction.httpInterfaceManagementInterface((HTTPInterfaceManagementInterface<?>) null); } }
protected void fixSocketBindings(SocketBindingGroup group) { ConfigKey key = ROOT.append(group.name()).append("socket-bindings"); List<SimpleKey> names = this.configView.simpleSubkeys(key); names.stream() .map(e -> e.name()) .map(name -> group.socketBindings() .stream() .filter(e -> e.name().equals(name)) .findFirst() .orElseGet(() -> { SocketBinding binding = new SocketBinding(name); group.socketBinding(binding); return binding; })) .forEach(e -> { applyConfiguration(key, e); }); }
/** * Retrieve a socket-binding by name. * * @param name The socket-binding name. * @return The socket-binding if present, otherwise {@code null}. */ public SocketBinding socketBinding(String name) { return this.socketBindings.stream().filter(e -> e.name().equals(name)).findFirst().orElse(null); }
protected void applyConfiguration(ConfigKey root, SocketBinding binding) { ConfigKey key = root.append(binding.name()); applyConfiguration(key.append("port"), (port) -> { binding.port(port.toString()); }); applyConfiguration(key.append("multicast-port"), (port) -> { binding.multicastPort(port.toString()); }); applyConfiguration(key.append("multicast-address"), (addr) -> { binding.multicastAddress(addr.toString()); }); applyConfiguration(key.append("interface"), (iface) -> { binding.iface(iface.toString()); }); }
public void customize() { this.group.socketBinding( new SocketBinding("management-http") .iface(iface.get()) .port(fraction.httpPort())); this.group.socketBinding(new SocketBinding("management-https") .port(fraction.httpsPort())); if (fraction.isHttpDisable()) { fraction.httpInterfaceManagementInterface((HTTPInterfaceManagementInterface<?>) null); } }
protected void fixSocketBindings(SocketBindingGroup group) { ConfigKey key = ROOT.append(group.name()).append("socket-bindings"); List<SimpleKey> names = this.configView.simpleSubkeys(key); names.stream() .map(e -> e.name()) .map(name -> group.socketBindings() .stream() .filter(e -> e.name().equals(name)) .findFirst() .orElseGet(() -> { SocketBinding binding = new SocketBinding(name); group.socketBinding(binding); return binding; })) .forEach(e -> { applyConfiguration(key, e); }); }
/** * Retrieve a socket-binding by name. * * @param name The socket-binding name. * @return The socket-binding if present, otherwise {@code null}. */ public SocketBinding socketBinding(String name) { return this.socketBindings.stream().filter(e -> e.name().equals(name)).findFirst().orElse(null); }
@Override public void customize() { this.group.socketBinding(new SocketBinding("txn-recovery-environment") .port(this.fraction.port())); this.group.socketBinding(new SocketBinding("txn-status-manager") .port(this.fraction.statusPort())); } }
private void configureSocketBinding(PathAddress address, SocketBinding binding, List<ModelNode> list) { ModelNode node = new ModelNode(); node.get(OP_ADDR).set(address.append("socket-binding", binding.name()).toModelNode()); node.get(OP).set(ADD); node.get(PORT).set(new ValueExpression(binding.portExpression())); if (binding.multicastAddress() != null) { node.get(MULTICAST_ADDRESS).set(binding.multicastAddress()); } if (binding.multicastPortExpression() != null) { node.get(MULTICAST_PORT).set(new ValueExpression(binding.multicastPortExpression())); } list.add(node); }
protected void applyConfiguration(ConfigKey root, SocketBinding binding) { ConfigKey key = root.append(binding.name()); applyConfiguration(key.append("port"), (port) -> { binding.port(port.toString()); }); applyConfiguration(key.append("multicast-port"), (port) -> { binding.multicastPort(port.toString()); }); applyConfiguration(key.append("multicast-address"), (addr) -> { binding.multicastAddress(addr.toString()); }); applyConfiguration(key.append("interface"), (iface) -> { binding.iface(iface.toString()); }); }
@Override public void customize() { this.group.socketBinding( new SocketBinding("jgroups-udp") .port(55200) .multicastAddress(this.fraction.defaultMulticastAddress()) .multicastPort(45688)); this.group.socketBinding( new SocketBinding("jgroups-udp-fd") .port(54200)); this.group.socketBinding( new SocketBinding("jgroups-mping") .port(0) .multicastAddress(this.fraction.defaultMulticastAddress()) .multicastPort(45700)); this.group.socketBinding( new SocketBinding("jgroups-tcp") .port(7600)); this.group.socketBinding( new SocketBinding("jgroups-tcp-fd") .port(57600)); } }
protected void fixSocketBindings(SocketBindingGroup group) { ConfigKey key = ROOT.append(group.name()).append("socket-bindings"); List<SimpleKey> names = this.configView.simpleSubkeys(key); names.stream() .map(e -> e.name()) .map(name -> group.socketBindings() .stream() .filter(e -> e.name().equals(name)) .findFirst() .orElseGet(() -> { SocketBinding binding = new SocketBinding(name); group.socketBinding(binding); return binding; })) .forEach(e -> { applyConfiguration(key, e); }); }
@Override public void initialize(Fraction.InitContext initContext) { initContext.socketBinding( new SocketBinding("http") .port(SwarmProperties.propertyVar(SwarmProperties.HTTP_PORT, "8080"))); initContext.socketBinding( new SocketBinding("https") .port(SwarmProperties.propertyVar(SwarmProperties.HTTPS_PORT, "8443"))); }
private void configureSocketBinding(PathAddress address, SocketBinding binding, List<ModelNode> list) { ModelNode node = new ModelNode(); node.get(OP_ADDR).set(address.append("socket-binding", binding.name()).toModelNode()); node.get(OP).set(ADD); node.get(PORT).set(new ValueExpression(binding.portExpression())); if (binding.iface() != null) { node.get(INTERFACE).set(binding.iface()); } if (binding.multicastAddress() != null) { node.get(MULTICAST_ADDRESS).set(binding.multicastAddress()); } if (binding.multicastPortExpression() != null) { node.get(MULTICAST_PORT).set(new ValueExpression(binding.multicastPortExpression())); } list.add(node); }
@Override public void customize() { this.group.socketBinding(new SocketBinding("txn-recovery-environment") .port(this.fraction.port())); this.group.socketBinding(new SocketBinding("txn-status-manager") .port(this.fraction.statusPort())); } }