/** * Returns a {@code CacheInfoResponse} that will be returned to the specified recipient. */ public static CacheInfoResponse create(DistributionManager dm, InternalDistributedMember recipient) { CacheInfoResponse m = new CacheInfoResponse(); m.setRecipient(recipient); try { InternalCache c = (InternalCache) CacheFactory.getInstanceCloseOk(dm.getSystem()); m.info = new RemoteCacheInfo(c); } catch (CancelException ignore) { m.info = null; } return m; }
/** * Returns a {@code DurableClientInfoResponse} that will be returned to the specified recipient. */ public static DurableClientInfoResponse create(DistributionManager dm, InternalDistributedMember recipient, DurableClientInfoRequest request) { DurableClientInfoResponse m = new DurableClientInfoResponse(); m.setRecipient(recipient); try { InternalCache c = (InternalCache) CacheFactory.getInstanceCloseOk(dm.getSystem()); if (!c.getCacheServers().isEmpty()) { CacheServerImpl server = (CacheServerImpl) c.getCacheServers().iterator().next(); switch (request.action) { case DurableClientInfoRequest.HAS_DURABLE_CLIENT_REQUEST: { m.returnVal = server.getAcceptor().getCacheClientNotifier().hasDurableClient(request.durableId); break; } case DurableClientInfoRequest.IS_PRIMARY_FOR_DURABLE_CLIENT_REQUEST: { m.returnVal = server.getAcceptor().getCacheClientNotifier() .hasPrimaryForDurableClient(request.durableId); break; } } } } catch (CacheClosedException ignore) { // do nothing } return m; }
m.setRecipient(recipient); try { InternalCache c = (InternalCache) CacheFactory.getInstanceCloseOk(dm.getSystem()); if (cacheId != System.identityHashCode(c)) { m.info = null;
InternalCache cache = (InternalCache) CacheFactory.getInstanceCloseOk(dm.getSystem());