com.anthonyeden.lib.resource
Class AbstractResourceLoader

java.lang.Object
  extended bycom.anthonyeden.lib.resource.AbstractResourceLoader
All Implemented Interfaces:
ResourceLoader
Direct Known Subclasses:
ClassPathResourceLoader, FileResourceLoader, VFSResourceLoader

public abstract class AbstractResourceLoader
extends java.lang.Object
implements ResourceLoader

Abstract implementation of the ResourceLoader interface. Provides default implementations of some methods.

Author:
Anthony Eden

Field Summary
static int DEFAULT_DELAY
          The default delay time in milliseconds (5 seconds).
 
Constructor Summary
AbstractResourceLoader()
           
 
Method Summary
 int getDelay()
          Get the monitoring delay.
protected  java.util.List getMonitors()
          Get a List of all registered monitors.
 void loadResource(java.lang.String path, ResourceRecipient handler)
          Load the resource specified by the given path.
 void setDelay(int delay)
          Set the monitoring delay in milliseconds.
 void startMonitors()
          Start all stopped ResourceMonitors.
 void stopMonitors()
          Stop all running ResourceMonitors.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.anthonyeden.lib.resource.ResourceLoader
loadResource
 

Field Detail

DEFAULT_DELAY

public static final int DEFAULT_DELAY
The default delay time in milliseconds (5 seconds).

See Also:
Constant Field Values
Constructor Detail

AbstractResourceLoader

public AbstractResourceLoader()
Method Detail

loadResource

public void loadResource(java.lang.String path,
                         ResourceRecipient handler)
                  throws ResourceException
Load the resource specified by the given path. Calling this method will cause the resource to be loaded and monitored.

Parameters:
path - The path
handler - The ResourceReceipient callback
Throws:
ResourceException

getDelay

public int getDelay()
Get the monitoring delay.

Returns:
The monitoring delay in milliseconds

setDelay

public void setDelay(int delay)
Set the monitoring delay in milliseconds.

Parameters:
delay - The delay in milliseconds

startMonitors

public void startMonitors()
Start all stopped ResourceMonitors.


stopMonitors

public void stopMonitors()
Stop all running ResourceMonitors.


getMonitors

protected java.util.List getMonitors()
Get a List of all registered monitors.

Returns:
A List of monitors


Copyright (c) 2000-2003 Anthony Eden. All Rights Reserved.