Tabnine Logo
MessageBusClient.forProject
Code IndexAdd Tabnine to your IDE (free)

How to use
forProject
method
in
net.groboclown.p4.server.api.messagebus.MessageBusClient

Best Java code snippets using net.groboclown.p4.server.api.messagebus.MessageBusClient.forProject (Showing top 14 results out of 315)

origin: groboclown/p4ic4idea

protected ProjectConfigRegistry(@NotNull Project project) {
  this.project = project;
  this.projectBusClient = MessageBusClient.forProject(project, this);
  this.applicationBusClient = MessageBusClient.forApplication(this);
  Disposer.register(project, this);
}
origin: groboclown/p4ic4idea

@Override
public void initComponent() {
  MessageBusClient.ProjectClient projectClient = MessageBusClient.forProject(project, project);
  FileCacheUpdatedMessage.addListener(projectClient, this, (e) -> {
    refreshFileView(e.getFiles());
  });
}
origin: groboclown/p4ic4idea

@Override
public void projectOpened(Project project) {
  MessageBusClient.ProjectClient projectMbClient =
      MessageBusClient.forProject(project, InvalidPasswordMonitorComponent.this);
  ClientConfigAddedMessage.addListener(projectMbClient, this,
      e -> forgetLoginProblem(e.getClientConfig().getServerConfig()));
  ClientConfigRemovedMessage.addListener(projectMbClient, this,
      event -> forgetLoginProblem(event.getClientConfig().getServerConfig()));
}
origin: groboclown/p4ic4idea

public CacheStoreUpdateListener(@NotNull Project project,
    @NotNull ProjectCacheStore cache, @NotNull Disposable disposableParent) {
  this.project = project;
  this.cache = cache;
  // TODO should be an argument, rather than the cache directly?
  this.pendingCache = new CachePendingActionHandlerImpl(cache);
  MessageBusClient.ApplicationClient appClient = MessageBusClient.forApplication(disposableParent);
  MessageBusClient.ProjectClient projectClient = MessageBusClient.forProject(project, disposableParent);
  CacheListener listener = new CacheListener();
  String cacheId = AbstractCacheMessage.createCacheId(project, CacheStoreUpdateListener.class);
  ClientActionMessage.addListener(appClient, cacheId, listener);
  // TODO this causes the event listener to be fired twice.
  // Somewhere, this ClientOpenCacheMessage call invokes the exact same listener
  // method twice.  Either the listener is registered twice, or the event object
  // is being passed to send() twice.
  ClientOpenCacheMessage.addListener(appClient, cacheId, listener);
  DescribeChangelistCacheMessage.addListener(appClient, cacheId, listener);
  FileActionMessage.addListener(appClient, cacheId, listener);
  JobCacheMessage.addListener(appClient, cacheId, listener);
  JobSpecCacheMessage.addListener(appClient, cacheId, listener);
  ListClientsForUserCacheMessage.addListener(appClient, cacheId, listener);
  ServerActionCacheMessage.addListener(appClient, cacheId, listener);
  ClientConfigRemovedMessage.addListener(projectClient, cacheId, listener);
}
origin: groboclown/p4ic4idea

MessageBusClient.ProjectClient projClient = MessageBusClient.forProject(project, this);
ClientConfigAddedMessage.addListener(projClient, this, (e) -> clientConfigs.put(e.getRoot(), e.getClientConfig()));
ClientConfigRemovedMessage.addListener(projClient, this,
origin: groboclown/p4ic4idea

@Test
void removeClientConfig_registered() {
  ProjectConfigRegistry registry = new ProjectConfigRegistryImpl(idea.getMockProject());
  final List<ClientConfig> added = new ArrayList<>();
  final List<ClientConfig> removed = new ArrayList<>();
  MessageBusClient.ProjectClient client = MessageBusClient.forProject(idea.getMockProject(), idea.getMockProject());
  ClientConfigAddedMessage.addListener(client, this, e -> added.add(e.getClientConfig()));
  ClientConfigRemovedMessage.addListener(client, this, (e) -> removed.add(e.getClientConfig()));
  ClientConfig config = createClientConfig();
  VirtualFile root = MockVirtualFileSystem.createRoot();
  registry.addClientConfig(config, root);
  assertEquals(1, added.size());
  added.clear();
  registry.removeClientConfigAt(root);
  assertEquals(0, added.size());
  assertEquals(1, removed.size());
  assertSame(config, removed.get(0));
  ClientConfig fetchedState = registry.getRegisteredClientConfigState(config.getClientServerRef());
  assertNull(fetchedState);
}
origin: groboclown/p4ic4idea

MessageBusClient.ProjectClient mbus = MessageBusClient.forProject(project, this);
origin: groboclown/p4ic4idea

@Test
void projectClosed() {
  ProjectConfigRegistry registry = new ProjectConfigRegistryImpl(idea.getMockProject());
  final List<ClientConfig> added = new ArrayList<>();
  final List<ClientConfig> removed = new ArrayList<>();
  MessageBusClient.ProjectClient client = MessageBusClient.forProject(idea.getMockProject(), idea.getMockProject());
  ClientConfigAddedMessage.addListener(client, this, e -> added.add(e.getClientConfig()));
  ClientConfigRemovedMessage.addListener(client, this, (e) -> removed.add(e.getClientConfig()));
  ClientConfig config = createClientConfig();
  VirtualFile root = MockVirtualFileSystem.createRoot();
  registry.addClientConfig(config, root);
  assertEquals(1, added.size());
  added.clear();
  registry.projectClosed();
  assertEquals(0, added.size());
  assertEquals(1, removed.size());
  assertSame(config, removed.get(0));
  ClientConfig fetchedState = registry.getRegisteredClientConfigState(config.getClientServerRef());
  assertNull(fetchedState);
  // closing the project should turn off further registration
  removed.clear();
  assertThrows(Throwable.class, () -> registry.addClientConfig(config, root));
  assertEquals(0, added.size());
  assertThrows(Throwable.class, () -> registry.removeClientConfigAt(root));
  assertEquals(0, removed.size());
}
origin: groboclown/p4ic4idea

@Test
void disposeComponent() {
  ProjectConfigRegistry registry = new ProjectConfigRegistryImpl(idea.getMockProject());
  final List<ClientConfig> added = new ArrayList<>();
  final List<ClientConfig> removed = new ArrayList<>();
  MessageBusClient.ProjectClient client = MessageBusClient.forProject(idea.getMockProject(), idea.getMockProject());
  ClientConfigAddedMessage.addListener(client, this, e -> added.add(e.getClientConfig()));
  ClientConfigRemovedMessage.addListener(client, this, (e) -> removed.add(e.getClientConfig()));
  ClientConfig config = createClientConfig();
  VirtualFile root = MockVirtualFileSystem.createRoot();
  registry.addClientConfig(config, root);
  assertEquals(1, added.size());
  added.clear();
  registry.disposeComponent();
  assertEquals(0, added.size());
  assertEquals(1, removed.size());
  assertSame(config, removed.get(0));
  ClientConfig fetchedState =
      registry.getRegisteredClientConfigState(config.getClientServerRef());
  assertNull(fetchedState);
  // closing the project should turn off further registration
  removed.clear();
  assertThrows(Throwable.class, () -> registry.addClientConfig(config, root));
  assertEquals(0, added.size());
  assertThrows(Throwable.class, () -> registry.removeClientConfigAt(root));
  assertEquals(0, removed.size());
}
origin: groboclown/p4ic4idea

@Test
void addClientConfig_new() {
  ProjectConfigRegistry registry = new ProjectConfigRegistryImpl(idea.getMockProject());
  final List<ClientConfig> added = new ArrayList<>();
  MessageBusClient.ProjectClient client = MessageBusClient.forProject(idea.getMockProject(), idea.getMockProject());
  ClientConfigAddedMessage.addListener(client, this, e -> added.add(e.getClientConfig()));
  ClientConfigRemovedMessage.addListener(client, this, (event) -> fail("incorrectly called remove"));
  ClientConfig config = createClientConfig();
  VirtualFile root = MockVirtualFileSystem.createRoot();
  registry.addClientConfig(config, root);
  assertEquals(1, added.size());
  assertSame(config, added.get(0));
  ClientConfig fetchedState =
      registry.getRegisteredClientConfigState(config.getClientServerRef());
  assertNotNull(fetchedState);
  assertSame(config, fetchedState);
}
origin: groboclown/p4ic4idea

@Test
void removeClientConfig_notRegistered() {
  ProjectConfigRegistry registry = new ProjectConfigRegistryImpl(idea.getMockProject());
  final List<ClientConfig> removed = new ArrayList<>();
  MessageBusClient.ProjectClient client = MessageBusClient.forProject(idea.getMockProject(), idea.getMockProject());
  ClientConfigAddedMessage.addListener(client, this,
      e -> fail("should not have added anything"));
  ClientConfigRemovedMessage.addListener(client, this, (e) -> removed.add(e.getClientConfig()));
  ClientConfig config = createClientConfig();
  registry.removeClientConfigAt(MockVirtualFileSystem.createRoot());
  assertEquals(0, removed.size());
  ClientConfig fetchedState = registry.getRegisteredClientConfigState(config.getClientServerRef());
  assertNull(fetchedState);
}
origin: groboclown/p4ic4idea

final List<ClientConfig> added = new ArrayList<>();
final List<ClientConfig> removed = new ArrayList<>();
MessageBusClient.ProjectClient client = MessageBusClient.forProject(idea.getMockProject(), idea.getMockProject());
ClientConfigAddedMessage.addListener(client, this, e -> added.add(e.getClientConfig()));
ClientConfigRemovedMessage.addListener(client, this, (e) -> removed.add(e.getClientConfig()));
origin: groboclown/p4ic4idea

MessageBusClient.ProjectClient clientBus = MessageBusClient.forProject(project, parentDisposable);
origin: groboclown/p4ic4idea

public void initComponent() {
  MessageBusClient.ApplicationClient appClient = MessageBusClient.forApplication(this);
  MessageBusClient.ProjectClient projClient = MessageBusClient.forProject(project, this);
  CancellationMessage.addListener(projClient, this, new CancellationMessage.Listener() {
    @Override
net.groboclown.p4.server.api.messagebusMessageBusClientforProject

Popular methods of MessageBusClient

  • forApplication

Popular in Java

  • Creating JSON documents from java classes using gson
  • compareTo (BigDecimal)
  • onRequestPermissionsResult (Fragment)
  • getApplicationContext (Context)
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Option (scala)
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now