    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class w3c.jigsaw.contrib.SalvagerResource

    java.lang.Object
       |
       +----w3c.tools.store.AttributeHolder
               |
               +----w3c.tools.store.Resource
                       |
                       +----w3c.jigsaw.resources.HTTPResource
                               |
                               +----w3c.jigsaw.resources.FilteredResource
                                       |
                                       +----w3c.jigsaw.contrib.SalvagerResource

public class SalvagerResource
extends FilteredResource

##

ATTR_LOGNAME
  Attribute index - The salvager log.
engine
  The engine currently running, or null.
log
  The log, as a RandomAccessFile
logfile
  The log file to use (if any)
report
  The last walker's report.
started
  Date at which the currernt salvage was started.
thread
  The power for the engine, when needed.
verified
  Did we run a verify stage since last safe report ?
walker
  The walk handler.

##

SalvagerResource()

##

acceptUnload()
  This resource should never be unloaded.
dumpReport(HtmlGenerator)
  Dump the last report, if any into given stream.
get(Request)
  Redirect all requests to the log, when possible.
getEngine()
  Get the walker engine currently running.
getLogname()
  Get the salvager's resource log name.
initialize(Object[])
  Initialization method for attribute holders.
interruptSalvage()
  Interrupt the current walker, if any.
notifyUnload()
  This resource is being unloaded.
setValue(int, Object)
  Catch setValue, to maintain cached header values correctness.
startSalvage()
  Start the salvage process.
walkerDone(ResourceWalker, SalvagerReport)
  Callback, for the walker to notify the end of salvaging.

##

ATTR_LOGNAME

      protected static int ATTR_LOGNAME

  Attribute index - The salvager log.

engine

      protected WalkerEngine engine

  The engine currently running, or null.

thread

      protected Thread thread

  The power for the engine, when needed.

walker

      protected ResourceWalker walker

  The walk handler.

log

      protected PrintStream log

  The log, as a RandomAccessFile

report

      protected SalvagerReport report

  The last walker's report.

verified

      protected boolean verified

  Did we run a verify stage since last safe report ?

started

      protected long started

  Date at which the currernt salvage was started.

logfile

      protected File logfile

  The log file to use (if any)

##

SalvagerResource

      public SalvagerResource()

##

setValue

      public void setValue(int idx,
                           Object value)

  Catch setValue, to maintain cached header values correctness.
  Overrides:
    setValue in class HTTPResource

getEngine

      protected synchronized WalkerEngine getEngine()

  Get the walker engine currently running.
  Returns:
    A WalkerEngine instance, or null if no engine is currently running.

walkerDone

      protected synchronized void walkerDone(ResourceWalker walker,
                                             SalvagerReport report)

  Callback, for the walker to notify the end of salvaging.
  Parameters:
    walker - The walker that is done.
    report - The walker's report

startSalvage

      protected synchronized boolean startSalvage()

  Start the salvage process.
  Returns:
    A boolean, true if salvager launched, false if salvager was already running.

interruptSalvage

      protected synchronized void interruptSalvage()

  Interrupt the current walker, if any.

getLogname

      public String getLogname()

  Get the salvager's resource log name.
  Returns:
    A String filename.

acceptUnload

      public synchronized boolean acceptUnload()

  This resource should never be unloaded.
  Overrides:
    acceptUnload in class Resource

notifyUnload

      public void notifyUnload()

  This resource is being unloaded.
  Overrides:
    notifyUnload in class Resource

dumpReport

      protected void dumpReport(HtmlGenerator g)

  Dump the last report, if any into given stream.
  Parameters:
    g - The HtmlGenerator to dump to.

get

      public Reply get(Request request) throws HTTPException

  Redirect all requests to the log, when possible.
  Returns:
    A Reply instance.
  Throws: HTTPException
    If performing the request failed.
  Overrides:
    get in class HTTPResource

initialize

      public void initialize(Object values[])

  Initialization method for attribute holders.
  Overrides:
    initialize in class AttributeHolder

    All Packages  Class Hierarchy  This Package  Previous  Next  Index