• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java EventDispatcher类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



EventDispatcher类属于jetbrains.buildServer.util包,在下文中一共展示了EventDispatcher类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: setUp

import jetbrains.buildServer.util.EventDispatcher; //导入依赖的package包/类
@BeforeMethod
  @Override
  protected void setUp() throws Exception {
    super.setUp();
//    setPartialMessagesChecker();
    new TeamCityProperties() {{
      setModel(new BasePropertiesModel() {
        @NotNull
        @Override
        public Map<String, String> getUserDefinedProperties() {
          return CollectionsUtil.asMap("teamcity.agent.build.messages.translators.enabled", "true");
        }
      });
    }};
    myEventDispatcher = EventDispatcher.create(AgentLifeCycleListener.class);
    myCurrentBuildTracker = new CurrentBuildTrackerImpl(myEventDispatcher);
    myTranslatorsRegistry = new TranslatorsRegistryImpl();
    myParserLoader = new ParserLoaderImpl(myCurrentBuildTracker);
    myParsersRegistry = new ParsersRegistryImpl(myTranslatorsRegistry, myParserLoader);
  }
 
开发者ID:JetBrains,项目名称:teamcity-process-output-parsers,代码行数:21,代码来源:ParsersRegistryImplTest.java


示例3: 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


示例4: 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


示例5: 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


示例6: 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


示例7: setUp

import jetbrains.buildServer.util.EventDispatcher; //导入依赖的package包/类
@BeforeMethod
public void setUp() throws Exception {

  Mockery m = new Mockery();
  final XmlRpcHandlerManager rpcHandlerManager = m.mock(XmlRpcHandlerManager.class);
  final ExecutorServices executorServices = m.mock(ExecutorServices.class);
  myExecutorService = Executors.newScheduledThreadPool(4);
  final RootUrlHolder rootUrlHolder = m.mock(RootUrlHolder.class);
  m.checking(new Expectations() {{
    allowing(rpcHandlerManager).addHandler(with(any(String.class)), with(any(Object.class)));
    allowing(executorServices).getNormalExecutorService(); will(returnValue(myExecutorService));
    allowing(rootUrlHolder).getRootUrl(); will(returnValue("http://localhost:8111"));
  }});
  myTorrentTrackerManager = new TorrentTrackerManager(
          new TorrentConfigurator(new ServerPaths("/tmp"), rootUrlHolder, rpcHandlerManager),
          executorServices,
          new EventDispatcher<BuildServerListener>(BuildServerListener.class) {
          },
          m.mock(AddressChecker.class)
  );

}
 
开发者ID:JetBrains,项目名称:teamcity-torrent-plugin,代码行数:23,代码来源:TorrentTrackerManagerTest.java


示例8: 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


示例9: setUp

import jetbrains.buildServer.util.EventDispatcher; //导入依赖的package包/类
@Override
@BeforeMethod
@SuppressWarnings("unchecked")
public void setUp() throws Exception {
  super.setUp();
  m = new Mockery() {{
    setImposteriser(ClassImposteriser.INSTANCE);
  }};
  myEvents = m.mock(EventDispatcher.class);
  myConfig = m.mock(BuildAgentConfiguration.class);
  m.checking(new Expectations() {{
    allowing(myEvents);
  }});
  myProvider = new PowerShellInfoProvider(myConfig, myEvents, Collections.<PowerShellDetector>emptyList());
}
 
开发者ID:JetBrains,项目名称:teamcity-powershell,代码行数:16,代码来源:PowerShellInfoProviderTest.java


示例10: 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


示例11: 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


示例12: 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


示例13: 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


示例14: 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


示例15: 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


示例16: 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


示例17: 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


示例18: 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


示例19: UpdateChecker

import jetbrains.buildServer.util.EventDispatcher; //导入依赖的package包/类
public UpdateChecker(@NotNull final PluginDescriptor pluginDescriptor,
                     CacheManager cacheManager,
                     MetricRegistry metricRegistry,
                     BuildTriggerProperties buildTriggerProperties,
                     @NotNull EventDispatcher<BuildServerListener> eventDispatcher) throws NoSuchAlgorithmException, KeyStoreException, KeyManagementException, ProjectNotFoundException, InvalidCacheConfigurationException, IOException, UnexpectedResponseCodeException, ParseException, URISyntaxException, InvalidOctopusUrlException, InvalidOctopusApiKeyException {
    this.eventDispatcher = eventDispatcher;
    HttpContentProviderFactory contentProviderFactory = new HttpContentProviderFactory(null, null,
            buildTriggerProperties, cacheManager, metricRegistry);
    HttpContentProvider contentProvider = contentProviderFactory.getContentProvider();
    this.pluginDescriptor = pluginDescriptor;
    this.httpContentProvider = contentProvider;
    this.buildTriggerProperties = buildTriggerProperties;
    setupScheduledTask();
}
 
开发者ID:matt-richardson,项目名称:teamcity-octopus-build-trigger-plugin,代码行数:15,代码来源:UpdateChecker.java


示例20: HighlighterPageExtension

import jetbrains.buildServer.util.EventDispatcher; //导入依赖的package包/类
public HighlighterPageExtension(@NotNull PagePlaces pagePlaces, @NotNull SBuildServer sBuildServer,
                                EventDispatcher<BuildServerListener> eventDispatcher)
{
    super(pagePlaces, BUILD_RESULTS_FRAGMENT, PLUGIN_ID, "web/highlighter.jsp");
    this.sBuildServer = sBuildServer;
    this.eventDispatcher = eventDispatcher;
}
 
开发者ID:jpfeffer,项目名称:teamcity-highlighter,代码行数:8,代码来源:HighlighterPageExtension.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java XCompositeNode类代码示例发布时间:2022-05-21
下一篇:
Java RuntimeMetaData类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap