private void updateStamp(int idx, int update) throws IOException { stamp[idx] = update; stampbuf[(idx*4)+0] = (byte)((update >>> 24) & 0xFF); stampbuf[(idx*4)+1] = (byte)((update >>> 16) & 0xFF); stampbuf[(idx*4)+2] = (byte)((update >>> 8) & 0xFF); stampbuf[(idx*4)+3] = (byte)(update & 0xFF); AgentServer.getTransaction().saveByteArray(stampbuf, name); }
private void updateStamp(int idx, int update) throws IOException { stamp[idx] = update; stampbuf[(idx*4)+0] = (byte)((update >>> 24) & 0xFF); stampbuf[(idx*4)+1] = (byte)((update >>> 16) & 0xFF); stampbuf[(idx*4)+2] = (byte)((update >>> 8) & 0xFF); stampbuf[(idx*4)+3] = (byte)(update & 0xFF); AgentServer.getTransaction().saveByteArray(stampbuf, name); }
/** * Saves logical clock information to persistent storage. */ public void save() throws IOException { if (modified) { stampBuf[0] = (byte)((stamp >>> 24) & 0xFF); stampBuf[1] = (byte)((stamp >>> 16) & 0xFF); stampBuf[2] = (byte)((stamp >>> 8) & 0xFF); stampBuf[3] = (byte)(stamp & 0xFF); AgentServer.getTransaction().saveByteArray(stampBuf, getName()); modified = false; } }
/** * Saves logical clock information to persistent storage. */ public void save() throws IOException { if (modified) { stampBuf[0] = (byte)((stamp >>> 24) & 0xFF); stampBuf[1] = (byte)((stamp >>> 16) & 0xFF); stampBuf[2] = (byte)((stamp >>> 8) & 0xFF); stampBuf[3] = (byte)(stamp & 0xFF); AgentServer.getTransaction().saveByteArray(stampBuf, getName()); modified = false; } }
/** * Reset all information related to server sid in the network configuration. * * @param id the unique server id. */ synchronized void resetServer(short id, int boot) throws IOException { // First we have to verify that id is already in servers int idx = index(id); if (idx < 0) return; // TODO... // Save the servers configuration and the logical time stamp. AgentServer.getTransaction().save(servers, serversFN); AgentServer.getTransaction().save(bootTS, bootTSFN); AgentServer.getTransaction().saveByteArray(stampbuf, name); }
/** * Reset all information related to server sid in the network configuration. * * @param id the unique server id. */ synchronized void resetServer(short id, int boot) throws IOException { // First we have to verify that id is already in servers int idx = index(id); if (idx < 0) return; // TODO... // Save the servers configuration and the logical time stamp. AgentServer.getTransaction().save(servers, serversFN); AgentServer.getTransaction().save(bootTS, bootTSFN); AgentServer.getTransaction().saveByteArray(stampbuf, name); }
AgentServer.getTransaction().saveByteArray(stampbuf, name);
AgentServer.getTransaction().saveByteArray(stampbuf, name);
AgentServer.getTransaction().saveByteArray(stampbuf, name);
AgentServer.getTransaction().saveByteArray(stampbuf, name);
AgentServer.getTransaction().saveByteArray(stampbuf, name); } else {
AgentServer.getTransaction().saveByteArray(stampbuf, name); } else {
public void save() { if (logger.isLoggable(BasicLevel.DEBUG)) logger.log(BasicLevel.DEBUG, "Message.save:" + txname); if (!isPersistent()) return; if (soft) { byte[] body = msg.body; // sets the body to null to save it in an other file msg.body = null; try { AgentServer.getTransaction().create(this, txname); } catch (IOException exc) { logger.log(BasicLevel.ERROR, "Message named [" + txname + "] could not be saved", exc); } // save the body try { // The body is RO do not copy it. AgentServer.getTransaction().saveByteArray(body, null, txname + "B", false, true); } catch (IOException exc) { logger.log(BasicLevel.ERROR, "Message named [" + txname + "] could not be saved", exc); } msg.body = body; } else { try { AgentServer.getTransaction().create(this, txname); } catch (IOException exc) { logger.log(BasicLevel.ERROR, "Message named [" + txname + "] could not be saved", exc); } } }
AgentServer.getTransaction().saveByteArray(body, null, txname + "B", false, true); } catch (IOException exc) { logger.log(BasicLevel.ERROR, "Message named [" + txname + "] could not be saved", exc);