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