Skip to content

Commit

Permalink
Implement ISPN-822
Browse files Browse the repository at this point in the history
Allow retrieving coordinator address from EmbeddedCacheManager
(and add a few docs in the process)
  • Loading branch information
tristantarrant authored and galderz committed Dec 8, 2010
1 parent 0f78cd1 commit ca6ed50
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
21 changes: 21 additions & 0 deletions core/src/main/java/org/infinispan/manager/DefaultCacheManager.java
Expand Up @@ -449,22 +449,43 @@ public <K, V> Cache<K, V> getCache(String cacheName) {
}
}

/**
* {@inheritDoc}
*/
public String getClusterName() {
return globalConfiguration.getClusterName();
}

/**
* {@inheritDoc}
*/
public List<Address> getMembers() {
if (globalComponentRegistry == null) return null;
Transport t = globalComponentRegistry.getComponent(Transport.class);
return t == null ? null : t.getMembers();
}

/**
* {@inheritDoc}
*/
public Address getAddress() {
if (globalComponentRegistry == null) return null;
Transport t = globalComponentRegistry.getComponent(Transport.class);
return t == null ? null : t.getAddress();
}

/**
* {@inheritDoc}
*/
public Address getCoordinator() {
if (globalComponentRegistry == null) return null;
Transport t = globalComponentRegistry.getComponent(Transport.class);
return t == null ? null : t.getCoordinator();
}

/**
* {@inheritDoc}
*/
public boolean isCoordinator() {
if (globalComponentRegistry == null) return false;
Transport t = globalComponentRegistry.getComponent(Transport.class);
Expand Down
Expand Up @@ -89,12 +89,29 @@ public interface EmbeddedCacheManager extends CacheContainer, Listenable {
*/
String getClusterName();

/**
* @return the addresses of all the members in the cluster.
*/
List<Address> getMembers();

/**
* @return the address of the local node
*/
Address getAddress();

/**
* @return the address of the cluster's coordinator
*/
Address getCoordinator();

/**
* @return whether the local node is the cluster's coordinator
*/
boolean isCoordinator();

/**
* @return the status of the cache manager
*/
ComponentStatus getStatus();

/**
Expand All @@ -111,7 +128,6 @@ public interface EmbeddedCacheManager extends CacheContainer, Listenable {
*/
Configuration getDefaultConfiguration();


/**
* If no named caches are registered, this method returns an empty set. The default cache is never included in this
* set of cache names.
Expand Down

0 comments on commit ca6ed50

Please sign in to comment.