com.alachisoft.ncache.client.internal.asynctasks.ClientConnectivityChangeTask Maven / Gradle / Ivy
package com.alachisoft.ncache.client.internal.asynctasks;
import Alachisoft.NCache.Common.Threading.AsyncProcessor;
import com.alachisoft.ncache.client.ClientInfo;
import com.alachisoft.ncache.client.ConnectivityStatus;
import com.alachisoft.ncache.client.internal.communication.Broker;
import com.alachisoft.ncache.runtime.exceptions.CacheException;
public class ClientConnectivityChangeTask implements AsyncProcessor.IAsyncTask {
Broker _parent;
private String _cacheId;
private ClientInfo _clientInfo;
private ConnectivityStatus _status;
public ClientConnectivityChangeTask(Broker broker, String cacheId, ClientInfo clientInfo, ConnectivityStatus status) {
_cacheId = cacheId;
_clientInfo = clientInfo;
_status = status;
_parent = broker;
}
@Override
public void Process() throws CacheException {
try {
if (_parent != null)
_parent.getCache().getEventsListener().OnClientConnectivityChange(_cacheId, _clientInfo, _status);
} catch (Exception ex) {
if (_parent.getLogger().getIsErrorLogsEnabled()) {
_parent.getLogger().getNCacheLog().Error("Client Connectivity Task.Process", ex.getMessage());
}
}
}
}