本文整理汇总了Java中jenkins.model.Jenkins.getDescriptor方法的典型用法代码示例。如果您正苦于以下问题:Java Jenkins.getDescriptor方法的具体用法?Java Jenkins.getDescriptor怎么用?Java Jenkins.getDescriptor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jenkins.model.Jenkins
的用法示例。
在下文中一共展示了Jenkins.getDescriptor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateFromGlobalConfiguration
import jenkins.model.Jenkins; //导入方法依赖的package包/类
private void updateFromGlobalConfiguration() {
Jenkins jenkins = Jenkins.getInstance();
if (jenkins != null) {
GlobalConsulConfig.DescriptorImpl globalDescriptor = (GlobalConsulConfig.DescriptorImpl)
jenkins.getDescriptor(GlobalConsulConfig.class);
if (globalDescriptor != null) {
this.hostUrl = globalDescriptor.getConsulHostUrl();
this.apiUri = globalDescriptor.getConsulApiUri();
this.aclToken = globalDescriptor.getConsulAclToken();
this.timeoutConnection = globalDescriptor.getConsulTimeoutConnection();
this.timeoutResponse = globalDescriptor.getConsulTimeoutResponse();
this.debugMode = globalDescriptor.getConsulDebugMode();
} else {
LOGGER.warning("Could not load global settings.");
}
} else {
LOGGER.warning("Could not load global settings.");
}
}
示例2: updateFromGlobalConfiguration
import jenkins.model.Jenkins; //导入方法依赖的package包/类
/**
* Loads global settings
*/
public void updateFromGlobalConfiguration() {
Jenkins jenkins = Jenkins.getInstance();
if (jenkins != null) {
GlobalConsulConfig.DescriptorImpl globalDescriptor = (GlobalConsulConfig.DescriptorImpl)
jenkins.getDescriptor(GlobalConsulConfig.class);
if (globalDescriptor != null) {
this.hostUrl = globalDescriptor.getConsulHostUrl();
this.apiUri = globalDescriptor.getConsulApiUri();
this.aclToken = globalDescriptor.getConsulAclToken();
this.timeoutConnect = globalDescriptor.getConsulTimeoutConnection();
this.timeoutResponse = globalDescriptor.getConsulTimeoutResponse();
this.debugMode = globalDescriptor.getConsulDebugMode();
} else {
LOGGER.warning("Could not load global settings.");
}
} else {
LOGGER.warning("Could not load global settings.");
}
}
示例3: setUpDiskPools
import jenkins.model.Jenkins; //导入方法依赖的package包/类
private static void setUpDiskPools(Jenkins jenkins, List<DiskPool> diskPools) {
ExwsAllocateStep.DescriptorImpl descriptor = (ExwsAllocateStep.DescriptorImpl) jenkins.getDescriptor(ExwsAllocateStep.class);
Field diskPoolsField = ReflectionUtils.findField(ExwsAllocateStep.DescriptorImpl.class, "diskPools");
diskPoolsField.setAccessible(true);
ReflectionUtils.setField(diskPoolsField, descriptor, diskPools);
}