コード例 #1
0
ファイル: StepPluginAdapter.java プロジェクト: rophy/rundeck
 @Override
 public Description getDescription() {
   if (plugin instanceof Describable) {
     final Describable desc = (Describable) plugin;
     return desc.getDescription();
   } else {
     return PluginAdapterUtility.buildDescription(plugin, DescriptionBuilder.builder());
   }
 }
コード例 #2
0
  private ResourceModelSource loadResourceModelSource(
      String type, Properties configuration, boolean useCache, String ident)
      throws ExecutionServiceException {

    final ResourceModelSourceService nodesSourceService = getResourceModelSourceService();
    configuration.put("project", projectConfig.getName());
    ResourceModelSource sourceForConfiguration =
        nodesSourceService.getSourceForConfiguration(type, configuration);

    if (useCache) {
      ResourceModelSourceFactory provider = nodesSourceService.providerOfType(type);
      String name = ident;
      if (provider instanceof Describable) {
        Describable desc = (Describable) provider;
        Description description = desc.getDescription();
        name = ident + " (" + description.getTitle() + ")";
      }
      return createCachingSource(sourceForConfiguration, ident, name);
    } else {
      return sourceForConfiguration;
    }
  }