.getLogger(ClusterManager.class);
private DefaultCacheManager cm;
GossipRouter gossiper;
- private HashSet roleChangeListeners;
+ private HashSet<IListenRoleChange> roleChangeListeners;
private ViewChangedListener cacheManagerListener;
private static String loopbackAddress = "127.0.0.1";
if (supernodes.hasMoreTokens()) {
// Populate the list of my addresses
try {
- Enumeration e = NetworkInterface.getNetworkInterfaces();
+ Enumeration<NetworkInterface> e = NetworkInterface.getNetworkInterfaces();
while (e.hasMoreElements()) {
NetworkInterface n = (NetworkInterface) e.nextElement();
- Enumeration ee = n.getInetAddresses();
+ Enumeration<InetAddress> ee = n.getInetAddresses();
while (ee.hasMoreElements()) {
InetAddress i = (InetAddress) ee.nextElement();
myAddresses.add(i);
String cacheName, Set<cacheMode> cMode) throws CacheExistException,
CacheConfigException {
EmbeddedCacheManager manager = this.cm;
- Cache c;
+ Cache<Object,Object> c;
String realCacheName = "{" + containerName + "}_{" + cacheName + "}";
if (manager == null) {
return null;
@Override
public ConcurrentMap<?, ?> getCache(String containerName, String cacheName) {
EmbeddedCacheManager manager = this.cm;
- Cache c;
+ Cache<Object,Object> c;
String realCacheName = "{" + containerName + "}_{" + cacheName + "}";
if (manager == null) {
return null;
@Override
public Set<String> getCacheList(String containerName) {
- Set<String> perContainerCaches = new HashSet();
+ Set<String> perContainerCaches = new HashSet<String>();
EmbeddedCacheManager manager = this.cm;
if (manager == null) {
return null;
public void addListener(String containerName, String cacheName,
IGetUpdates<?, ?> u) throws CacheListenerAddException {
EmbeddedCacheManager manager = this.cm;
- Cache c;
+ Cache<Object,Object> c;
String realCacheName = "{" + containerName + "}_{" + cacheName + "}";
if (manager == null) {
return;
c = manager.getCache(realCacheName);
CacheListenerContainer cl = new CacheListenerContainer(u,
containerName, cacheName);
- if (cl == null) {
- throw new CacheListenerAddException();
- }
c.addListener(cl);
}
public Set<IGetUpdates<?, ?>> getListeners(String containerName,
String cacheName) {
EmbeddedCacheManager manager = this.cm;
- Cache c;
+ Cache<Object,Object> c;
String realCacheName = "{" + containerName + "}_{" + cacheName + "}";
if (manager == null) {
return null;
}
c = manager.getCache(realCacheName);
- Set<IGetUpdates<?, ?>> res = new HashSet();
+ Set<IGetUpdates<?, ?>> res = new HashSet<IGetUpdates<?, ?>>();
Set<Object> listeners = c.getListeners();
for (Object listener : listeners) {
if (listener instanceof CacheListenerContainer) {
public void removeListener(String containerName, String cacheName,
IGetUpdates<?, ?> u) {
EmbeddedCacheManager manager = this.cm;
- Cache c;
+ Cache<Object,Object> c;
String realCacheName = "{" + containerName + "}_{" + cacheName + "}";
if (manager == null) {
return;
EmbeddedCacheManager manager = this.cm;
if (manager == null) {
// In case we cannot fetch the information, lets assume we
- // are standby, so to have less responsability.
+ // are standby, so to have less responsibility.
return true;
}
return (!manager.isCoordinator());
EmbeddedCacheManager manager = this.cm;
if ((manager == null) || (a == null)) {
// In case we cannot fetch the information, lets assume we
- // are standby, so to have less responsability.
+ // are standby, so to have less responsibility.
return null;
}
Transport t = manager.getTransport();
EmbeddedCacheManager manager = this.cm;
if (manager == null) {
// In case we cannot fetch the information, lets assume we
- // are standby, so to have less responsability.
+ // are standby, so to have less responsibility.
return null;
}
EmbeddedCacheManager manager = this.cm;
if (manager == null) {
// In case we cannot fetch the information, lets assume we
- // are standby, so to have less responsability.
+ // are standby, so to have less responsibility.
throw new ListenRoleChangeAddException();
}
if (this.roleChangeListeners == null) {
- this.roleChangeListeners = new HashSet();
+ this.roleChangeListeners = new HashSet<IListenRoleChange>();
this.cacheManagerListener = new ViewChangedListener(
this.roleChangeListeners);
manager.addListener(this.cacheManagerListener);
EmbeddedCacheManager manager = this.cm;
if (manager == null) {
// In case we cannot fetch the information, lets assume we
- // are standby, so to have less responsability.
+ // are standby, so to have less responsibility.
return;
}