org.apache.cocoon.components.source.impl
Class MultiSourceValidity

java.lang.Object
  extended byorg.apache.excalibur.source.impl.validity.AbstractAggregatedValidity
      extended byorg.apache.cocoon.components.source.impl.MultiSourceValidity
All Implemented Interfaces:
Serializable, SourceValidity

public class MultiSourceValidity
extends AbstractAggregatedValidity

An aggregated SourceValidity for multiple sources.

Version:
$Id: MultiSourceValidity.html 1304280 2012-03-23 11:18:01Z ilgrosso $
See Also:
Serialized Form

Field Summary
static int CHECK_ALWAYS
          The delay value indicating to check always.
 
Fields inherited from interface org.apache.excalibur.source.SourceValidity
INVALID, UNKNOWN, VALID
 
Constructor Summary
MultiSourceValidity(SourceResolver resolver, long delay)
          Create a new MultiSourceValidity instance.
 
Method Summary
 void addSource(Source src)
          Add a Source to the list of Sources monitored by this instance.
 void close()
          Close this instance, or in other words declare that no other sources will be added to this MultiSourceValidity and that checkings can be now performed.
 int isValid()
          Check the validity of this SourceValidity instance.
 int isValid(SourceValidity newValidity)
          Check the validity of this instance comparing it with a (recently acquired) new SourceValidity object.
 
Methods inherited from class org.apache.excalibur.source.impl.validity.AbstractAggregatedValidity
add, getValidities, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CHECK_ALWAYS

public static final int CHECK_ALWAYS

The delay value indicating to check always.

See Also:
Constant Field Values
Constructor Detail

MultiSourceValidity

public MultiSourceValidity(SourceResolver resolver,
                           long delay)

Create a new MultiSourceValidity instance.

If the number of milliseconds is less than zero, or it's sum with the number of now milliseconds is greater than the biggest long representable, the expiration date will be set to Long.MAX_VALUE milliseconds from the epoch.

Parameters:
resolver - the SourceResolver used to access the sources.
delay - the number of milliseconds from now defining for how long this instance will be valid.
Method Detail

addSource

public void addSource(Source src)

Add a Source to the list of Sources monitored by this instance.

Parameters:
src - a non-null Source.

close

public void close()

Close this instance, or in other words declare that no other sources will be added to this MultiSourceValidity and that checkings can be now performed.


isValid

public int isValid()

Check the validity of this SourceValidity instance.

See Also:
SourceValidity.isValid()

isValid

public int isValid(SourceValidity newValidity)

Check the validity of this instance comparing it with a (recently acquired) new SourceValidity object.

See Also:
SourceValidity.isValid(SourceValidity)


Copyright © 1999-2008 The Apache Software Foundation. All Rights Reserved.