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


Java EventDispatcher.addListener方法代码示例

本文整理汇总了Java中jetbrains.buildServer.util.EventDispatcher.addListener方法的典型用法代码示例。如果您正苦于以下问题:Java EventDispatcher.addListener方法的具体用法?Java EventDispatcher.addListener怎么用?Java EventDispatcher.addListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在jetbrains.buildServer.util.EventDispatcher的用法示例。


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

示例1: RunAsPropertiesExtension

import jetbrains.buildServer.util.EventDispatcher; //导入方法依赖的package包/类
public RunAsPropertiesExtension(
  @NotNull final EventDispatcher<AgentLifeCycleListener> events,
  @NotNull final ToolProvidersRegistry toolProvidersRegistry,
  @NotNull final BuildRunnerContextProvider buildRunnerContextProvider,
  @NotNull final CommandLineExecutor commandLineExecutor,
  @NotNull final ProfileParametersService profileParametersService,
  @NotNull final FileAccessCacheManager buildFileAccessCacheManager,
  @NotNull final Environment environment) {
  myToolProvidersRegistry = toolProvidersRegistry;
  myBuildRunnerContextProvider = buildRunnerContextProvider;
  myCommandLineExecutor = commandLineExecutor;
  myProfileParametersService = profileParametersService;
  myBuildFileAccessCacheManager = buildFileAccessCacheManager;
  myEnvironment = environment;
  events.addListener(this);
}
 
开发者ID:JetBrains,项目名称:teamcity-runas-plugin,代码行数:17,代码来源:RunAsPropertiesExtension.java

示例2: UserUIDAndGIDImpl

import jetbrains.buildServer.util.EventDispatcher; //导入方法依赖的package包/类
public UserUIDAndGIDImpl(@NotNull final EventDispatcher<AgentLifeCycleListener> events) {

    events.addListener(new AgentLifeCycleAdapter(){
      @Override
      public void afterAgentConfigurationLoaded(@NotNull final BuildAgent agent) {
        final BuildAgentConfiguration configuration = agent.getConfiguration();

        if (configuration.getConfigurationParameters().get(VMConstants.DOCKER_PROPERTY) == null) return;
        if (!configuration.getSystemInfo().isUnix()) return;
        if (configuration.getSystemInfo().isWindows()) return;
        if (configuration.getSystemInfo().isMac()) return;

        detectSidAndGid();
      }
    });
  }
 
开发者ID:jonnyzzz,项目名称:TeamCity.Virtual,代码行数:17,代码来源:UserUIDAndGIDImpl.java

示例3: ReportsFeature

import jetbrains.buildServer.util.EventDispatcher; //导入方法依赖的package包/类
public ReportsFeature(EventDispatcher<BuildServerListener> dispatcher, @NotNull ReportsDescriptor descriptor, @NotNull ReportsConstants constants) {
    this.editParametersUrl = descriptor.getFeaturePath();
    this.constants = constants;
    this.jsonFactory = JacksonFactory.getDefaultInstance();

    try {
        this.httpTransport = GoogleNetHttpTransport.newTrustedTransport();
    } catch (GeneralSecurityException | IOException e) {
        throw new RuntimeException(e);
    }

    if (dispatcher != null) {
        dispatcher.addListener(new BuildServerAdapter() {
            @Override
            public void buildFinished(SRunningBuild build) {
                handleBuildFinished(build);
            }
        });
    }
}
 
开发者ID:GoogleCloudPlatform,项目名称:appengine-tck,代码行数:21,代码来源:ReportsFeature.java

示例4: AgentTorrentsManager

import jetbrains.buildServer.util.EventDispatcher; //导入方法依赖的package包/类
public AgentTorrentsManager(@NotNull final EventDispatcher<AgentLifeCycleListener> eventDispatcher,
                            @NotNull final ArtifactCacheProvider artifactsCacheProvider,
                            @NotNull final CurrentBuildTracker currentBuildTracker,
                            @NotNull final TorrentConfiguration trackerManager,
                            @NotNull final AgentTorrentsSeeder torrentsSeeder,
                            @NotNull final TorrentFilesFactoryImpl torrentFilesFactory,
                            @NotNull final ArtifactsWatcher artifactsWatcher,
                            @NotNull final TorrentsDownloadStatistic torrentsDownloadStatistic,
                            @NotNull final LeechSettings leechSettings,
                            @NotNull final BuildAgentConfiguration agentConfiguration,
                            @NotNull final SeedSettings seedingSettings) throws Exception {
  myLeechSettings = leechSettings;
  mySeedingSettings = seedingSettings;
  eventDispatcher.addListener(this);
  myTrackerManager = trackerManager;
  myTorrentsSeeder = torrentsSeeder;
  myTorrentsDownloadStatistic = torrentsDownloadStatistic;
  artifactsCacheProvider.addListener(new TorrentArtifactCacheListener(
          torrentsSeeder.getTorrentsSeeder(),
          currentBuildTracker,
          trackerManager,
          this,
          torrentFilesFactory,
          artifactsWatcher,
          agentConfiguration));
}
 
开发者ID:JetBrains,项目名称:teamcity-torrent-plugin,代码行数:27,代码来源:AgentTorrentsManager.java

示例5: AgentConfiguration

import jetbrains.buildServer.util.EventDispatcher; //导入方法依赖的package包/类
public AgentConfiguration(@NotNull final EventDispatcher<AgentLifeCycleListener> dispatcher,
                          @NotNull final BuildAgentConfiguration buildAgentConfiguration,
                          @NotNull CurrentBuildTracker currentBuildTracker) {
  myCurrentBuildTracker = currentBuildTracker;
  myBuildAgentConfiguration = buildAgentConfiguration;
  dispatcher.addListener(new AgentLifeCycleAdapter() {
    @Override
    public void afterAgentConfigurationLoaded(@NotNull BuildAgent agent) {
      String serverUrl = agent.getConfiguration().getServerUrl();
      if (StringUtil.isNotEmpty(serverUrl)) {
        myXmlRpcTarget = XmlRpcFactory.getInstance().create(serverUrl, "TeamCity Agent", 30000, false);
      } else {
        Loggers.AGENT.error("Cannot create RPC instance for torrent plugin: server url is not specified");
      }
    }
  });
}
 
开发者ID:JetBrains,项目名称:teamcity-torrent-plugin,代码行数:18,代码来源:AgentConfiguration.java

示例6: PowerShellInfoProvider

import jetbrains.buildServer.util.EventDispatcher; //导入方法依赖的package包/类
public PowerShellInfoProvider(@NotNull final BuildAgentConfiguration config,
                              @NotNull final EventDispatcher<AgentLifeCycleListener> events,
                              @NotNull final List<PowerShellDetector> detectors) {
  myConfig = config;
  events.addListener(new AgentLifeCycleAdapter(){

    @Override
    public void afterAgentConfigurationLoaded(@NotNull BuildAgent agent) {
      registerDetectedPowerShells(detectors, new DetectionContext(agent.getConfiguration()));
    }
  });
}
 
开发者ID:JetBrains,项目名称:teamcity-powershell,代码行数:13,代码来源:PowerShellInfoProvider.java

示例7: AutotoolsToolProvider

import jetbrains.buildServer.util.EventDispatcher; //导入方法依赖的package包/类
public AutotoolsToolProvider(@NotNull final ToolProvidersRegistry toolProvidersRegistry,
                             @NotNull final EventDispatcher<AgentLifeCycleListener> eventDispatcher, @NotNull final String toolName, @NotNull final String versionArg){
  toolProvidersRegistry.registerToolProvider(this);
  eventDispatcher.addListener(this);
  myVersionArg = versionArg;
  myToolName = toolName;
}
 
开发者ID:unix-junkie,项目名称:teamcity-autotools-plugin,代码行数:8,代码来源:AutotoolsToolProvider.java

示例8: HelmAgentConfigurationProvider

import jetbrains.buildServer.util.EventDispatcher; //导入方法依赖的package包/类
public HelmAgentConfigurationProvider(@NotNull EventDispatcher<AgentLifeCycleListener> agentEvents) {
    agentEvents.addListener(new AgentLifeCycleAdapter(){
        @Override
        public void beforeAgentConfigurationLoaded(@NotNull BuildAgent agent) {
            File defaultHelmLocation = new File("/usr/local/bin/helm");
            if(defaultHelmLocation.exists()){
                agent.getConfiguration().addConfigurationParameter(HELM_PATH_CONFIG_PARAM, defaultHelmLocation.getAbsolutePath());
            }
            super.beforeAgentConfigurationLoaded(agent);
        }
    });
}
 
开发者ID:JetBrains,项目名称:teamcity-kubernetes-plugin,代码行数:13,代码来源:HelmAgentConfigurationProvider.java

示例9: KubeAgentConfigurationProvider

import jetbrains.buildServer.util.EventDispatcher; //导入方法依赖的package包/类
public KubeAgentConfigurationProvider(@NotNull EventDispatcher<AgentLifeCycleListener> agentEvents,
                                      @NotNull BuildAgentConfigurationEx agentConfigurationEx) {
    myAgentConfigurationEx = agentConfigurationEx;
    agentEvents.addListener(new AgentLifeCycleAdapter(){
        @Override
        public void afterAgentConfigurationLoaded(@NotNull BuildAgent agent) {
            super.afterAgentConfigurationLoaded(agent);
            appendKubeSpecificConfiguration();
        }
    });
}
 
开发者ID:JetBrains,项目名称:teamcity-kubernetes-plugin,代码行数:12,代码来源:KubeAgentConfigurationProvider.java

示例10: HubServerListener

import jetbrains.buildServer.util.EventDispatcher; //导入方法依赖的package包/类
public HubServerListener(@NotNull final EventDispatcher<BuildServerListener> dispatcher,
        @NotNull final SBuildServer server, @NotNull final ServerPaths serverPaths) {
    this.server = server;

    dispatcher.addListener(this);

    configPersistenceManager = new ServerHubConfigPersistenceManager(serverPaths);
}
 
开发者ID:blackducksoftware,项目名称:hub-teamcity,代码行数:9,代码来源:HubServerListener.java

示例11: ContainerCloudAgentPropertiesSetter

import jetbrains.buildServer.util.EventDispatcher; //导入方法依赖的package包/类
public ContainerCloudAgentPropertiesSetter(final BuildAgentConfigurationEx agentConfiguration,
                                           @NotNull EventDispatcher<AgentLifeCycleListener> events) {
    LOG.info("Created ContainerCloudAgentPropertiesSetter");
    this.agentConfiguration = agentConfiguration;
    this.events = events;

    events.addListener(new AgentLifeCycleAdapter() {
        @Override
        public void afterAgentConfigurationLoaded(@NotNull BuildAgent buildAgent) {
            LOG.info("ContainerCloudAgentPropertiesSetter: Setting terminate after build flag");
            agentConfiguration.addConfigurationParameter(CloudConstants.AGENT_TERMINATE_AFTER_BUILD, "true");
        }
    });
}
 
开发者ID:carlpett,项目名称:teamcity-container-cloud,代码行数:15,代码来源:ContainerCloudAgentPropertiesSetter.java

示例12: ServerListener

import jetbrains.buildServer.util.EventDispatcher; //导入方法依赖的package包/类
public ServerListener(@NotNull final EventDispatcher<BuildServerListener> dispatcher,
        @NotNull final SBuildServer server, @NotNull ServerPaths serverPaths) {
    this.server = server;

    dispatcher.addListener(this);

    configPersistenceManager = new ServerConfigPersistenceManager(serverPaths);
}
 
开发者ID:automate-website,项目名称:teamcity-plugin,代码行数:9,代码来源:ServerListener.java

示例13: DOAgentPropsUpdater

import jetbrains.buildServer.util.EventDispatcher; //导入方法依赖的package包/类
public DOAgentPropsUpdater(final BuildAgentConfiguration agentConfiguration,
                           @NotNull EventDispatcher<AgentLifeCycleListener> events) {
    LOG.info("DO plugin initializing...");
    agentConfig = agentConfiguration;

    events.addListener(new AgentLifeCycleAdapter() {
        @Override
        public void afterAgentConfigurationLoaded(@NotNull final BuildAgent agent) {
            final String ipv4 = getIPv4();
            agentConfig.addConfigurationParameter(DOConfigConstants.AGENT_IPV4_PROP_KEY, ipv4);
            agentConfig.addConfigurationParameter(DOConfigConstants.IDENTITY_KEY, DOConfigConstants.IDENTITY_VALUE);
        }
    });
}
 
开发者ID:beolnix,项目名称:tcdop,代码行数:15,代码来源:DOAgentPropsUpdater.java

示例14: BuildStartedListener

import jetbrains.buildServer.util.EventDispatcher; //导入方法依赖的package包/类
public BuildStartedListener(EventDispatcher<AgentLifeCycleListener> listener)
{
    listener.addListener(new AgentLifeCycleAdapter()
    {
        /**
         * Store the JSON-string parameters (if defined) to the corresponding JSON files.
         *
         * @param build the build whose sources are being updated
         */
        @Override
        public void sourcesUpdated(@NotNull AgentRunningBuild build) {
            Loggers.AGENT.debug("[SinCity] sourcesUpdated(" + build + ") triggered");
            super.sourcesUpdated(build);
            new ParamsToFiles(build).storeIfSet();
        }

        /**
         * Store the JSON-string parameters (if defined) to the corresponding JSON files.
         *
         * @param runner the runner that is about to start
         */
        @Override
        public void beforeRunnerStart(@NotNull BuildRunnerContext runner) {
            Loggers.AGENT.debug("[SinCity] beforeRunnerStart(" + runner.getBuild() + ", " + runner.getName() + ") triggered");
            super.beforeRunnerStart(runner);
            new ParamsToFiles(runner.getBuild()).storeIfSet();
        }
    });
}
 
开发者ID:sferencik,项目名称:SinCity,代码行数:30,代码来源:BuildStartedListener.java

示例15: CacheManagerImpl

import jetbrains.buildServer.util.EventDispatcher; //导入方法依赖的package包/类
public CacheManagerImpl(MetricRegistry metricRegistry, BuildTriggerProperties buildTriggerProperties, @NotNull EventDispatcher<BuildServerListener> eventDispatcher) {
    this.buildTriggerProperties = buildTriggerProperties;
    this.ehCacheManager = net.sf.ehcache.CacheManager.newInstance();
    eventDispatcher.addListener(new BuildServerAdapter() {
        public void serverShutdown() {
            LOG.debug("Server shutdown initiated - shutting down ehCacheManager");
            ehCacheManager.shutdown();
            cacheAlive = false;
            LOG.debug("Server shutdown initiated - ehCacheManager shutdown complete");
        }
    });
    this.cacheAlive = true;
    this.metricRegistry = metricRegistry;
    this.caches = new HashMap<>();
}
 
开发者ID:matt-richardson,项目名称:teamcity-octopus-build-trigger-plugin,代码行数:16,代码来源:CacheManagerImpl.java


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