Examples of OptionMap


Examples of org.xnio.OptionMap

        final ServiceTarget target = context.getServiceTarget();

        final ServiceName socketBindingName = SocketBinding.JBOSS_BINDING_NAME.append(ConnectorResource.SOCKET_BINDING.resolveModelAttribute(context, model).asString());


        final OptionMap optionMap;
        Resource resource = findResource(context.getRootResource(), pathAddress);
        Set<ResourceEntry> entries = resource.getChildren(CommonAttributes.PROPERTY);
        if (entries.size() > 0) {
            OptionMap.Builder builder = OptionMap.builder();
            final ClassLoader loader = SecurityActions.getClassLoader(this.getClass());
View Full Code Here

Examples of org.xnio.OptionMap

                    .set(Options.TCP_NODELAY, true)
                    .set(Options.CORK, true)
                    .addAll(workerOptions)
                    .getMap());

            OptionMap socketOptions = OptionMap.builder()
                    .set(Options.WORKER_IO_THREADS, ioThreads)
                    .set(Options.TCP_NODELAY, true)
                    .set(Options.REUSE_ADDRESSES, true)
                    .set(Options.BALANCING_TOKENS, 1)
                    .set(Options.BALANCING_CONNECTIONS, 2)
View Full Code Here

Examples of org.xnio.OptionMap

        //There is currently a probable bug in jboss remoting, so the user realm name MUST be the same as
        //the endpoint name.

        provider.addUser("TestUser","localhost.localdomain", "TestUserPassword".toCharArray());
        System.out.println(configuration.getBindAddress());
        OptionMap options = OptionMap.create(Options.SASL_MECHANISMS, Sequence.of("ANONYMOUS"), Options.SASL_POLICY_NOANONYMOUS, Boolean.FALSE);
        AcceptingChannel<? extends ConnectedStreamChannel> streamServer = networkServerProvider.createServer(configuration.getBindAddress(), options, provider, null);

        return new ChannelServer(endpoint, registration, streamServer);
    }
View Full Code Here

Examples of org.xnio.OptionMap

        // setup the channel creation options
        final Properties channelProps = clusterConfig.getChannelCreationOptions();
        if (channelProps != null) {
            // we don't use the deployment CL here since the XNIO project isn't necessarily added as a dep on the deployment's
            // module CL
            final OptionMap channelCreationOptions = getOptionMapFromProperties(channelProps, this.getClass().getClassLoader());
            logger.debug("Channel creation options for cluster " + clusterConfig.getClusterName() + " are " + channelCreationOptions);
            this.setChannelCreationOptions(channelCreationOptions);
        }

        // setup connection creation options
        final Properties connectionProps = clusterConfig.getConnectionOptions();
        if (connectionProps != null) {
            // we don't use the deployment CL here since the XNIO project isn't necessarily added as a dep on the deployment's
            // module CL
            final OptionMap connectionCreationOptions = getOptionMapFromProperties(connectionProps, this.getClass().getClassLoader());
            logger.debug("Connection creation options for cluster " + clusterConfig.getClusterName() + " are " + connectionCreationOptions);
            this.setConnectionCreationOptions(connectionCreationOptions);
        }

        this.setCallbackHandler(serviceRegistry, clusterConfig.getUserName(), clusterConfig.getSecurityRealm());
View Full Code Here

Examples of org.xnio.OptionMap

        final Properties channelProps = clusterNodeConfig.getChannelCreationOptions();
        if (channelProps != null) {
            // we don't use the deployment CL here since the XNIO project isn't necessarily added as a dep on the deployment's
            // module CL
            final OptionMap channelOpts = getOptionMapFromProperties(channelProps, this.getClass().getClassLoader());
            logger.debug("Channel creation options for node " + clusterNodeConfig.getNodeName() + " are " + channelOpts);
            this.setChannelCreationOptions(channelOpts);
        }

        final Properties connectionProps = clusterNodeConfig.getConnectionOptions();
        if (connectionProps != null) {
            // we don't use the deployment CL here since the XNIO project isn't necessarily added as a dep on the deployment's
            // module CL
            final OptionMap connectOpts = getOptionMapFromProperties(connectionProps, this.getClass().getClassLoader());
            logger.debug("Connection creation options for node " + clusterNodeConfig.getNodeName() + " are " + connectOpts);
            this.setConnectionCreationOptions(connectOpts);
        }

        this.setCallbackHandler(serviceRegistry, clusterNodeConfig.getUserName(), clusterNodeConfig.getSecurityRealm());
View Full Code Here

Examples of org.xnio.OptionMap

            final ServiceName connectionDependencyService = AbstractOutboundConnectionService.OUTBOUND_CONNECTION_BASE_SERVICE_NAME.append(connectionRef);
            service.addRemotingConnectionDependency(serviceBuilder, connectionDependencyService);

            // setup the channel creation options for each outbound connection reference
            final Properties channelCreationProps = remotingReceiverConfiguration.getChannelCreationOptions();
            final OptionMap channelCreationOpts;
            if (channelCreationProps == null) {
                channelCreationOpts = OptionMap.EMPTY;
            } else {
                // we don't use the deployment CL here since the XNIO project isn't necessarily added as a dep on the deployment's
                // module CL
View Full Code Here

Examples of org.xnio.OptionMap

    @Override
    public EJBReceiver getEJBReceiver() {
        Connection connection;
        final ReconnectHandler reconnectHandler;
        OptionMap channelCreationOptions = OptionMap.EMPTY;
        final EJBClientConfiguration ejbClientConfiguration = this.clusterContext.getEJBClientContext().getEJBClientConfiguration();
        try {
            // if the client configuration is available create the connection using those configs
            if (ejbClientConfiguration != null) {
                final EJBClientConfiguration.ClusterConfiguration clusterConfiguration = ejbClientConfiguration.getClusterConfiguration(clusterContext.getClusterName());
                if (clusterConfiguration == null) {
                    // use default configurations
                    final OptionMap connectionCreationOptions = OptionMap.EMPTY;
                    final CallbackHandler callbackHandler = ejbClientConfiguration.getCallbackHandler();
                    final IoFuture<Connection> futureConnection = NetworkUtil.connect(endpoint, destinationHost, destinationPort, null, connectionCreationOptions, callbackHandler, null);
                    // wait for the connection to be established
                    connection = IoFutureHelper.get(futureConnection, 5000, TimeUnit.MILLISECONDS);
                    // create a re-connect handler (which will be used on connection breaking down)
                    reconnectHandler = new ClusterNodeReconnectHandler(destinationHost, destinationPort, connectionCreationOptions, callbackHandler, channelCreationOptions, 5000);

                } else {
                    final EJBClientConfiguration.ClusterNodeConfiguration clusterNodeConfiguration = clusterConfiguration.getNodeConfiguration(this.getNodeName());
                    // use the specified configurations
                    channelCreationOptions = clusterNodeConfiguration == null ? clusterConfiguration.getChannelCreationOptions() : clusterNodeConfiguration.getChannelCreationOptions();
                    final OptionMap connectionCreationOptions = clusterNodeConfiguration == null ? clusterConfiguration.getConnectionCreationOptions() : clusterNodeConfiguration.getConnectionCreationOptions();
                    final CallbackHandler callbackHandler = clusterNodeConfiguration == null ? clusterConfiguration.getCallbackHandler() : clusterNodeConfiguration.getCallbackHandler();
                    final IoFuture<Connection> futureConnection = NetworkUtil.connect(endpoint, destinationHost, destinationPort, null, connectionCreationOptions, callbackHandler, null);
                    final long timeout = clusterNodeConfiguration == null ? clusterConfiguration.getConnectionTimeout() : clusterNodeConfiguration.getConnectionTimeout();
                    // wait for the connection to be established
                    connection = IoFutureHelper.get(futureConnection, timeout, TimeUnit.MILLISECONDS);
                    // create a re-connect handler (which will be used on connection breaking down)
                    reconnectHandler = new ClusterNodeReconnectHandler(destinationHost, destinationPort, connectionCreationOptions, callbackHandler, channelCreationOptions, timeout);
                }

            } else {
                // create the connection using defaults
                final OptionMap connectionCreationOptions = OptionMap.EMPTY;
                final CallbackHandler callbackHandler = new AnonymousCallbackHandler();
                final IoFuture<Connection> futureConnection = NetworkUtil.connect(endpoint, destinationHost, destinationPort, null, connectionCreationOptions, callbackHandler, null);
                // wait for the connection to be established
                connection = IoFutureHelper.get(futureConnection, 5000, TimeUnit.MILLISECONDS);
                // create a re-connect handler (which will be used on connection breaking down)
View Full Code Here

Examples of org.xnio.OptionMap

        }
        final ServiceController clientMappingEntryProviderServiceController = clientMappingEntryProviderServiceBuilder.install();
        // add it to the services to be returned
        services.add(clientMappingEntryProviderServiceController);

        final OptionMap channelCreationOptions = this.getChannelCreationOptions(context);
        // Install the EJB remoting connector service which will listen for client connections on the remoting channel
        // TODO: Externalize (expose via management API if needed) the version and the marshalling strategy
        final EJBRemoteConnectorService ejbRemoteConnectorService = new EJBRemoteConnectorService((byte) 0x01, new String[]{"river"}, remotingServerServiceName, channelCreationOptions);
        final ServiceBuilder<EJBRemoteConnectorService> ejbRemoteConnectorServiceBuilder = serviceTarget.addService(EJBRemoteConnectorService.SERVICE_NAME, ejbRemoteConnectorService);
        // add dependency on the Remoting subsystem endpoint
View Full Code Here

Examples of org.xnio.OptionMap

            final InjectedValue<AbstractOutboundConnectionService> injectedValue = entry.getValue();
            final AbstractOutboundConnectionService outboundConnectionService = injectedValue.getValue();
            final String connectionName = outboundConnectionService.getConnectionName();
            logger.debug("Creating remoting EJB receiver for connection " + connectionName);
            final long connectionTimeout = this.connectionTimeouts.get(connectionName) <= 0 ? DEFAULT_CONNECTION_TIMEOUT : this.connectionTimeouts.get(connectionName);
            final OptionMap options = this.channelCreationOpts.get(connectionName) == null ? OptionMap.EMPTY : this.channelCreationOpts.get(connectionName);

            Connection connection = null;
            final ReconnectHandler reconnectHandler = new OutboundConnectionReconnectHandler(serviceRegistry, entry.getKey(), context, connectionTimeout, options);
            try {
                final IoFuture<Connection> futureConnection = outboundConnectionService.connect();
View Full Code Here

Examples of org.xnio.OptionMap

        final String connectionName = address.getLastElement().getValue();

        final String outboundSocketBindingRef = RemoteOutboundConnectionResourceDefinition.OUTBOUND_SOCKET_BINDING_REF.resolveModelAttribute(context, operation).asString();
        final ServiceName outboundSocketBindingDependency = OutboundSocketBinding.OUTBOUND_SOCKET_BINDING_BASE_SERVICE_NAME.append(outboundSocketBindingRef);
        // fetch the connection creation options from the model
        final OptionMap connectionCreationOptions = ConnectorResource.getOptions(fullModel.get(CommonAttributes.PROPERTY));
        final String username = fullModel.hasDefined(CommonAttributes.USERNAME) ? fullModel.require(CommonAttributes.USERNAME).asString() : null;
        final String securityRealm = fullModel.hasDefined(CommonAttributes.SECURITY_REALM) ? fullModel.require(CommonAttributes.SECURITY_REALM).asString() : null;

        // create the service
        final RemoteOutboundConnectionService outboundConnectionService = new RemoteOutboundConnectionService(connectionName, connectionCreationOptions, username);
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.