Search in sources :

Example 81 with Endpoint

use of com.google.cloud.servicedirectory.v1.Endpoint in project wildfly-core by wildfly.

the class EndpointService method start.

/**
 * {@inheritDoc}
 */
public void start(final StartContext context) throws StartException {
    final Endpoint endpoint;
    final EndpointBuilder builder = Endpoint.builder();
    builder.setEndpointName(endpointName);
    builder.setXnioWorker(workerSupplier.get());
    try {
        endpoint = builder.build();
    } catch (IOException e) {
        throw RemotingLogger.ROOT_LOGGER.couldNotStart(e);
    }
    // Reuse the options for the remote connection factory for now
    this.endpoint = endpoint;
    endpointConsumer.accept(endpoint);
}
Also used : Endpoint(org.jboss.remoting3.Endpoint) EndpointBuilder(org.jboss.remoting3.EndpointBuilder) IOException(java.io.IOException)

Example 82 with Endpoint

use of com.google.cloud.servicedirectory.v1.Endpoint in project wildfly-core by wildfly.

the class EndpointService method stop.

/**
 * {@inheritDoc}
 */
public void stop(final StopContext context) {
    context.asynchronous();
    endpointConsumer.accept(null);
    final Endpoint endpoint = this.endpoint;
    this.endpoint = null;
    try {
        endpoint.closeAsync();
    } finally {
        endpoint.addCloseHandler((closed, exception) -> {
            context.complete();
        });
    }
}
Also used : Endpoint(org.jboss.remoting3.Endpoint)

Example 83 with Endpoint

use of com.google.cloud.servicedirectory.v1.Endpoint in project wildfly-core by wildfly.

the class HostControllerConnectionService method start.

@Override
@SuppressWarnings("deprecation")
public synchronized void start(final StartContext context) throws StartException {
    final Endpoint endpoint = endpointSupplier.get();
    try {
        // we leave local auth enabled as an option for domain servers to use if available. elytron only configuration
        // will require this to be enabled and available on the server side for servers to connect successfully.
        // final OptionMap options = OptionMap.create(Options.SASL_DISALLOWED_MECHANISMS, Sequence.of(JBOSS_LOCAL_USER));
        // Create the connection configuration
        final ProtocolConnectionConfiguration configuration = ProtocolConnectionConfiguration.create(endpoint, connectionURI, OptionMap.EMPTY);
        final String userName = this.userName != null ? this.userName : serverName;
        configuration.setCallbackHandler(HostControllerConnection.createClientCallbackHandler(userName, initialAuthKey));
        configuration.setConnectionTimeout(SERVER_CONNECTION_TIMEOUT);
        configuration.setSslContext(sslContextSupplier.get());
        this.responseAttachmentSupport = new ResponseAttachmentInputStreamSupport(scheduledExecutorSupplier.get());
        // Create the connection
        final HostControllerConnection connection = new HostControllerConnection(serverProcessName, userName, connectOperationID, configuration, responseAttachmentSupport, executorSupplier.get());
        // Trigger the started notification based on the process state listener
        final ProcessStateNotifier processService = processStateNotifierSupplier.get();
        processService.addPropertyChangeListener(new PropertyChangeListener() {

            @Override
            public void propertyChange(final PropertyChangeEvent evt) {
                final ControlledProcessState.State old = (ControlledProcessState.State) evt.getOldValue();
                final ControlledProcessState.State current = (ControlledProcessState.State) evt.getNewValue();
                if (old == ControlledProcessState.State.STARTING) {
                    // After starting reload has to be cleared, may still require a restart
                    if (current == ControlledProcessState.State.RUNNING || current == ControlledProcessState.State.RESTART_REQUIRED) {
                        connection.started();
                    } else {
                        IoUtils.safeClose(connection);
                    }
                }
            }
        });
        this.client = new HostControllerClient(serverName, connection.getChannelHandler(), connection, managementSubsystemEndpoint, executorSupplier.get());
    } catch (Exception e) {
        throw new StartException(e);
    }
}
Also used : PropertyChangeEvent(java.beans.PropertyChangeEvent) PropertyChangeListener(java.beans.PropertyChangeListener) ResponseAttachmentInputStreamSupport(org.jboss.as.controller.remote.ResponseAttachmentInputStreamSupport) ProcessStateNotifier(org.jboss.as.controller.ProcessStateNotifier) KeyStoreException(java.security.KeyStoreException) RejectedExecutionException(java.util.concurrent.RejectedExecutionException) GeneralSecurityException(java.security.GeneralSecurityException) StartException(org.jboss.msc.service.StartException) IOException(java.io.IOException) KeyManagementException(java.security.KeyManagementException) CertificateException(java.security.cert.CertificateException) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException) Endpoint(org.jboss.remoting3.Endpoint) ProtocolConnectionConfiguration(org.jboss.as.protocol.ProtocolConnectionConfiguration) ControlledProcessState(org.jboss.as.controller.ControlledProcessState) ControlledProcessState(org.jboss.as.controller.ControlledProcessState) StartException(org.jboss.msc.service.StartException)

Example 84 with Endpoint

use of com.google.cloud.servicedirectory.v1.Endpoint in project wildfly-core by wildfly.

the class DomainServerCommunicationServices method activate.

@Override
public void activate(final ServiceActivatorContext serviceActivatorContext) throws ServiceRegistryException {
    final ServiceTarget serviceTarget = serviceActivatorContext.getServiceTarget();
    final ServiceName endpointName = managementSubsystemEndpoint ? RemotingServices.SUBSYSTEM_ENDPOINT : ManagementRemotingServices.MANAGEMENT_ENDPOINT;
    final EndpointService.EndpointType endpointType = managementSubsystemEndpoint ? EndpointService.EndpointType.SUBSYSTEM : EndpointService.EndpointType.MANAGEMENT;
    try {
        ManagementWorkerService.installService(serviceTarget);
        // TODO see if we can figure out a way to work in the vault resolver instead of having to use ExpressionResolver.SIMPLE
        @SuppressWarnings("deprecation") final OptionMap options = EndpointConfigFactory.create(ExpressionResolver.SIMPLE, endpointConfig, DEFAULTS);
        ManagementRemotingServices.installRemotingManagementEndpoint(serviceTarget, endpointName, WildFlySecurityManager.getPropertyPrivileged(ServerEnvironment.NODE_NAME, null), endpointType, options);
        // Install the communication services
        final ServiceBuilder<?> sb = serviceTarget.addService(HostControllerConnectionService.SERVICE_NAME);
        final Supplier<ExecutorService> esSupplier = Services.requireServerExecutor(sb);
        final Supplier<ScheduledExecutorService> sesSupplier = sb.requires(ServerService.JBOSS_SERVER_SCHEDULED_EXECUTOR);
        final Supplier<Endpoint> eSupplier = sb.requires(endpointName);
        final Supplier<ProcessStateNotifier> cpsnSupplier = sb.requires(ControlledProcessStateService.INTERNAL_SERVICE_NAME);
        sb.setInstance(new HostControllerConnectionService(managementURI, serverName, serverProcessName, authKey, initialOperationID, managementSubsystemEndpoint, sslContextSupplier, esSupplier, sesSupplier, eSupplier, cpsnSupplier));
        sb.install();
    } catch (OperationFailedException e) {
        throw new ServiceRegistryException(e);
    }
}
Also used : ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) ServiceTarget(org.jboss.msc.service.ServiceTarget) OperationFailedException(org.jboss.as.controller.OperationFailedException) EndpointService(org.jboss.as.remoting.EndpointService) ProcessStateNotifier(org.jboss.as.controller.ProcessStateNotifier) ServiceRegistryException(org.jboss.msc.service.ServiceRegistryException) HostControllerConnectionService(org.jboss.as.server.mgmt.domain.HostControllerConnectionService) Endpoint(org.jboss.remoting3.Endpoint) ServiceName(org.jboss.msc.service.ServiceName) OptionMap(org.xnio.OptionMap) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) ExecutorService(java.util.concurrent.ExecutorService)

Example 85 with Endpoint

use of com.google.cloud.servicedirectory.v1.Endpoint in project wildfly-core by wildfly.

the class RemotingHttpUpgradeService method installServices.

public static void installServices(final OperationContext context, final String remotingConnectorName, final String httpConnectorName, final ServiceName endpointName, final OptionMap connectorPropertiesOptionMap, final String saslAuthenticationFactory) {
    final ServiceTarget serviceTarget = context.getServiceTarget();
    final ServiceName serviceName = UPGRADE_SERVICE_NAME.append(remotingConnectorName);
    final ServiceBuilder<?> sb = serviceTarget.addService(serviceName);
    final Consumer<RemotingHttpUpgradeService> serviceConsumer = sb.provides(serviceName);
    final Supplier<ChannelUpgradeHandler> urSupplier = sb.requires(HTTP_UPGRADE_REGISTRY.append(httpConnectorName));
    final Supplier<ListenerRegistry> lrSupplier = sb.requires(RemotingServices.HTTP_LISTENER_REGISTRY);
    final Supplier<Endpoint> eSupplier = sb.requires(endpointName);
    final Supplier<SaslAuthenticationFactory> safSupplier = saslAuthenticationFactory != null ? sb.requires(context.getCapabilityServiceName(SASL_AUTHENTICATION_FACTORY_CAPABILITY, saslAuthenticationFactory, SaslAuthenticationFactory.class)) : null;
    sb.setInstance(new RemotingHttpUpgradeService(serviceConsumer, urSupplier, lrSupplier, eSupplier, safSupplier, httpConnectorName, endpointName.getSimpleName(), connectorPropertiesOptionMap));
    sb.setInitialMode(ServiceController.Mode.ACTIVE);
    sb.install();
}
Also used : ListenerRegistry(io.undertow.server.ListenerRegistry) ChannelUpgradeHandler(io.undertow.server.handlers.ChannelUpgradeHandler) ServiceTarget(org.jboss.msc.service.ServiceTarget) SaslAuthenticationFactory(org.wildfly.security.auth.server.SaslAuthenticationFactory) Endpoint(org.jboss.remoting3.Endpoint) ServiceName(org.jboss.msc.service.ServiceName)

Aggregations

Endpoint (zipkin2.Endpoint)73 Span (zipkin2.Span)33 Test (org.junit.Test)28 Endpoint (org.jboss.remoting3.Endpoint)22 Test (org.junit.jupiter.api.Test)20 V1Span (zipkin2.v1.V1Span)16 NoopHealthCheckManager (com.wavefront.agent.channel.NoopHealthCheckManager)10 SpanSampler (com.wavefront.agent.sampler.SpanSampler)10 ByteBuf (io.netty.buffer.ByteBuf)10 ChannelHandlerContext (io.netty.channel.ChannelHandlerContext)10 DefaultFullHttpRequest (io.netty.handler.codec.http.DefaultFullHttpRequest)10 FullHttpRequest (io.netty.handler.codec.http.FullHttpRequest)10 Span (wavefront.report.Span)10 IOException (java.io.IOException)8 URI (java.net.URI)8 Annotation (wavefront.report.Annotation)8 ServiceName (org.jboss.msc.service.ServiceName)7 RateSampler (com.wavefront.sdk.entities.tracing.sampling.RateSampler)6 URISyntaxException (java.net.URISyntaxException)6 Endpoint (org.apache.woden.wsdl20.Endpoint)6