@Override public ConnectionProperties connectionSync(ConnectionHandle ch, ConnectionProperties connProps) { this.connProps.merge(connProps); this.connProps.setDirty(false); return this.connProps; }
@Override public ConnectionProperties connectionSync(ConnectionHandle ch, ConnectionProperties connProps) { this.connProps.merge(connProps); this.connProps.setDirty(false); return this.connProps; }
@Override public ConnectionProperties connectionSync(ConnectionHandle ch, ConnectionProperties connProps) { this.connProps.merge(connProps); this.connProps.setDirty(false); return this.connProps; }
public ConnectionProperties call() { ConnectionPropertiesImpl localProps = propsMap.get(ch.id); if (localProps == null) { localProps = new ConnectionPropertiesImpl(); localProps.setDirty(true); propsMap.put(ch.id, localProps); } // Only make an RPC if necessary. RPC is necessary when we have local changes that need // flushed to the server (be sure to introduce any new changes from connProps before // checking AND when connProps.isEmpty() (meaning, this was a request for a value, not // overriding a value). Otherwise, accumulate the change locally and return immediately. if (localProps.merge(connProps).isDirty() && connProps.isEmpty()) { final Service.ConnectionSyncResponse response = service.apply( new Service.ConnectionSyncRequest(ch.id, localProps)); propsMap.put(ch.id, (ConnectionPropertiesImpl) response.connProps); return response.connProps; } else { return localProps; } } });
public ConnectionProperties call() { ConnectionPropertiesImpl localProps = propsMap.get(ch.id); if (localProps == null) { localProps = new ConnectionPropertiesImpl(); localProps.setDirty(true); propsMap.put(ch.id, localProps); } // Only make an RPC if necessary. RPC is necessary when we have local changes that need // flushed to the server (be sure to introduce any new changes from connProps before // checking AND when connProps.isEmpty() (meaning, this was a request for a value, not // overriding a value). Otherwise, accumulate the change locally and return immediately. if (localProps.merge(connProps).isDirty() && connProps.isEmpty()) { final Service.ConnectionSyncResponse response = service.apply( new Service.ConnectionSyncRequest(ch.id, localProps)); propsMap.put(ch.id, (ConnectionPropertiesImpl) response.connProps); return response.connProps; } else { return localProps; } } });
public ConnectionProperties call() { ConnectionPropertiesImpl localProps = propsMap.get(ch.id); if (localProps == null) { localProps = new ConnectionPropertiesImpl(); localProps.setDirty(true); propsMap.put(ch.id, localProps); } // Only make an RPC if necessary. RPC is necessary when we have local changes that need // flushed to the server (be sure to introduce any new changes from connProps before // checking AND when connProps.isEmpty() (meaning, this was a request for a value, not // overriding a value). Otherwise, accumulate the change locally and return immediately. if (localProps.merge(connProps).isDirty() && connProps.isEmpty()) { final Service.ConnectionSyncResponse response = service.apply( new Service.ConnectionSyncRequest(ch.id, localProps)); propsMap.put(ch.id, (ConnectionPropertiesImpl) response.connProps); return response.connProps; } else { return localProps; } } });
@Override public ConnectionProperties connectionSync(ConnectionHandle ch, ConnectionProperties connProps) { LOG.trace("syncing properties for connection {}", ch); try { Connection conn = getConnection(ch.id); ConnectionPropertiesImpl props = new ConnectionPropertiesImpl(conn).merge(connProps); if (props.isDirty()) { apply(conn, props); props.setDirty(false); } return props; } catch (SQLException e) { throw propagate(e); } }
@Override public ConnectionProperties connectionSync(ConnectionHandle ch, ConnectionProperties connProps) { LOG.trace("syncing properties for connection {}", ch); try { Connection conn = getConnection(ch.id); ConnectionPropertiesImpl props = new ConnectionPropertiesImpl(conn).merge(connProps); if (props.isDirty()) { apply(conn, props); props.setDirty(false); } return props; } catch (SQLException e) { throw propagate(e); } }