当前位置: 首页>>代码示例>>Java>>正文


Java Endpoint类代码示例

本文整理汇总了Java中org.jboss.remoting3.Endpoint的典型用法代码示例。如果您正苦于以下问题:Java Endpoint类的具体用法?Java Endpoint怎么用?Java Endpoint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Endpoint类属于org.jboss.remoting3包,在下文中一共展示了Endpoint类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: installManagementChannelOpenListenerService

import org.jboss.remoting3.Endpoint; //导入依赖的package包/类
/**
 * Set up the services to create a channel listener. This assumes that an endpoint service called {@code endpointName} exists.
 *  @param serviceTarget the service target to install the services into
 * @param endpointName the name of the endpoint to install a channel listener into
 * @param channelName the name of the channel
 * @param operationHandlerName the name of the operation handler to handle request for this channel
 * @param options the remoting options
 * @param onDemand whether to install the services on demand
 */
public static void installManagementChannelOpenListenerService(
        final ServiceTarget serviceTarget,
        final ServiceName endpointName,
        final String channelName,
        final ServiceName operationHandlerName,
        final OptionMap options,
        final boolean onDemand) {

    final ManagementChannelOpenListenerService channelOpenListenerService = new ManagementChannelOpenListenerService(channelName, options);
    final ServiceBuilder<?> builder = serviceTarget.addService(channelOpenListenerService.getServiceName(endpointName), channelOpenListenerService)
            .addDependency(endpointName, Endpoint.class, channelOpenListenerService.getEndpointInjector())
            .addDependency(operationHandlerName, ManagementChannelInitialization.class, channelOpenListenerService.getOperationHandlerInjector())
            .addDependency(ManagementChannelRegistryService.SERVICE_NAME, ManagementChannelRegistryService.class, channelOpenListenerService.getRegistry())
            .addDependency(SHUTDOWN_EXECUTOR_NAME, ExecutorService.class, channelOpenListenerService.getExecutorServiceInjectedValue())
            .setInitialMode(onDemand ? ON_DEMAND : ACTIVE);

    builder.install();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:28,代码来源:ManagementRemotingServices.java

示例2: installServices

import org.jboss.remoting3.Endpoint; //导入依赖的package包/类
public static void installServices(final OperationContext context, final String remotingConnectorName, final String httpConnectorName, final ServiceName endpointName,
        final OptionMap connectorPropertiesOptionMap, final String securityRealm, final String saslAuthenticationFactory) {
    ServiceTarget serviceTarget = context.getServiceTarget();
    final RemotingHttpUpgradeService service = new RemotingHttpUpgradeService(httpConnectorName, endpointName.getSimpleName(), connectorPropertiesOptionMap);

    ServiceBuilder<RemotingHttpUpgradeService> serviceBuilder = serviceTarget.addService(UPGRADE_SERVICE_NAME.append(remotingConnectorName), service)
            .setInitialMode(ServiceController.Mode.PASSIVE)
            .addDependency(HTTP_UPGRADE_REGISTRY.append(httpConnectorName), ChannelUpgradeHandler.class, service.injectedRegistry)
            .addDependency(HttpListenerRegistryService.SERVICE_NAME, ListenerRegistry.class, service.listenerRegistry)
            .addDependency(endpointName, Endpoint.class, service.injectedEndpoint);

    if (securityRealm != null) {
        serviceBuilder.addDependency(
                org.jboss.as.domain.management.SecurityRealm.ServiceUtil.createServiceName(securityRealm),
                org.jboss.as.domain.management.SecurityRealm.class, service.injectedSecurityRealm);
    }

    if (saslAuthenticationFactory != null) {
        serviceBuilder.addDependency(
                context.getCapabilityServiceName(SASL_AUTHENTICATION_FACTORY_CAPABILITY, saslAuthenticationFactory, SaslAuthenticationFactory.class),
                SaslAuthenticationFactory.class, service.injectedSaslAuthenticationFactory);
    }

    serviceBuilder.install();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:26,代码来源:RemotingHttpUpgradeService.java

示例3: installRuntimeService

import org.jboss.remoting3.Endpoint; //导入依赖的package包/类
void installRuntimeService(final OperationContext context, final ModelNode operation, final ModelNode fullModel) throws OperationFailedException {

        final PathAddress pathAddress = PathAddress.pathAddress(operation.require(OP_ADDR));
        final String connectionName = pathAddress.getLastElement().getValue();
        final OptionMap connectionCreationOptions = ConnectorUtils.getOptions(context, fullModel.get(CommonAttributes.PROPERTY));


        //final OptionMap connectionCreationOptions = getConnectionCreationOptions(outboundConnection);
        // Get the destination URI
        final URI uri = getDestinationURI(context, operation);
        // create the service
        final GenericOutboundConnectionService outboundRemotingConnectionService = new GenericOutboundConnectionService(connectionName, uri, connectionCreationOptions);
        final ServiceName serviceName = AbstractOutboundConnectionService.OUTBOUND_CONNECTION_BASE_SERVICE_NAME.append(connectionName);
        // also add an alias service name to easily distinguish between a generic, remote and local type of connection services
        final ServiceName aliasServiceName = GenericOutboundConnectionService.GENERIC_OUTBOUND_CONNECTION_BASE_SERVICE_NAME.append(connectionName);
        context.getServiceTarget().addService(serviceName, outboundRemotingConnectionService)
                .addAliases(aliasServiceName)
                .addDependency(RemotingServices.SUBSYSTEM_ENDPOINT, Endpoint.class, outboundRemotingConnectionService.getEndpointInjector())
                .install();
    }
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:21,代码来源:GenericOutboundConnectionAdd.java

示例4: installConnectorServices

import org.jboss.remoting3.Endpoint; //导入依赖的package包/类
private static void installConnectorServices(final ServiceBuilder<AcceptingChannel<StreamConnection>> serviceBuilder,
                                             final AbstractStreamServerService service,
                                             final ServiceName endpointName,
                                             final ServiceName securityRealm,
                                             final ServiceName saslAuthenticationFactory,
                                             final ServiceName sslContext) {

    serviceBuilder.addDependency(endpointName, Endpoint.class, service.getEndpointInjector());
    if (securityRealm != null) {
        serviceBuilder.addDependency(securityRealm, SecurityRealm.class, service.getSecurityRealmInjector());
    }
    if (saslAuthenticationFactory != null) {
        serviceBuilder.addDependency(saslAuthenticationFactory, SaslAuthenticationFactory.class, service.getSaslAuthenticationFactoryInjector());
    }
    if (sslContext != null) {
        serviceBuilder.addDependency(sslContext, SSLContext.class, service.getSSLContextInjector());
    }
    serviceBuilder.install();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:20,代码来源:RemotingServices.java

示例5: installRuntimeService

import org.jboss.remoting3.Endpoint; //导入依赖的package包/类
void installRuntimeService(final OperationContext context, final ModelNode operation,
                                        final ModelNode fullModel) throws OperationFailedException {
    final PathAddress address = PathAddress.pathAddress(operation.require(ModelDescriptionConstants.OP_ADDR));
    final String connectionName = address.getLastElement().getValue();
    final String outboundSocketBindingRef = LocalOutboundConnectionResourceDefinition.OUTBOUND_SOCKET_BINDING_REF.resolveModelAttribute(context, operation).asString();
    final ServiceName outboundSocketBindingDependency = context.getCapabilityServiceName(OUTBOUND_SOCKET_BINDING_CAPABILITY_NAME, outboundSocketBindingRef, OutboundSocketBinding.class);
    // fetch the connection creation options from the model
    final OptionMap connectionCreationOptions = ConnectorUtils.getOptions(context, fullModel.get(CommonAttributes.PROPERTY));
    // create the service
    final LocalOutboundConnectionService outboundConnectionService = new LocalOutboundConnectionService(connectionName, connectionCreationOptions);
    final ServiceName serviceName = AbstractOutboundConnectionService.OUTBOUND_CONNECTION_BASE_SERVICE_NAME.append(connectionName);
    // also add an alias service name to easily distinguish between a generic, remote and local type of connection services
    final ServiceName aliasServiceName = LocalOutboundConnectionService.LOCAL_OUTBOUND_CONNECTION_BASE_SERVICE_NAME.append(connectionName);
    final ServiceBuilder<LocalOutboundConnectionService> svcBuilder = context.getServiceTarget().addService(serviceName, outboundConnectionService)
            .addAliases(aliasServiceName)
            .addDependency(RemotingServices.SUBSYSTEM_ENDPOINT, Endpoint.class, outboundConnectionService.getEndpointInjector())
            .addDependency(outboundSocketBindingDependency, OutboundSocketBinding.class, outboundConnectionService.getDestinationOutboundSocketBindingInjector());

    svcBuilder.install();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:21,代码来源:LocalOutboundConnectionAdd.java

示例6: start

import org.jboss.remoting3.Endpoint; //导入依赖的package包/类
/** {@inheritDoc} */
public void start(final StartContext context) throws StartException {
    final Endpoint endpoint;
    final EndpointBuilder builder = Endpoint.builder();
    builder.setEndpointName(endpointName);
    builder.setXnioWorker(worker.getValue());
    try {
        endpoint = builder.build();
    } catch (IOException e) {
        throw RemotingLogger.ROOT_LOGGER.couldNotStart(e);
    }
    // TODO: this is not really how we want to do this though; we want to set a context-sensitive default
    Endpoint.ENDPOINT_CONTEXT_MANAGER.setGlobalDefault(endpoint);
    // Reuse the options for the remote connection factory for now
    this.endpoint = endpoint;
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:17,代码来源:EndpointService.java

示例7: activate

import org.jboss.remoting3.Endpoint; //导入依赖的package包/类
@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
        HostControllerConnectionService service = new HostControllerConnectionService(managementURI, serverName, serverProcessName, authKey, initialOperationID, managementSubsystemEndpoint, sslContextSupplier);
        Services.addServerExecutorDependency(serviceTarget.addService(HostControllerConnectionService.SERVICE_NAME, service), service.getExecutorInjector())
                .addDependency(ServerService.JBOSS_SERVER_SCHEDULED_EXECUTOR, ScheduledExecutorService.class, service.getScheduledExecutorInjector())
                .addDependency(endpointName, Endpoint.class, service.getEndpointInjector())
                .addDependency(ControlledProcessStateService.SERVICE_NAME, ControlledProcessStateService.class, service.getProcessStateServiceInjectedValue())
                .setInitialMode(ServiceController.Mode.ACTIVE).install();

    } catch (OperationFailedException e) {
        throw new ServiceRegistryException(e);
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:25,代码来源:DomainServerCommunicationServices.java

示例8: create

import org.jboss.remoting3.Endpoint; //导入依赖的package包/类
static ProtocolConnectionConfiguration create(final ModelControllerClientConfiguration client, final Endpoint endpoint) throws URISyntaxException {

        URI connURI;
        if(client.getProtocol() == null) {
            // WFLY-1462 for compatibility assume remoting if the standard native port is configured
            String protocol = client.getPort() == 9999 ? "remote://" : "remote+http://";
            connURI = new URI(protocol + formatPossibleIpv6Address(client.getHost()) +  ":" + client.getPort());
        } else  {
            connURI = new URI(client.getProtocol() + "://" + formatPossibleIpv6Address(client.getHost()) +  ":" + client.getPort());
        }
        final ProtocolConnectionConfiguration configuration = ProtocolConnectionConfiguration.create(endpoint, connURI, DEFAULT_OPTIONS);

        configuration.setClientBindAddress(client.getClientBindAddress());
        final long timeout = client.getConnectionTimeout();
        if(timeout > 0) {
            configuration.setConnectionTimeout(timeout);
        }
        return configuration;
    }
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:20,代码来源:ProtocolConfigurationFactory.java

示例9: create

import org.jboss.remoting3.Endpoint; //导入依赖的package包/类
public static ProtocolConnectionConfiguration create(final Endpoint endpoint, final URI uri, final OptionMap options) {
    final ProtocolConnectionConfiguration configuration = new ProtocolConnectionConfiguration();
    configuration.setEndpoint(endpoint);
    configuration.setUri(uri);
    configuration.setOptionMap(options);
    return configuration;
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:8,代码来源:ProtocolConnectionConfiguration.java

示例10: ChannelServer

import org.jboss.remoting3.Endpoint; //导入依赖的package包/类
private ChannelServer(final Endpoint endpoint,
        final Registration registration,
        final AcceptingChannel<StreamConnection> streamServer) {
    this.endpoint = endpoint;
    this.registration = registration;
    this.streamServer = streamServer;
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:8,代码来源:ChannelServer.java

示例11: create

import org.jboss.remoting3.Endpoint; //导入依赖的package包/类
public static ChannelServer create(final Configuration configuration) throws IOException {
    if (configuration == null) {
        throw new IllegalArgumentException("Null configuration");
    }
    configuration.validate();

    // Hack WFCORE-3302/REM3-303 workaround
    if (firstCreate) {
        firstCreate = false;
    } else {
        try {
            // wait in case the previous socket has not closed
            Thread.sleep(100);
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            throw new RuntimeException(e);
        }
    }

    // TODO WFCORE-3302 -- Endpoint.getCurrent() should be ok
    final Endpoint endpoint = Endpoint.builder().setEndpointName(configuration.getEndpointName()).build();

    final NetworkServerProvider networkServerProvider = endpoint.getConnectionProviderInterface(configuration.getUriScheme(), NetworkServerProvider.class);
    final SecurityDomain.Builder domainBuilder = SecurityDomain.builder();
    final SimpleMapBackedSecurityRealm realm = new SimpleMapBackedSecurityRealm();
    domainBuilder.addRealm("default", realm).build();
    domainBuilder.setDefaultRealmName("default");
    domainBuilder.setPermissionMapper((permissionMappable, roles) -> PermissionVerifier.ALL);
    SecurityDomain testDomain = domainBuilder.build();
    SaslAuthenticationFactory saslAuthenticationFactory = SaslAuthenticationFactory.builder()
        .setSecurityDomain(testDomain)
        .setMechanismConfigurationSelector(mechanismInformation -> "ANONYMOUS".equals(mechanismInformation.getMechanismName()) ? MechanismConfiguration.EMPTY : null)
        .setFactory(new AnonymousServerFactory())
        .build();
    System.out.println(configuration.getBindAddress());
    AcceptingChannel<StreamConnection> streamServer = networkServerProvider.createServer(configuration.getBindAddress(), OptionMap.EMPTY, saslAuthenticationFactory, null);

    return new ChannelServer(endpoint, null, streamServer);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:40,代码来源:ChannelServer.java

示例12: create

import org.jboss.remoting3.Endpoint; //导入依赖的package包/类
static TestControllerUtils create(URI uri, CallbackHandler callbackHandler) throws IOException {
    final Endpoint endpoint = Endpoint.getCurrent();

    final ProtocolConnectionConfiguration configuration = ProtocolConnectionConfiguration.create(endpoint, uri);
    configuration.setCallbackHandler(callbackHandler);
    return new TestControllerUtils(endpoint, configuration, createDefaultExecutor());
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:8,代码来源:TestControllerUtils.java

示例13: addService

import org.jboss.remoting3.Endpoint; //导入依赖的package包/类
static void addService(final ServiceTarget target,
                       final ServiceName remotingCapability,
                       final String resolvedDomain,
                       final String expressionsDomain) {
    final RemotingConnectorService service = new RemotingConnectorService(resolvedDomain, expressionsDomain);
    target.addService(SERVICE_NAME, service)
            .addDependency(MBeanServerService.SERVICE_NAME, MBeanServer.class, service.mBeanServer)
            .addDependency(remotingCapability, Endpoint.class, service.endpoint)
            .install();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:11,代码来源:RemotingConnectorService.java

示例14: performRuntime

import org.jboss.remoting3.Endpoint; //导入依赖的package包/类
@Override
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model)
        throws OperationFailedException {

    boolean useManagementEndpoint = RemotingConnectorResource.USE_MANAGEMENT_ENDPOINT.resolveModelAttribute(context, model).asBoolean();

    ServiceName remotingCapability;
    if (!useManagementEndpoint) {
        // Use the remoting capability
        // if (context.getProcessType() == ProcessType.DOMAIN_SERVER) then DomainServerCommunicationServices
        // installed the "remoting subsystem" endpoint and we don't even necessarily *have to* have a remoting
        // subsystem and possibly we could skip adding the requirement for its capability. But really, specifying
        // not to use the management endpoint and then not configuring a remoting subsystem is a misconfiguration,
        // and we should treat it as such. So, we add the requirement no matter what.
        context.requireOptionalCapability(RemotingConnectorResource.REMOTING_CAPABILITY, RemotingConnectorResource.REMOTE_JMX_CAPABILITY.getName(),
                    RemotingConnectorResource.USE_MANAGEMENT_ENDPOINT.getName());
        remotingCapability = context.getCapabilityServiceName(RemotingConnectorResource.REMOTING_CAPABILITY, Endpoint.class);
    } else {
        remotingCapability = ManagementRemotingServices.MANAGEMENT_ENDPOINT;
    }
    // Read the model for the JMX subsystem to find the domain name for the resolved/expressions models (if they are exposed).
    PathAddress address = PathAddress.pathAddress(operation.get(ModelDescriptionConstants.OP_ADDR));
    PathAddress parentAddress = address.subAddress(0, address.size() - 1);
    ModelNode jmxSubsystemModel = Resource.Tools.readModel(context.readResourceFromRoot(parentAddress, true));
    String resolvedDomain = getDomainName(context, jmxSubsystemModel, CommonAttributes.RESOLVED);
    String expressionsDomain = getDomainName(context, jmxSubsystemModel, CommonAttributes.EXPRESSION);

    RemotingConnectorService.addService(context.getServiceTarget(), remotingCapability, resolvedDomain, expressionsDomain);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:30,代码来源:RemotingConnectorAdd.java

示例15: install

import org.jboss.remoting3.Endpoint; //导入依赖的package包/类
static Future<MasterDomainControllerClient> install(final ServiceTarget serviceTarget,
                                                    final ModelController controller,
                                                    final ExtensionRegistry extensionRegistry,
                                                    final LocalHostControllerInfo localHostControllerInfo,
                                                    final ServiceName authenticationContext,
                                                    final String securityRealm,
                                                    final RemoteFileRepository remoteFileRepository,
                                                    final ContentRepository contentRepository,
                                                    final IgnoredDomainResourceRegistry ignoredDomainResourceRegistry,
                                                    final HostControllerRegistrationHandler.OperationExecutor operationExecutor,
                                                    final DomainController domainController,
                                                    final HostControllerEnvironment hostControllerEnvironment,
                                                    final ExecutorService executor,
                                                    final RunningMode currentRunningMode,
                                                    final Map<String, ProxyController> serverProxies,
                                                    final AtomicBoolean domainModelComplete) {
    RemoteDomainConnectionService service = new RemoteDomainConnectionService(controller, extensionRegistry, localHostControllerInfo,
            remoteFileRepository, contentRepository,
            ignoredDomainResourceRegistry, operationExecutor, domainController,
            hostControllerEnvironment, executor, currentRunningMode, serverProxies, domainModelComplete);
    ServiceBuilder<MasterDomainControllerClient> builder = serviceTarget.addService(MasterDomainControllerClient.SERVICE_NAME, service)
            .addDependency(ManagementRemotingServices.MANAGEMENT_ENDPOINT, Endpoint.class, service.endpointInjector)
            .addDependency(ServerInventoryService.SERVICE_NAME, ServerInventory.class, service.serverInventoryInjector)
            .addDependency(HostControllerService.HC_SCHEDULED_EXECUTOR_SERVICE_NAME, ScheduledExecutorService.class, service.scheduledExecutorInjector)
            .setInitialMode(ServiceController.Mode.ACTIVE);

    if (authenticationContext != null) {
        builder.addDependency(authenticationContext, AuthenticationContext.class, service.authenticationContextInjector);
    }
    if (securityRealm != null) {
        SecurityRealm.ServiceUtil.addDependency(builder, service.securityRealmInjector, securityRealm);
    }

    builder.install();
    return service.futureClient;
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:37,代码来源:RemoteDomainConnectionService.java


注:本文中的org.jboss.remoting3.Endpoint类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。