/** * @deprecated Use space.put instead */ public static void wipeAndOut (Space sp, Object key, Object value) { sp.put(key, value); }
public void put (K key, V value) { sp.put (key, value); } public void put (K key, V value, long timeout) {
public void put (K key, V value, long timeout) { sp.put (key, value, timeout); } public V in (K key) {
private void takeOnline() { sp.put(ready, new Date()); }
protected void initTailLock () { tailLock = TAILLOCK + "." + Integer.toString (this.hashCode()); sp.put (tailLock, TAILLOCK); } protected void checkTail () {
private void connect (int slot) { ISOChannel c = channels[slot]; if (c != null && !c.isConnected()) { try { c.connect (); sp.put (ready, new Date()); } catch (IOException e) { getLog().warn ("check-connection(" + slot + ") " + c.toString(), e.getMessage ()); } } } private void disconnect (ISOChannel channel) {
public void put (Object key, Object value) { try { Interpreter bsh = initInterpreter (key, value); synchronized (sp) { if (!eval (bsh, putScript, putSource)) sp.put (key, value); } } catch (Throwable t) { throw new SpaceError (t); } } public void put (Object key, Object value, long timeout) {
/** * Load key, enables decryption * * @param jobId job id * @param keyId key to load * @param password private key-ring password * @throws Exception if invalid key */ public void loadKey (UUID jobId, UUID keyId, char[] password) throws Exception { UUID xid = xor(jobId, keyId); if (keys.rdp(xid) == null) keys.put(xid, getKey(keyId, password), ttl); }
protected void snapshot (long id, Serializable context, Integer status) { String contextKey = getKey (CONTEXT, id); synchronized (psp) { commitOff (psp); SpaceUtil.wipe(psp, contextKey); if (context != null) psp.out (contextKey, context); if (status != null) { String stateKey = getKey (STATE, id); psp.put (stateKey, status); } commitOn (psp); } } protected void setState (long id, Integer state) {
private static Element createSchema() { Element schema = new Element("schema"); schema.setAttribute("id","base"); SpaceFactory.getSpace().put(SCHEMA_PREFIX+"base.xml", schema); return schema; }