jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From KÖLL Claus <C.KO...@TIROL.GV.AT>
Subject AW: Workspace.copy() Question ...
Date Tue, 18 Nov 2008 12:21:56 GMT
some more thoughts ...

thomas, if we make it like you wrote ...

class VirusScanner {
    public void scan(InputStream in) throws VirusFoundException {
        if(in instanceof DataStoreInputStream) {
            DataIdentifier di = ((DataStoreInputStream) in).getDataIdentifier();
            if (hasScanned(di)) {
                // already exists, no need to copy
                return;
            } else {
                doScan(in);
                addScanned(di);
            }
        } else {
            doScan(in);
        }

every module must handle this internally.

it would be much finer to handle this more generic with a proxy in front of 'modules'.
such proxy could store the dataIdentifier/result and a module key and if we try
to process a binary a second time this proxy could check this and return without calling
the module a second time.

greets
claus

Mime
View raw message