public AttributeUpdateMessage(String nodeId, String sessionId, String name, Object value) throws IOException { super(nodeId, sessionId); this.name = name; this.value = toByteArray(value); }
public Object getValue(ClassLoader classLoader) throws IOException, ClassNotFoundException { return toObject(classLoader, value); }
@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); } } });
private void fastPut(String name, Object value) { map.fastPut(name, value); if (readMode == ReadMode.MEMORY) { try { topic.publish(new AttributeUpdateMessage(redissonManager.getNodeId(), getId(), name, value)); } catch (IOException e) { throw new IllegalStateException(e); } } }
@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); } } });
private void fastPut(String name, Object value) { map.fastPut(name, value); if (readMode == ReadMode.MEMORY) { try { topic.publish(new AttributeUpdateMessage(redissonManager.getNodeId(), getId(), name, value)); } catch (IOException e) { throw new IllegalStateException(e); } } }
@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); } } });
private void fastPut(String name, Object value) { map.fastPut(name, value); if (readMode == ReadMode.MEMORY) { try { topic.publish(new AttributeUpdateMessage(redissonManager.getNodeId(), getId(), name, value)); } catch (IOException e) { throw new IllegalStateException(e); } } }
public AttributeUpdateMessage(String nodeId, String sessionId, String name, Object value) throws IOException { super(nodeId, sessionId); this.name = name; this.value = toByteArray(value); }
public Object getValue(ClassLoader classLoader) throws IOException, ClassNotFoundException { return toObject(classLoader, value); }
@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); } } });
private void fastPut(String name, Object value) { map.fastPut(name, value); if (readMode == ReadMode.MEMORY) { try { topic.publish(new AttributeUpdateMessage(redissonManager.getNodeId(), getId(), name, value)); } catch (IOException e) { throw new IllegalStateException(e); } } }
public AttributeUpdateMessage(String nodeId, String sessionId, String name, Object value) throws IOException { super(nodeId, sessionId); this.name = name; this.value = toByteArray(value); }
public Object getValue(ClassLoader classLoader) throws IOException, ClassNotFoundException { return toObject(classLoader, value); }
@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); } } });
private void fastPut(String name, Object value) { map.fastPut(name, value); if (readMode == ReadMode.MEMORY) { try { topic.publish(new AttributeUpdateMessage(redissonManager.getNodeId(), getId(), name, value)); } catch (IOException e) { throw new IllegalStateException(e); } } }
public AttributeUpdateMessage(String nodeId, String sessionId, String name, Object value) throws IOException { super(nodeId, sessionId); this.name = name; this.value = toByteArray(value); }
public Object getValue(ClassLoader classLoader) throws IOException, ClassNotFoundException { return toObject(classLoader, value); }
public AttributeUpdateMessage(String nodeId, String sessionId, String name, Object value) throws IOException { super(nodeId, sessionId); this.name = name; this.value = toByteArray(value); }
public Object getValue(ClassLoader classLoader) throws IOException, ClassNotFoundException { return toObject(classLoader, value); }