@Override protected void removeAttributeInternal(String name, boolean notify) { super.removeAttributeInternal(name, notify); if (updateMode == UpdateMode.DEFAULT && map != null) { map.fastRemove(name); if (readMode == ReadMode.MEMORY) { topic.publish(new AttributeRemoveMessage(redissonManager.getNodeId(), getId(), name)); } } }
@Override public void onMessage(CharSequence channel, AttributeMessage msg) { try { // TODO make it thread-safe RedissonSession session = (RedissonSession) RedissonSessionManager.super.findSession(msg.getSessionId()); if (session != null && !msg.getNodeId().equals(nodeId)) { if (msg instanceof AttributeRemoveMessage) { session.superRemoveAttributeInternal(((AttributeRemoveMessage)msg).getName(), true); } if (msg instanceof AttributesClearMessage) { RedissonSessionManager.super.remove(session, false); } if (msg instanceof AttributesPutAllMessage) { AttributesPutAllMessage m = (AttributesPutAllMessage) msg; for (Entry<String, Object> entry : m.getAttrs(applicationClassLoader).entrySet()) { session.superSetAttribute(entry.getKey(), entry.getValue(), true); } } if (msg instanceof AttributeUpdateMessage) { AttributeUpdateMessage m = (AttributeUpdateMessage)msg; session.superSetAttribute(m.getName(), m.getValue(applicationClassLoader), true); } } } catch (Exception e) { log.error("Can't handle topic message", e); } } });
@Override protected void removeAttributeInternal(String name, boolean notify) { super.removeAttributeInternal(name, notify); if (updateMode == UpdateMode.DEFAULT && map != null) { map.fastRemove(name); if (readMode == ReadMode.MEMORY) { topic.publish(new AttributeRemoveMessage(redissonManager.getNodeId(), getId(), name)); } } }
@Override public void onMessage(CharSequence channel, AttributeMessage msg) { try { // TODO make it thread-safe RedissonSession session = (RedissonSession) RedissonSessionManager.super.findSession(msg.getSessionId()); if (session != null && !msg.getNodeId().equals(nodeId)) { if (msg instanceof AttributeRemoveMessage) { session.superRemoveAttributeInternal(((AttributeRemoveMessage)msg).getName(), true); } if (msg instanceof AttributesClearMessage) { RedissonSessionManager.super.remove(session, false); } if (msg instanceof AttributesPutAllMessage) { AttributesPutAllMessage m = (AttributesPutAllMessage) msg; for (Entry<String, Object> entry : m.getAttrs(applicationClassLoader).entrySet()) { session.superSetAttribute(entry.getKey(), entry.getValue(), true); } } if (msg instanceof AttributeUpdateMessage) { AttributeUpdateMessage m = (AttributeUpdateMessage)msg; session.superSetAttribute(m.getName(), m.getValue(applicationClassLoader), true); } } } catch (Exception e) { log.error("Can't handle topic message", e); } } });
@Override protected void removeAttributeInternal(String name, boolean notify) { super.removeAttributeInternal(name, notify); if (updateMode == UpdateMode.DEFAULT && map != null) { map.fastRemove(name); if (readMode == ReadMode.MEMORY) { topic.publish(new AttributeRemoveMessage(redissonManager.getNodeId(), getId(), name)); } } }
@Override public void onMessage(CharSequence channel, AttributeMessage msg) { try { // TODO make it thread-safe RedissonSession session = (RedissonSession) RedissonSessionManager.super.findSession(msg.getSessionId()); if (session != null && !msg.getNodeId().equals(nodeId)) { if (msg instanceof AttributeRemoveMessage) { session.superRemoveAttributeInternal(((AttributeRemoveMessage)msg).getName(), true); } if (msg instanceof AttributesClearMessage) { RedissonSessionManager.super.remove(session); } if (msg instanceof AttributesPutAllMessage) { AttributesPutAllMessage m = (AttributesPutAllMessage) msg; for (Entry<String, Object> entry : m.getAttrs(applicationClassLoader).entrySet()) { session.superSetAttribute(entry.getKey(), entry.getValue(), true); } } if (msg instanceof AttributeUpdateMessage) { AttributeUpdateMessage m = (AttributeUpdateMessage)msg; session.superSetAttribute(m.getName(), m.getValue(applicationClassLoader), true); } } } catch (Exception e) { log.error("Can't handle topic message", e); } } });
@Override protected void removeAttributeInternal(String name, boolean notify) { super.removeAttributeInternal(name, notify); if (updateMode == UpdateMode.DEFAULT && map != null) { map.fastRemove(name); if (readMode == ReadMode.MEMORY) { topic.publish(new AttributeRemoveMessage(redissonManager.getNodeId(), getId(), name)); } } }
@Override public void onMessage(CharSequence channel, AttributeMessage msg) { try { // TODO make it thread-safe RedissonSession session = (RedissonSession) RedissonSessionManager.super.findSession(msg.getSessionId()); if (session != null && !msg.getNodeId().equals(nodeId)) { if (msg instanceof AttributeRemoveMessage) { session.superRemoveAttributeInternal(((AttributeRemoveMessage)msg).getName(), true); } if (msg instanceof AttributesClearMessage) { RedissonSessionManager.super.remove(session, false); } if (msg instanceof AttributesPutAllMessage) { AttributesPutAllMessage m = (AttributesPutAllMessage) msg; for (Entry<String, Object> entry : m.getAttrs(applicationClassLoader).entrySet()) { session.superSetAttribute(entry.getKey(), entry.getValue(), true); } } if (msg instanceof AttributeUpdateMessage) { AttributeUpdateMessage m = (AttributeUpdateMessage)msg; session.superSetAttribute(m.getName(), m.getValue(applicationClassLoader), true); } } } catch (Exception e) { log.error("Can't handle topic message", e); } } });
@Override protected void removeAttributeInternal(String name, boolean notify) { super.removeAttributeInternal(name, notify); if (updateMode == UpdateMode.DEFAULT && map != null) { map.fastRemove(name); if (readMode == ReadMode.MEMORY) { topic.publish(new AttributeRemoveMessage(redissonManager.getNodeId(), getId(), name)); } } }
@Override public void onMessage(CharSequence channel, AttributeMessage msg) { try { // TODO make it thread-safe RedissonSession session = (RedissonSession) RedissonSessionManager.super.findSession(msg.getSessionId()); if (session != null && !msg.getNodeId().equals(nodeId)) { if (msg instanceof AttributeRemoveMessage) { session.superRemoveAttributeInternal(((AttributeRemoveMessage)msg).getName(), true); } if (msg instanceof AttributesClearMessage) { RedissonSessionManager.super.remove(session, false); } if (msg instanceof AttributesPutAllMessage) { AttributesPutAllMessage m = (AttributesPutAllMessage) msg; for (Entry<String, Object> entry : m.getAttrs(applicationClassLoader).entrySet()) { session.superSetAttribute(entry.getKey(), entry.getValue(), true); } } if (msg instanceof AttributeUpdateMessage) { AttributeUpdateMessage m = (AttributeUpdateMessage)msg; session.superSetAttribute(m.getName(), m.getValue(applicationClassLoader), true); } } } catch (Exception e) { log.error("Can't handle topic message", e); } } });