private boolean isEnableDispatchRunner() { return properties.getDispatchRunner() != null && properties.getDispatchRunner().isEnable(); }
@Override public void checkProperties() throws ConfigPropertiesIllegalException { Assert.hasText(getClusterName(), "clusterName must have value."); Assert.hasText(getRegistryAddress(), "registryAddress must have value."); } }
@Override public void afterPropertiesSet() throws Exception { properties.checkProperties(); agent = new MonitorAgent(); agent.setRegistryAddress(properties.getRegistryAddress()); if (StringUtils.isNotEmpty(properties.getClusterName())) { agent.setClusterName(properties.getClusterName()); } if (StringUtils.isNotEmpty(properties.getIdentity())) { agent.setIdentity(properties.getIdentity()); } if (StringUtils.isNotEmpty(properties.getBindIp())) { agent.setBindIp(properties.getBindIp()); } if (CollectionUtils.isNotEmpty(properties.getConfigs())) { for (Map.Entry<String, String> entry : properties.getConfigs().entrySet()) { agent.addConfig(entry.getKey(), entry.getValue()); } } agent.start(); }
@Override public void afterPropertiesSet() throws Exception { properties.checkProperties(); agent = new MonitorAgent(); agent.setRegistryAddress(properties.getRegistryAddress()); if (StringUtils.isNotEmpty(properties.getClusterName())) { agent.setClusterName(properties.getClusterName()); } if (StringUtils.isNotEmpty(properties.getIdentity())) { agent.setIdentity(properties.getIdentity()); } if (StringUtils.isNotEmpty(properties.getBindIp())) { agent.setBindIp(properties.getBindIp()); } if (CollectionUtils.isNotEmpty(properties.getConfigs())) { for (Map.Entry<String, String> entry : properties.getConfigs().entrySet()) { agent.addConfig(entry.getKey(), entry.getValue()); } } agent.start(); }
@Override public void checkProperties() throws ConfigPropertiesIllegalException { Assert.hasText(getClusterName(), "clusterName must have value."); Assert.hasText(getRegistryAddress(), "registryAddress must have value."); } }
private boolean isEnableDispatchRunner() { return properties.getDispatchRunner() != null && properties.getDispatchRunner().isEnable(); }
@Override public void afterPropertiesSet() throws Exception { properties.checkProperties(); agent = new MonitorAgent(); agent.setRegistryAddress(properties.getRegistryAddress()); if (StringUtils.isNotEmpty(properties.getClusterName())) { agent.setClusterName(properties.getClusterName()); } if (StringUtils.isNotEmpty(properties.getIdentity())) { agent.setIdentity(properties.getIdentity()); } if (StringUtils.isNotEmpty(properties.getBindIp())) { agent.setBindIp(properties.getBindIp()); } if (CollectionUtils.isNotEmpty(properties.getConfigs())) { for (Map.Entry<String, String> entry : properties.getConfigs().entrySet()) { agent.addConfig(entry.getKey(), entry.getValue()); } } agent.start(); }
@Override public void checkProperties() throws ConfigPropertiesIllegalException { Assert.hasText(getClusterName(), "clusterName must have value."); Assert.hasText(getRegistryAddress(), "registryAddress must have value."); } }
private void registerRunnerBeanDefinition() { DefaultListableBeanFactory beanFactory = (DefaultListableBeanFactory) ((ConfigurableApplicationContext) applicationContext).getBeanFactory(); if (!beanFactory.containsBean(JOB_RUNNER_BEAN_NAME)) { BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(JobDispatcher.class); builder.setScope(BeanDefinition.SCOPE_SINGLETON); builder.setLazyInit(false); builder.getBeanDefinition().getPropertyValues().addPropertyValue("shardField", properties.getDispatchRunner().getShardValue()); beanFactory.registerBeanDefinition(JOB_RUNNER_BEAN_NAME, builder.getBeanDefinition()); } }
private void registerRunnerBeanDefinition() { DefaultListableBeanFactory beanFactory = (DefaultListableBeanFactory) ((ConfigurableApplicationContext) applicationContext).getBeanFactory(); if (!beanFactory.containsBean(JOB_RUNNER_BEAN_NAME)) { BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(JobDispatcher.class); builder.setScope(BeanDefinition.SCOPE_SINGLETON); builder.setLazyInit(false); builder.getBeanDefinition().getPropertyValues().addPropertyValue("shardField", properties.getDispatchRunner().getShardValue()); beanFactory.registerBeanDefinition(JOB_RUNNER_BEAN_NAME, builder.getBeanDefinition()); } }
private boolean isEnableDispatchRunner() { return properties.getDispatchRunner() != null && properties.getDispatchRunner().isEnable(); }
private void registerRunnerBeanDefinition() { DefaultListableBeanFactory beanFactory = (DefaultListableBeanFactory) ((ConfigurableApplicationContext) applicationContext).getBeanFactory(); if (!beanFactory.containsBean(JOB_RUNNER_BEAN_NAME)) { BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(JobDispatcher.class); builder.setScope(BeanDefinition.SCOPE_SINGLETON); builder.setLazyInit(false); builder.getBeanDefinition().getPropertyValues().addPropertyValue("shardField", properties.getDispatchRunner().getShardValue()); beanFactory.registerBeanDefinition(JOB_RUNNER_BEAN_NAME, builder.getBeanDefinition()); } }