本文整理汇总了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);
}
示例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();
}
});
}
示例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);
}
});
}
}
示例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));
}
示例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");
}
}
});
}
示例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()));
}
});
}
示例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;
}
示例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);
}
});
}
示例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();
}
});
}
示例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);
}
示例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");
}
});
}
示例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);
}
示例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);
}
});
}
示例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();
}
});
}
示例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<>();
}