Package org.jboss.as.protocol

Examples of org.jboss.as.protocol.ProtocolChannelClient


                endpoint = Remoting.createEndpoint("management-client", OptionMap.EMPTY);
                endpoint.addConnectionProvider("remote", new RemoteConnectionProviderFactory(), OptionMap.EMPTY);

                configuration.setEndpoint(endpoint);

                final ProtocolChannelClient setup = ProtocolChannelClient.create(configuration);
                strategy = ManagementClientChannelStrategy.create(setup, channelAssociation, clientConfiguration.getCallbackHandler(),
                        clientConfiguration.getSaslOptions(), clientConfiguration.getSSLContext(),
                        new CloseHandler<Channel>() {
                    @Override
                    public void handleClose(final Channel closed, final IOException exception) {
View Full Code Here


     * @throws IOException
     */
    private synchronized RegistrationResult connectSync() throws IOException {
        boolean ok = false;
        try {
            final ProtocolChannelClient client = ProtocolChannelClient.create(configuration);
            CallbackHandler callbackHandler = null;
            SSLContext sslContext = null;
            if (realm != null) {
                sslContext = realm.getSSLContext();
                CallbackHandlerFactory handlerFactory = realm.getSecretCallbackHandlerFactory();
                if (handlerFactory != null) {
                    callbackHandler = handlerFactory.getCallbackHandler(localHostName);
                }
            }
            // Connect
            connection = client.connectSync(callbackHandler, Collections.<String, String> emptyMap(), sslContext);
            connection.addCloseHandler(new CloseHandler<Connection>() {
                @Override
                public void handleClose(final Connection closed, final IOException exception) {
                    synchronized (this) {
                        if(connection == closed) {
View Full Code Here

                endpoint = Remoting.createEndpoint("management-client", OptionMap.EMPTY);
                endpoint.addConnectionProvider("remote", new RemoteConnectionProviderFactory(), OptionMap.EMPTY);

                configuration.setEndpoint(endpoint);

                final ProtocolChannelClient setup = ProtocolChannelClient.create(configuration);
                strategy = ManagementClientChannelStrategy.create(setup, channelAssociation, clientConfiguration.getCallbackHandler(),
                        clientConfiguration.getSaslOptions(), clientConfiguration.getSSLContext(),
                        new CloseHandler<Channel>() {
                    @Override
                    public void handleClose(final Channel closed, final IOException exception) {
View Full Code Here

        ProtocolChannelClient.Configuration configuration = new ProtocolChannelClient.Configuration();
        configuration.setEndpoint(channelServer.getEndpoint());
        configuration.setUri(new URI("" + URI_SCHEME + "://127.0.0.1:" + PORT + ""));
        configuration.setOptionMap(OptionMap.create(Options.SASL_POLICY_NOANONYMOUS, Boolean.FALSE));

        ProtocolChannelClient client = ProtocolChannelClient.create(configuration);
        connection = client.connectSync(new PasswordClientCallbackHandler("TestUser", "localhost.localdomain", "TestUserPassword".toCharArray()));
        clientChannel = connection.openChannel(TEST_CHANNEL, OptionMap.EMPTY).get();
        try {
            clientConnectedLatch.await();
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
View Full Code Here

    public void startClientConnetion() throws IOException, URISyntaxException {
        ProtocolChannelClient.Configuration configuration = new ProtocolChannelClient.Configuration();
        configuration.setEndpoint(channelServer.getEndpoint());
        configuration.setUri(new URI("" + URI_SCHEME + "://127.0.0.1:" + PORT + ""));

        ProtocolChannelClient client = ProtocolChannelClient.create(configuration);
        connection = client.connectSync(new PasswordClientCallbackHandler("bob", ENDPOINT_NAME ,"pass".toCharArray()));

        clientChannel = connection.openChannel(TEST_CHANNEL, OptionMap.EMPTY).get();
        try {
            clientConnectedLatch.await();
        } catch (InterruptedException e) {
View Full Code Here

     * @throws IOException
     */
    private synchronized RegistrationResult connectSync() throws IOException {
        boolean ok = false;
        try {
            final ProtocolChannelClient client = ProtocolChannelClient.create(configuration);
            CallbackHandler callbackHandler = null;
            SSLContext sslContext = null;
            if (realm != null) {
                sslContext = realm.getSSLContext();
                CallbackHandlerFactory handlerFactory = realm.getSecretCallbackHandlerFactory();
                if (handlerFactory != null) {
                    callbackHandler = handlerFactory.getCallbackHandler(localHostName);
                }
            }
            // Connect
            connection = client.connectSync(callbackHandler, Collections.<String, String> emptyMap(), sslContext);
            connection.addCloseHandler(new CloseHandler<Connection>() {
                @Override
                public void handleClose(final Connection closed, final IOException exception) {
                    synchronized (this) {
                        if(connection == closed) {
View Full Code Here

     */
    DomainTestConnection createConnection(final URI connectionURI, final CallbackHandler callbackHandler) throws IOException {
        final ProtocolChannelClient.Configuration configuration = new ProtocolChannelClient.Configuration();
        configuration.setEndpoint(endpoint);
        configuration.setUri(connectionURI);
        final ProtocolChannelClient client = ProtocolChannelClient.create(configuration);
        return new DomainTestConnection(client, callbackHandler, executorService);
    }
View Full Code Here

                endpoint.addConnectionProvider("remote", new RemoteConnectionProviderFactory(), OptionMap.EMPTY);

                configuration.setEndpoint(endpoint);
                configuration.setEndpointName("management-client");

                final ProtocolChannelClient setup = ProtocolChannelClient.create(configuration);
                strategy = ManagementClientChannelStrategy.create(setup, this, clientConfiguration.getCallbackHandler(), clientConfiguration.getSaslOptions(), clientConfiguration.getSSLContext());
            } catch (IOException e) {
                throw e;
            } catch (RuntimeException e) {
                throw e;
View Full Code Here

     */
    private synchronized RegistrationResult connectSync() throws IOException {
        boolean ok = false;
        try {
            if(connection == null) {
                final ProtocolChannelClient client = ProtocolChannelClient.create(configuration);
                CallbackHandler callbackHandler = null;
                SSLContext sslContext = null;
                if (realm != null) {
                    sslContext = realm.getSSLContext();
                    CallbackHandlerFactory handlerFactory = realm.getSecretCallbackHandlerFactory();
                    if (handlerFactory != null) {
                        String username = this.username != null ? this.username : localHostName;
                        callbackHandler = handlerFactory.getCallbackHandler(username);
                    }
                }
                // Connect
                connection = client.connectSync(callbackHandler, Collections.<String, String> emptyMap(), sslContext);
                connection.addCloseHandler(new CloseHandler<Connection>() {
                    @Override
                    public void handleClose(final Connection closed, final IOException exception) {
                        synchronized (this) {
                            if(connection == closed) {
View Full Code Here

                .install();
    }

    /** {@inheritDoc} */
    public synchronized void start(StartContext context) throws StartException {
        ProtocolChannelClient client;
        try {
            ProtocolChannelClient.Configuration configuration = new ProtocolChannelClient.Configuration();
            configuration.setEndpoint(endpointInjector.getValue());
            configuration.setUri(new URI("remote://" + hcAddressInjector.getValue().getHostName() + ":" + hcAddressInjector.getValue().getPort()));
            client = ProtocolChannelClient.create(configuration);
        } catch (Exception e) {
            throw new StartException(e);
        }

        try {
            connection = client.connectSync(new ClientCallbackHandler());
            channel = connection.openChannel(ManagementRemotingServices.SERVER_CHANNEL, OptionMap.EMPTY).get();
        } catch (IOException e) {
            throw ServerMessages.MESSAGES.failedToConnectToHC(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.jboss.as.protocol.ProtocolChannelClient

Copyright © 2018 www.massapicom. 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.