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


Java EventDispatcher类代码示例

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


EventDispatcher类属于jetbrains.buildServer.util包,在下文中一共展示了EventDispatcher类的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: 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


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