Examples of SocketBinding


Examples of org.jboss.as.network.SocketBinding

        TransportConfiguration transport = stack.getTransport();

        for (ProtocolConfiguration protocol: protocols) {
            org.jgroups.conf.ProtocolConfiguration config = createProtocol(stack, protocol);
            Introspector introspector = new Introspector(config);
            SocketBinding binding = protocol.getSocketBinding();
            if (binding != null) {
                configureBindAddress(introspector, config, binding);
                configureServerSocket(introspector, config, "bind_port", binding);
                configureServerSocket(introspector, config, "start_port", binding);
                configureMulticastSocket(introspector, config, "mcast_addr", "mcast_port", binding);
View Full Code Here

Examples of org.jboss.as.network.SocketBinding

    @Test
    public void getAddress() throws UnknownHostException {
        InetAddress expected = InetAddress.getLocalHost();
        NetworkInterfaceBinding interfaceBinding = new NetworkInterfaceBinding(Collections.<NetworkInterface>emptySet(), expected);
        SocketBindingManager bindingManager = mock(SocketBindingManager.class);
        SocketBinding binding = new SocketBinding("socket", 1, true, null, 0, interfaceBinding, bindingManager, Collections.<ClientMapping>emptyList());
        InjectedValue<SocketBinding> bindingValue = new InjectedValue<SocketBinding>();

        bindingValue.inject(binding);
        when(this.listener.getBinding()).thenReturn(bindingValue);
View Full Code Here

Examples of org.jboss.as.network.SocketBinding

    @Test
    public void getPort() throws UnknownHostException {
        int expected = 10;
        NetworkInterfaceBinding interfaceBinding = new NetworkInterfaceBinding(Collections.<NetworkInterface>emptySet(), InetAddress.getLocalHost());
        SocketBindingManager bindingManager = mock(SocketBindingManager.class);
        SocketBinding binding = new SocketBinding("socket", expected, true, null, 0, interfaceBinding, bindingManager, Collections.<ClientMapping>emptyList());
        InjectedValue<SocketBinding> bindingValue = new InjectedValue<SocketBinding>();

        bindingValue.inject(binding);
        when(this.listener.getBinding()).thenReturn(bindingValue);
View Full Code Here

Examples of org.jboss.as.network.SocketBinding

    public synchronized void start(StartContext context) throws StartException {

        // Recovery env bean
        final RecoveryEnvironmentBean recoveryEnvironmentBean = recoveryPropertyManager.getRecoveryEnvironmentBean();
        final SocketBinding recoveryBinding = recoveryBindingInjector.getValue();
        recoveryEnvironmentBean.setRecoveryInetAddress(recoveryBinding.getSocketAddress().getAddress());
        recoveryEnvironmentBean.setRecoveryPort(recoveryBinding.getSocketAddress().getPort());
        final SocketBinding statusBinding = statusBindingInjector.getValue();
        recoveryEnvironmentBean.setTransactionStatusManagerInetAddress(statusBinding.getSocketAddress().getAddress());
        recoveryEnvironmentBean.setTransactionStatusManagerPort(statusBinding.getSocketAddress().getPort());
        recoveryEnvironmentBean.setRecoveryListener(recoveryListener);

        if (recoveryListener){
            ManagedBinding binding = ManagedBinding.Factory.createSimpleManagedBinding(recoveryBinding);
            bindingManager.getValue().getNamedRegistry().registerBinding(binding);
View Full Code Here

Examples of org.jboss.as.network.SocketBinding

        } 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);
        }

        callbackHandle = pathManagerInjector.getValue().registerCallback(pathRef, PathManager.ReloadServerCallback.create(), PathManager.Event.UPDATED, PathManager.Event.REMOVED);
        coreEnvironmentBean.setVarDir(pathManagerInjector.getValue().resolveRelativePathEntry(path, pathRef));
View Full Code Here

Examples of org.jboss.as.network.SocketBinding

        }

        // Read node to set configuration.
        if (config.getAdvertise()) {
            // There should be a socket-binding.... Well no it needs an advertise socket :-(
            final SocketBinding binding = this.binding.getOptionalValue();
            if (binding != null) {
                config.setAdvertiseSocketAddress(binding.getMulticastSocketAddress());
                config.setAdvertiseInterface(binding.getSocketAddress().getAddress());
                if (!isMulticast) {
                    ROOT_LOGGER.multicastInterfaceNotAvailable();
                }
            }
        }
View Full Code Here

Examples of org.jboss.as.network.SocketBinding

    List<ClientMapping> getClientMappings() {
        if (this.remotingServer == null) {
            return Collections.emptyList();
        }
        final SocketBinding socketBinding = this.remotingServer.getSocketBinding();
        final List<ClientMapping> clientMappings = socketBinding.getClientMappings();
        if (clientMappings != null && !clientMappings.isEmpty()) {
            return clientMappings;
        }
        // TODO: We use the textual form of IP address as the destination address for now.
        // This needs to be configurable (i.e. send either host name or the IP address). But
        // since this is a corner case (i.e. absence of any client-mappings for a socket binding),
        // this should be OK for now
        final String destinationAddress = socketBinding.getAddress().getHostAddress();
        final InetAddress clientNetworkAddress;
        try {
            clientNetworkAddress = InetAddress.getByName("::");
        } catch (UnknownHostException e) {
            throw new RuntimeException(e);
        }
        final ClientMapping defaultClientMapping = new ClientMapping(clientNetworkAddress, 0, destinationAddress, socketBinding.getAbsolutePort());
        return Collections.singletonList(defaultClientMapping);
    }
View Full Code Here

Examples of org.jboss.as.server.services.net.SocketBinding

        try {
            // Global configuration.

            // Recovery env bean
            final RecoveryEnvironmentBean recoveryEnvironmentBean = recoveryPropertyManager.getRecoveryEnvironmentBean();
            final SocketBinding recoveryBinding = recoveryBindingInjector.getValue();
            recoveryEnvironmentBean.setRecoveryInetAddress(recoveryBinding.getSocketAddress().getAddress());
            recoveryEnvironmentBean.setRecoveryPort(recoveryBinding.getSocketAddress().getPort());
            final SocketBinding statusBinding = statusBindingInjector.getValue();
            recoveryEnvironmentBean.setTransactionStatusManagerInetAddress(statusBinding.getSocketAddress().getAddress());
            recoveryEnvironmentBean.setTransactionStatusManagerPort(statusBinding.getSocketAddress().getPort());

            final List<String> recoveryExtensions = new ArrayList<String>();
            final List<String> expiryScanners = new ArrayList<String>();

            recoveryExtensions.add(AtomicActionRecoveryModule.class.getName());
View Full Code Here

Examples of org.jboss.as.server.services.net.SocketBinding

                for (TransportConfiguration tc : connectors) {
                    // If there is a socket binding set the HOST/PORT values
                    Object socketRef = tc.getParams().remove(SOCKET_REF);
                    if (socketRef != null) {
                        String name = socketRef.toString();
                        SocketBinding binding = socketBindings.get(name);
                        if (binding == null) {
                            throw new StartException("Failed to find SocketBinding for connector: " + tc.getName());
                        }
                        tc.getParams().put(HOST, binding.getSocketAddress().getHostName());
                        tc.getParams().put(PORT, "" + binding.getSocketAddress().getPort());
                    }
                }
            }
            if (acceptors != null) {
                for (TransportConfiguration tc : acceptors) {
                    // If there is a socket binding set the HOST/PORT values
                    Object socketRef = tc.getParams().remove(SOCKET_REF);
                    if (socketRef != null) {
                        String name = socketRef.toString();
                        SocketBinding binding = socketBindings.get(name);
                        if (binding == null) {
                            throw new StartException("Failed to find SocketBinding for connector: " + tc.getName());
                        }
                        tc.getParams().put(HOST, binding.getSocketAddress().getHostName());
                        tc.getParams().put(PORT, "" + binding.getSocketAddress().getPort());
                    }
                }
            }

            // Now start the server
View Full Code Here

Examples of org.jboss.as.server.services.net.SocketBinding

        return channel;
    }

    private void init(TP transport) {
        TransportConfiguration transportConfig = this.configuration.getTransport();
        SocketBinding binding = transportConfig.getSocketBinding();
        if (binding != null) {
            SocketFactory factory = transport.getSocketFactory();
            if (!(factory instanceof ManagedSocketFactory)) {
                transport.setSocketFactory(new ManagedSocketFactory(factory, binding.getSocketBindings()));
            }
        }
        ThreadFactory threadFactory = transportConfig.getThreadFactory();
        if (threadFactory != null) {
            if (!(transport.getThreadFactory() instanceof ThreadFactoryAdapter)) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.