@Override public void start(StartContext context) throws StartException { // Global configuration. final CoreEnvironmentBean coreEnvironmentBean = arjPropertyManager.getCoreEnvironmentBean(); if(coreEnvironmentBean.getProcessImplementationClassName() == null) { UuidProcessId id = new UuidProcessId(); coreEnvironmentBean.setProcessImplementation(id); } try { coreEnvironmentBean.setNodeIdentifier(nodeIdentifier); } catch (CoreEnvironmentBeanException e) { throw new StartException(e.getCause()); } // Setup the socket process id if there is a binding SocketBinding binding = socketProcessBindingInjector.getOptionalValue(); if(binding != null) { int port = binding.getPort(); coreEnvironmentBean.setSocketProcessIdPort(port); } }
@Override public void start(StartContext context) throws StartException { for (String key : _socketBindings.keySet()) { SocketBinding binding = _socketBindings.get(key).getValue(); SocketAddr addr = new SocketAddr(binding.getAddress().getHostAddress(), binding.getPort()); LOG.trace("Injecting socket binding '" + addr + "'"); _injectedValues.put(key, addr.toString()); } }
@Override public void start(StartContext context) throws StartException { for (String key : _socketBindings.keySet()) { SocketBinding binding = _socketBindings.get(key).getValue(); SocketAddr addr = new SocketAddr(binding.getAddress().getHostAddress(), binding.getPort()); LOG.trace("Injecting socket binding '" + addr + "'"); _injectedValues.put(key, addr.toString()); } }
private void validateEndpointPort(URI httpURI) { // Camel HTTP endpoint port defaults are 0 or -1 boolean portMatched = httpURI.getPort() == 0 || httpURI.getPort() == -1; // If a port was specified, verify that undertow has a listener configured for it if (!portMatched) { for (UndertowListener listener : defaultHost.getServer().getListeners()) { SocketBinding binding = listener.getSocketBinding(); if (binding != null) { if (binding.getPort() == httpURI.getPort()) { portMatched = true; break; } } } } if (!"localhost".equals(httpURI.getHost())) { LOGGER.debug("Cannot bind to host other than 'localhost': {}", httpURI); } if (!portMatched) { LOGGER.debug("Cannot bind to specific port: {}", httpURI); } }
private URL getConnectionURL() throws StartException { SocketBinding socketBinding = injectedHttpSocketBinding.getValue(); InetAddress address = socketBinding.getNetworkInterfaceBinding().getAddress(); URL result; try { String hostAddress = NetworkUtils.formatPossibleIpv6Address(address.getHostAddress()); result = new URL(socketBinding.getName() + "://" + hostAddress + ":" + socketBinding.getPort()); } catch (MalformedURLException ex) { throw new StartException(ex); } return result; }
&& listener instanceof HttpListenerService) { if (listener.getBinding().getValue() != null) { port = listener.getBinding().getValue().getPort(); if (listener.getBinding().getValue().getAddress() != null) { hostname = listener.getBinding().getValue().getAddress().getHostName();
&& listener instanceof HttpListenerService) { if (listener.getBinding().getValue() != null) { port = listener.getBinding().getValue().getPort(); if (listener.getBinding().getValue().getAddress() != null) { hostname = listener.getBinding().getValue().getAddress().getHostName();
static BroadcastGroupConfiguration createBroadcastGroupConfiguration(final String name, final BroadcastGroupConfiguration config, final SocketBinding socketBinding) throws Exception { final String localAddress = socketBinding.getAddress().getHostAddress(); final String groupAddress = socketBinding.getMulticastAddress().getHostAddress(); final int localPort = socketBinding.getPort(); final int groupPort = socketBinding.getMulticastPort(); final long broadcastPeriod = config.getBroadcastPeriod(); final List<String> connectorRefs = config.getConnectorInfos(); final BroadcastEndpointFactory endpointFactory = new UDPBroadcastEndpointFactory() .setGroupAddress(groupAddress) .setGroupPort(groupPort) .setLocalBindAddress(localAddress) .setLocalBindPort(localPort); return new BroadcastGroupConfiguration() .setName(name) .setBroadcastPeriod(broadcastPeriod) .setConnectorInfos(connectorRefs) .setEndpointFactory(endpointFactory); }
static BroadcastGroupConfiguration createBroadcastGroupConfiguration(final String name, final BroadcastGroupConfiguration config, final SocketBinding socketBinding) throws Exception { final String localAddress = socketBinding.getAddress().getHostAddress(); final String groupAddress = socketBinding.getMulticastAddress().getHostAddress(); final int localPort = socketBinding.getPort(); final int groupPort = socketBinding.getMulticastPort(); final long broadcastPeriod = config.getBroadcastPeriod(); final List<String> connectorRefs = config.getConnectorInfos(); final BroadcastEndpointFactory endpointFactory = new UDPBroadcastEndpointFactory() .setGroupAddress(groupAddress) .setGroupPort(groupPort) .setLocalBindAddress(localAddress) .setLocalBindPort(localPort); return new BroadcastGroupConfiguration() .setName(name) .setBroadcastPeriod(broadcastPeriod) .setConnectorInfos(connectorRefs) .setEndpointFactory(endpointFactory); }
@Override public void start(StartContext context) throws StartException { // Global configuration. final CoreEnvironmentBean coreEnvironmentBean = arjPropertyManager.getCoreEnvironmentBean(); if(coreEnvironmentBean.getProcessImplementationClassName() == null) { UuidProcessId id = new UuidProcessId(); coreEnvironmentBean.setProcessImplementation(id); } try { coreEnvironmentBean.setNodeIdentifier(nodeIdentifier); } catch (CoreEnvironmentBeanException e) { throw new StartException(e.getCause()); } // Setup the socket process id if there is a binding SocketBinding binding = socketProcessBindingInjector.getOptionalValue(); if(binding != null) { int port = binding.getPort(); coreEnvironmentBean.setSocketProcessIdPort(port); } }
@Override public void start(StartContext context) throws StartException { // Global configuration. final CoreEnvironmentBean coreEnvironmentBean = arjPropertyManager.getCoreEnvironmentBean(); if(coreEnvironmentBean.getProcessImplementationClassName() == null) { UuidProcessId id = new UuidProcessId(); coreEnvironmentBean.setProcessImplementation(id); } try { coreEnvironmentBean.setNodeIdentifier(nodeIdentifier); } catch (CoreEnvironmentBeanException e) { throw new StartException(e.getCause()); } // Setup the socket process id if there is a binding SocketBinding binding = socketProcessBindingInjector.getOptionalValue(); if(binding != null) { int port = binding.getPort(); coreEnvironmentBean.setSocketProcessIdPort(port); } }