• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java PluginExecutorService类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: InfluxDbConfiguration

import com.hivemq.spi.services.PluginExecutorService; //导入依赖的package包/类
@Inject
public InfluxDbConfiguration(final PluginExecutorService pluginExecutorService,
                             final SystemInformation systemInformation) {
    super(pluginExecutorService, systemInformation);

    final ValueChangedCallback<String> callback = new ValueChangedCallback<String>() {
        @Override
        public void valueChanged(final String newValue) {
            if (listener != null) {
                listener.restart();
            }
        }
    };

    addCallback("mode", callback);
    addCallback("host", callback);
    addCallback("port", callback);
    addCallback("protocol", callback);
    addCallback("reportingInterval", callback);
    addCallback("prefix", callback);
    addCallback("database", callback);
    addCallback("auth", callback);
    addCallback("connectTimeout", callback);
    addCallback("tags", callback);
}
 
开发者ID:hivemq,项目名称:influxdb-monitoring-plugin,代码行数:26,代码来源:InfluxDbConfiguration.java


示例2: ConsulDiscoveryCallback

import com.hivemq.spi.services.PluginExecutorService; //导入依赖的package包/类
@Inject
public ConsulDiscoveryCallback(final Consul consul,
                               final Configuration configuration,
                               final PluginExecutorService pluginExecutorService) {
    this.consul = consul;
    this.configuration = configuration;
    this.pluginExecutorService = pluginExecutorService;
}
 
开发者ID:pellepelster,项目名称:hivemq-consul-cluster-discovery,代码行数:9,代码来源:ConsulDiscoveryCallback.java


示例3: S3DiscoveryCallback

import com.hivemq.spi.services.PluginExecutorService; //导入依赖的package包/类
@Inject
public S3DiscoveryCallback(final AmazonS3 s3,
                           final Configuration configuration,
                           final PluginExecutorService pluginExecutorService) {
    this.s3 = s3;
    this.s3.setEndpoint(configuration.getEndpoint());
    this.s3.setS3ClientOptions(new S3ClientOptions().withPathStyleAccess(configuration.withPathStyleAccess()));
    this.configuration = configuration;
    this.pluginExecutorService = pluginExecutorService;
    this.bucketName = configuration.getBucketName();
}
 
开发者ID:hivemq,项目名称:s3-cluster-discovery-plugin,代码行数:12,代码来源:S3DiscoveryCallback.java


示例4: Configuration

import com.hivemq.spi.services.PluginExecutorService; //导入依赖的package包/类
@Inject
public Configuration(final PluginExecutorService pluginExecutorService, SystemInformation systemInformation) {
    super(pluginExecutorService, systemInformation);
    this.pluginExecutorService = pluginExecutorService;
    this.systemInformation = systemInformation;


    init();

    final ValueChangedCallback callback = new ValueChangedCallback() {
        @Override
        public void valueChanged(final Object newValue) {
            if (listener != null) {
                listener.restart();
            }
        }
    };

    addCallback("filename", callback);
    addCallback("reloadCredentialsInterval.seconds", callback);
    addCallback("passwordHashing.enabled", callback);
    addCallback("passwordHashing.iterations", callback);
    addCallback("passwordHashing.algorithm", callback);
    addCallback("passwordHashingSalt.separationChar", callback);
    addCallback("passwordHashingSalt.enabled", callback);
    addCallback("passwordHashingSalt.isFirst", callback);
    addCallback("cachingTime.seconds", callback);
    addCallback("cacheSize", callback);

}
 
开发者ID:hivemq,项目名称:file-auth-plugin,代码行数:31,代码来源:Configuration.java


示例5: CredentialsConfiguration

import com.hivemq.spi.services.PluginExecutorService; //导入依赖的package包/类
@Inject
public CredentialsConfiguration(final PluginExecutorService pluginExecutorService, final String filename, final int reloadSeconds, final SystemInformation systemInformation) {
    super(pluginExecutorService, systemInformation);
    this.callbacks = new ArrayList<>();
    this.filename = filename;
    this.reloadSeconds = reloadSeconds;
}
 
开发者ID:hivemq,项目名称:file-auth-plugin,代码行数:8,代码来源:CredentialsConfiguration.java


示例6: fullPluginLifecycleWithDefaultConfiguration

import com.hivemq.spi.services.PluginExecutorService; //导入依赖的package包/类
@Test
public void fullPluginLifecycleWithDefaultConfiguration() throws ExecutionException, InterruptedException {

    // dummy consul client
    Consul consul = mock(Consul.class);
    AgentClient agentClient = mock(AgentClient.class);
    when(consul.agentClient()).thenReturn(agentClient);

    // empty config
    ConfigurationReader configurationReader = mock(ConfigurationReader.class);
    Properties properties = new Properties();
    when(configurationReader.getProperties()).thenReturn(properties);
    Configuration configuration = new Configuration(configurationReader);

    PluginExecutorService pluginExecutorService = mock(PluginExecutorService.class);

    ConsulDiscoveryCallback callback = new ConsulDiscoveryCallback(consul, configuration, pluginExecutorService);
    callback.init("clusternode1", new ClusterNodeAddress("clusternode1-hostname", 1234));

    // check if registration job gets scheduled
    ArgumentCaptor<Runnable> runnableArgument = ArgumentCaptor.forClass(Runnable.class);
    verify(pluginExecutorService, times(2)).scheduleAtFixedRate(runnableArgument.capture(), anyLong(), eq(60l), eq(TimeUnit.SECONDS));

    // run registration job
    Runnable registrationRunnable = runnableArgument.getAllValues().get(0);
    Runnable updateRunnable = runnableArgument.getAllValues().get(1);

    registrationRunnable.run();

    // verify service registration
    ArgumentCaptor<Registration> argument = ArgumentCaptor.forClass(Registration.class);
    verify(agentClient).register(argument.capture(), any());


    Registration registration = argument.getValue();
    assertEquals("cluster-discovery-hivemq", registration.getName());
    assertEquals("clusternode1-hostname", registration.getAddress().get());
    assertEquals(Integer.valueOf(1234), registration.getPort().get());
    assertEquals("cluster-discovery-hivemq", registration.getName());

    String registrationId = registration.getId();
    assertThat(registrationId).containsOnlyDigits();
    assertEquals(1, registration.getChecks().size());

    Registration.RegCheck regCheck = registration.getChecks().get(0);
    assertEquals("120s", regCheck.getTtl().get());

     // run updater job and check consul service pass call
    updateRunnable.run();
    try {
        verify(agentClient).pass(eq(registrationId));
    } catch (NotRegisteredException e) {
        throw new RuntimeException(e);
    }

    HealthClient healthClient = mock(HealthClient.class);
    List<ServiceHealth> nodes = new ArrayList<>();

    Service service = ImmutableService.builder()
            .address("host1")
            .id("not important")
            .service("doesnt matter")
            .port(5678).build();

    Node node = ImmutableNode.builder().node("node1").address("address1").build();
    ServiceHealth serviceHealth = ImmutableServiceHealth.builder().service(service).node(node).build();

    nodes.add(serviceHealth);
    ConsulResponse response = new ConsulResponse(nodes, 0, true, BigInteger.ZERO);
    when(healthClient.getHealthyServiceInstances(anyString(), ArgumentMatchers.<ImmutableQueryOptions>any())).thenReturn(response);
    when(consul.healthClient()).thenReturn(healthClient);

    List<ClusterNodeAddress> addresses = callback.getNodeAddresses().get();
    assertEquals(1, addresses.size());
    assertEquals("host1", addresses.get(0).getHost());
    assertEquals(5678, addresses.get(0).getPort());

    callback.destroy();
    verify(agentClient).deregister(eq(registrationId));
}
 
开发者ID:pellepelster,项目名称:hivemq-consul-cluster-discovery,代码行数:81,代码来源:ConsulDiscoveryCallbackTest.java


示例7: ReloadingPropertiesReader

import com.hivemq.spi.services.PluginExecutorService; //导入依赖的package包/类
ReloadingPropertiesReader(final PluginExecutorService pluginExecutorService,
                          final SystemInformation systemInformation) {
    this.pluginExecutorService = pluginExecutorService;
    this.systemInformation = systemInformation;
}
 
开发者ID:hivemq,项目名称:influxdb-monitoring-plugin,代码行数:6,代码来源:ReloadingPropertiesReader.java


示例8: TestReloadingPropertiesReader

import com.hivemq.spi.services.PluginExecutorService; //导入依赖的package包/类
public TestReloadingPropertiesReader(final PluginExecutorService pluginExecutorService, final SystemInformation systemInformation, final String filename) {
    super(pluginExecutorService, systemInformation);
    this.filename = filename;
}
 
开发者ID:hivemq,项目名称:influxdb-monitoring-plugin,代码行数:5,代码来源:ReloadingPropertiesReaderTest.java


示例9: PersistMessagesCallback

import com.hivemq.spi.services.PluginExecutorService; //导入依赖的package包/类
@Inject
public PersistMessagesCallback(final Provider<Connection> connectionProvider,
                               final PluginExecutorService pluginExecutorService) {
    this.connectionProvider = connectionProvider;
    this.pluginExecutorService = pluginExecutorService;
}
 
开发者ID:hivemq,项目名称:hivemq-database-example-plugin,代码行数:7,代码来源:PersistMessagesCallback.java


示例10: ReloadingPropertiesReader

import com.hivemq.spi.services.PluginExecutorService; //导入依赖的package包/类
public ReloadingPropertiesReader(final PluginExecutorService pluginExecutorService, final SystemInformation systemInformation) {
    this.pluginExecutorService = pluginExecutorService;
    this.systemInformation = systemInformation;
}
 
开发者ID:hivemq,项目名称:file-auth-plugin,代码行数:5,代码来源:ReloadingPropertiesReader.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Person类代码示例发布时间:2022-05-22
下一篇:
Java RecipeInfo类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap