public void shareElements() { synchronized (SimpleDicomElement.shared) { table.accept(new IntHashtable.Visitor() { public boolean visit(int key, Object value) { table.put(key, ((DicomElement) value).share()); return true; } }); } }
public boolean accept(final Visitor visitor) { return table.accept(new IntHashtable.Visitor() { public boolean visit(int key, Object value) { return visitor.visit((DicomElement) value); } }); }
private void writeObject(final ObjectOutputStream os) throws IOException { os.defaultWriteObject(); os.writeObject(tagClassName); os.writeObject(privateCreator); os.writeInt(table.size()); try { table.accept(new IntHashtable.Visitor() { public boolean visit(int key, Object value) { try { os.writeInt(key); os.writeUTF((String) value); return true; } catch (IOException e) { throw new RuntimeException(e); } } }); } catch (Exception e) { throw (IOException) e; } }
private void writeObject(final ObjectOutputStream os) throws IOException { os.defaultWriteObject(); os.writeObject(privateCreator); os.writeInt(table.size()); try { table.accept(new IntHashtable.Visitor() { public boolean visit(int key, Object value) { try { os.writeInt(key); os.writeShort(((VR) value).code); return true; } catch (IOException e) { throw new RuntimeException(e); } } }); } catch (Exception e) { throw (IOException) e; } }
void checkIdle(final long now) { if (performing > 0) return; if (rspHandlerForMsgId.isEmpty()) { if (now > idleTimeout) try { release(false); } catch (InterruptedException e) { e.printStackTrace(); } } else { rspHandlerForMsgId.accept(new IntHashtable.Visitor() { public boolean visit(int key, Object value) { DimseRSPHandler rspHandler = (DimseRSPHandler) value; if (now < rspHandler.getTimeout()) return true; Association.this.abort(); return false; } }); } }
private void onClosed() { if (ae != null) ae.removeFromPool(this); reaper.unregister(this); synchronized (rspHandlerForMsgId) { rspHandlerForMsgId.accept(new IntHashtable.Visitor() { public boolean visit(int key, Object value) { ((DimseRSPHandler) value).onClosed(Association.this); return true; } }); rspHandlerForMsgId.clear(); rspHandlerForMsgId.notifyAll(); } if (ae != null) { ae.associationClosed(this); } }