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


Java ConfigProperty类代码示例

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


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

示例1: ProcessMonitor

import org.apache.deltaspike.core.api.config.ConfigProperty; //导入依赖的package包/类
@Inject
public ProcessMonitor(ApiMasterKubernetesModel model,
                      ProcessManager processManager,
                      @ConfigProperty(name = "processMonitor_pollTime", defaultValue = "2000")
                      long pollTime) {
    this.model = model;
    this.processManager = processManager;
    this.pollTime = pollTime;

    System.out.println("Starting the process monitor with poll time: " + pollTime);

    TimerTask timerTask = new TimerTask() {
        @Override
        public void run() {
            LOG.debug("process monitor timer");
            processMonitor();
        }
    };
    timer.schedule(timerTask, pollTime, pollTime);
}
 
开发者ID:fabric8io,项目名称:jube,代码行数:21,代码来源:ProcessMonitor.java

示例2: ForgeInitialiser

import org.apache.deltaspike.core.api.config.ConfigProperty; //导入依赖的package包/类
/**
 * @param addOnDir the directory where Forge addons will be stored
 */
@Inject
public ForgeInitialiser(@ConfigProperty(name = "FORGE_ADDON_DIRECTORY", defaultValue = "./addon-repository") String addOnDir, FurnaceProducer furnaceProducer) {
    java.util.logging.Logger out = java.util.logging.Logger.getLogger(this.getClass().getName());
    out.info("Logging to JUL to test the configuration");

    // lets ensure that the addons folder is initialised
    File repoDir = new File(addOnDir);
    repoDir.mkdirs();
    LOG.info("initialising furnace with folder: " + repoDir.getAbsolutePath());
    File[] files = repoDir.listFiles();
    if (files == null || files.length == 0) {
        LOG.warn("No files found in the addon directory: " + repoDir.getAbsolutePath());
    } else {
        LOG.warn("Found " + files.length + " addon files in directory: " + repoDir.getAbsolutePath());
    }
    furnaceProducer.setup(repoDir);
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:21,代码来源:ForgeInitialiser.java

示例3: CuratorConfig

import org.apache.deltaspike.core.api.config.ConfigProperty; //导入依赖的package包/类
@Inject
public CuratorConfig(
        @ConfigProperty(name = "ZOOKEEPER_USER")
        String user,
        @ConfigProperty(name = "ZOOKEEPER_PASSWORD")
        String password,
        @ConfigProperty(name = "ZOOKEEPER_RETRY_POLICY_MAX_RETRIES", defaultValue = DEFAULT_MAX_RETRIES_LIMIT)
        int retryMax,
        @ConfigProperty(name = "ZOOKEEPER_RETRY_POLICY_INTERVAL_MS", defaultValue = DEFAULT_RETRY_INTERVAL)
        int retryInterval,
        @ConfigProperty(name = "ZOOKEEPER_CONNECTION_TIMEOUT", defaultValue = DEFAULT_CONNECTION_TIMEOUT_MS)
        int connectionTimeOut,
        @ConfigProperty(name = "ZOOKEEPER_SESSION_TIMEOUT", defaultValue = DEFAULT_SESSION_TIMEOUT_MS)
        int sessionTimeout) {
    this.user = user;
    this.password = password;
    this.retryMax = retryMax;
    this.retryInterval = retryInterval;
    this.connectionTimeOut = connectionTimeOut;
    this.sessionTimeout = sessionTimeout;
}
 
开发者ID:fabric8io,项目名称:jube,代码行数:22,代码来源:CuratorConfig.java

示例4: ZooKeeperServerConfig

import org.apache.deltaspike.core.api.config.ConfigProperty; //导入依赖的package包/类
/**
 * @param clientPort   the port the ZooKeeper client uses to connect to
 * @param dataDir      the directory ZooKeeper uses to store its data
 * @param dataLogDir   the directory ZooKeeper uses to store its logs
 * @param tickTime     the keep alive tick time
 * @param initLimit    initialisation limit
 * @param syncLimit    synchronisation limit
 */
@Inject
public ZooKeeperServerConfig(@ConfigProperty(name = "ZOOKEEPER_CLIENT_PORT", defaultValue = "2181")
                             int clientPort,
                             @ConfigProperty(name = "ZOOKEEPER_DATADIR", defaultValue = "ensemble/data")
                             String dataDir,
                             @ConfigProperty(name = "ZOOKEEPER_DATA_LOG_DIR", defaultValue = "ensemble/log")
                             String dataLogDir,
                             @ConfigProperty(name = "ZOOKEEPER_TICKTIME", defaultValue = "" + ZooKeeperServer.DEFAULT_TICK_TIME)
                             int tickTime,
                             @ConfigProperty(name = "ZOOKEEPER_INIT_LIMIT")
                             int initLimit,
                             @ConfigProperty(name = "ZOOKEEPER_SYNC_LIMIT")
                             int syncLimit) {
    this.dataDir = dataDir;
    this.dataLogDir = dataLogDir;
    this.syncLimit = syncLimit;
    this.initLimit = initLimit;
    if (clientPort > 0) {
        this.clientPortAddress = new InetSocketAddress(clientPort);
    }
}
 
开发者ID:fabric8io,项目名称:jube,代码行数:30,代码来源:ZooKeeperServerConfig.java

示例5: ApiMasterService

import org.apache.deltaspike.core.api.config.ConfigProperty; //导入依赖的package包/类
@Inject
public ApiMasterService(ProcessManager processManager, ApiMasterKubernetesModel model, Replicator replicator, ProcessMonitor processMonitor, KubeProxy kubeProxy, HostNodeModel hostNodeModel,
                        @ConfigProperty(name = "JUBE_HOSTNAME", defaultValue = DEFAULT_HOSTNAME)
                        String hostName,
                        @ConfigProperty(name = "HTTP_PORT", defaultValue = DEFAULT_HTTP_PORT)
                        String port) {
    this.processManager = processManager;
    this.model = model;
    this.replicator = replicator;
    this.processMonitor = processMonitor;
    this.kubeProxy = kubeProxy;
    this.hostNodeModel = hostNodeModel;

    ApiMasterService.hostName = hostName;
    ApiMasterService.port = port;

    HostNode node = new HostNode();
    node.setHostName(hostName);
    node.setWebUrl("http://" + hostName + ":" + port + "/");
    node.setId(UUID.randomUUID().toString());
    hostNodeModel.write(node);

    ensureModelHasKubernetesServices(hostName, port);
}
 
开发者ID:fabric8io,项目名称:jube,代码行数:25,代码来源:ApiMasterService.java

示例6: asResolver

import org.apache.deltaspike.core.api.config.ConfigProperty; //导入依赖的package包/类
public <T> ConfigResolver.TypedResolver<T> asResolver(final String key, final String stringDefault,
                                                      final Type ipCls,
                                                      final Class<? extends ConfigResolver.Converter> converterType,
                                                      final String parameterizedBy,
                                                      final boolean projectStageAware, final boolean evaluate)
{
    final ConfigResolver.UntypedResolver<String> untypedResolver = ConfigResolver.resolve(key);
    final ConfigResolver.TypedResolver<T> resolver =
            (ConfigResolver.Converter.class == converterType ?
                    untypedResolver.as(Class.class.cast(ipCls)) :
                    untypedResolver.as(ipCls, BeanProvider.getContextualReference(converterType)))
                    .withCurrentProjectStage(projectStageAware);
    if (!ConfigProperty.NULL.equals(stringDefault))
    {
        resolver.withStringDefault(stringDefault);
    }
    if (!ConfigProperty.NULL.equals(parameterizedBy))
    {
        resolver.parameterizedBy(parameterizedBy);
    }
    return resolver.evaluateVariables(evaluate);
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:23,代码来源:BaseConfigPropertyProducer.java

示例7: produceUri

import org.apache.deltaspike.core.api.config.ConfigProperty; //导入依赖的package包/类
@Produces
@Dependent
@ConfigProperty(name = "unused")
public URI produceUri(InjectionPoint injectionPoint) {
	String configuredValue = getStringPropertyValue(injectionPoint);
	return URI.create(configuredValue);
}
 
开发者ID:dansiviter,项目名称:cito,代码行数:8,代码来源:UriConfigPropertyProducer.java

示例8: ProjectFileSystem

import org.apache.deltaspike.core.api.config.ConfigProperty; //导入依赖的package包/类
@Inject
public ProjectFileSystem(RepositoryCache repositoryCache,
                         @ConfigProperty(name = "PROJECT_FOLDER", defaultValue = "/tmp/fabric8-forge") String rootProjectFolder,
                         @ConfigProperty(name = "GIT_REMOTE_BRANCH_NAME", defaultValue = "origin") String remote,
                         @ConfigProperty(name = "JENKINSFILE_LIBRARY_GIT_REPOSITORY") String jenkinsfileLibraryGitUrl,
                         @ConfigProperty(name = "JENKINSFILE_LIBRARY_GIT_TAG") String jenkinsfileLibraryGitTag) {
    this.repositoryCache = repositoryCache;
    this.rootProjectFolder = rootProjectFolder;
    this.remote = remote;
    this.jenkinsfileLibraryGitUrl = jenkinsfileLibraryGitUrl;
    this.jenkinsfileLibraryGitTag = jenkinsfileLibraryGitTag;
    LOG.info("Using jenkins workflow library: " + this.jenkinsfileLibraryGitUrl);
    LOG.info("Using jenkins workflow library version: " + this.jenkinsfileLibraryGitTag);
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:15,代码来源:ProjectFileSystem.java

示例9: GitUserHelper

import org.apache.deltaspike.core.api.config.ConfigProperty; //导入依赖的package包/类
@Inject
public GitUserHelper(@ConfigProperty(name = "JENKINS_GOGS_USER") String gitUser,
                     @ConfigProperty(name = "JENKINS_GOGS_PASSWORD") String gitPassword,
                     KubernetesClient kubernetesClient) {
    this.gitUser = gitUser;
    this.gitPassword = gitPassword;
    this.kubernetesClient = kubernetesClient;
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:9,代码来源:GitUserHelper.java

示例10: hello

import org.apache.deltaspike.core.api.config.ConfigProperty; //导入依赖的package包/类
void hello(@Observes CamelContextStartedEvent event,
           // Configuration properties can be injected with @ConfigProperty
           @ConfigProperty(name = "message") String message,
           // Property placeholders in @Uri qualifier are also resolved
           @Uri("{{destination}}") ProducerTemplate producer) {
    producer.sendBody(message);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:8,代码来源:Application.java

示例11: testProperties

import org.apache.deltaspike.core.api.config.ConfigProperty; //导入依赖的package包/类
@Test
public void testProperties(@ConfigProperty(name = "destination") String destination,
                           @ConfigProperty(name = "message") String message) {
    assertThat("Property 'destination' value is incorrect!",
        destination,
        is(equalTo("direct:hello")));
    assertThat("Property 'message' value is incorrect!",
        message,
        is(equalTo("Hello")));
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:11,代码来源:CdiPropertiesTest.java

示例12: ChaosMonkey

import org.apache.deltaspike.core.api.config.ConfigProperty; //导入依赖的package包/类
@Inject
public ChaosMonkey(HubotNotifier notifier,
                   @ConfigProperty(name = "CHAOS_MONKEY_ROOM", defaultValue = DEFAULT_ROOM_EXPRESSION) String roomExpression,
                   @ConfigProperty(name = "CHAOS_MONKEY_INCLUDES") String includePatterns,
                   @ConfigProperty(name = "CHAOS_MONKEY_EXCLUDES", defaultValue = DEFAULT_EXCLUDES) String excludePatterns,
                   @ConfigProperty(name = "CHAOS_MONKEY_KILL_FREQUENCY_SECONDS", defaultValue = "60") int killFrequency) throws Exception {
    this.notifier = notifier;
    this.roomExpression = roomExpression;
    this.includePatterns = includePatterns;
    this.excludePatterns = excludePatterns;
    this.killFrequency = killFrequency;

    this.includeFilter = createTextFilter(includePatterns);
    this.excludeFilter = createTextFilter(excludePatterns);

    if (killFrequency < 1) {
        LOG.warn("Ignoring invalid killFrequency of " + killFrequency);
        killFrequency = 60;
    }

    LOG.info("Starting Chaos Monkey on Kubernetes namespace " + getNamespace() + " at " + kubernetes.getMasterUrl() + " with includes " + includePatterns + " excludes " + excludePatterns + " " + " kill frequency " + killFrequency + " seconds");

    notify("Chaos Monkey is starting in namespace " + getNamespace() + " with include patterns '" + includePatterns + "' exclude patterns '" + excludePatterns + "' and a kill frequency of " + killFrequency + " seconds. Here I come!");

    task = new TimerTask() {
        @Override
        public void run() {
            killPod();
        }
    };
    long period = killFrequency * 1000;
    long initialDelay = 1;
    timer.schedule(task, initialDelay, period);
    waitUntilCompleted();
}
 
开发者ID:fabric8io,项目名称:fabric8-devops,代码行数:36,代码来源:ChaosMonkey.java

示例13: GitCollector

import org.apache.deltaspike.core.api.config.ConfigProperty; //导入依赖的package包/类
@Inject
public GitCollector(@ConfigProperty(name = "GIT_COLLECTOR_WORK_DIRECTORY", defaultValue = "gitCollectorWorkDir") String cloneFolder,
                    @ConfigProperty(name = "GIT_COLLECTOR_SLEEP_PERIOD_MILLIS", defaultValue = "60000") long sleepPeriodMillis,
                    @ConfigProperty(name = "GIT_COLLECTOR_COMMIT_LIMIT_PER_POLL", defaultValue = "100") int commitLimitPerPoll,
                    GitElasticsearchClient elasticsearchClient) throws Exception {
    this.processor = new GitBuildConfigProcessor(elasticsearchClient, new File(cloneFolder), commitLimitPerPoll);
    this.collectors = new BuildConfigCollectors(processor, sleepPeriodMillis);
    this.watcher = new BuildConfigWatcher(collectors);
}
 
开发者ID:fabric8io,项目名称:fabric8-devops,代码行数:10,代码来源:GitCollector.java

示例14: GitElasticsearchClient

import org.apache.deltaspike.core.api.config.ConfigProperty; //导入依赖的package包/类
@Inject
public GitElasticsearchClient(@ConfigProperty(name = "ELASTICSEARCH_HOST", defaultValue = "http://elasticsearch") String elasticsearchHost,
                              @ConfigProperty(name = "ELASTICSEARCH_SERVICE_PORT") String elasticsearchPort,
                              @ConfigProperty(name = "GIT_COLLECTOR_USERNAME") String username,
                              @ConfigProperty(name = "GIT_COLLECTOR_PASSWORD") String password) {
    super(elasticsearchHost, elasticsearchPort, username, password);
}
 
开发者ID:fabric8io,项目名称:fabric8-devops,代码行数:8,代码来源:GitElasticsearchClient.java

示例15: Replicator

import org.apache.deltaspike.core.api.config.ConfigProperty; //导入依赖的package包/类
@Inject
public Replicator(CuratorFramework curator,
                  ApiMasterKubernetesModel model,
                  ProcessManager processManager,
                  @ConfigProperty(name = "REPLICATOR_POLL_TIME", defaultValue = "2000")
                  long pollTime) {
    this.curator = curator;
    this.model = model;
    this.processManager = processManager;
    this.pollTime = pollTime;

    System.out.println("Starting the replicator with poll time: " + pollTime);

    group = new ZooKeeperGroup<ReplicatorNode>(curator, KUBERNETES_REPLICATOR, ReplicatorNode.class);
    groupListener = new GroupListener<ReplicatorNode>() {

        @Override
        public void groupEvent(Group<ReplicatorNode> group, GroupEvent event) {
            onGroupEvent(group, event);
        }
    };
    group.add(groupListener);
    group.update(createState());
    group.start();

    enableTimer();
}
 
开发者ID:fabric8io,项目名称:jube,代码行数:28,代码来源:Replicator.java


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