Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

oracle.cabo.share.io
Class CachingNameResolver

java.lang.Object
  |
  +--oracle.cabo.share.io.CachingNameResolver
All Implemented Interfaces:
NameResolver

public class CachingNameResolver
extends java.lang.Object
implements NameResolver

NameResolver that adds caching support. Providers that receive cached results (via setCachedResult) will be stored in a dictionary for later retrieval.

See Also:
InputStreamProvider.setCachedResult(java.lang.Object)

Constructor Summary
CachingNameResolver(NameResolver base, java.util.Dictionary storage, boolean checkModified)
          Creates a caching name resolver.
CachingNameResolver(NameResolver base, java.util.Dictionary storage, int msBetweenChecks)
          Creates a caching name resolver that will check modification times on each request, with the ability to override the default amount of time that must go by before a modification time is rechecked.
 
Method Summary
 InputStreamProvider getProvider(java.lang.String name)
          Given a name, returns an InputStreamProvider.
 NameResolver getResolver(java.lang.String name)
          Return the new NameResolver that should be used to resolve names relative to a given name.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CachingNameResolver

public CachingNameResolver(NameResolver base,
                           java.util.Dictionary storage,
                           boolean checkModified)
Creates a caching name resolver.
Parameters:
base - a base NameResolver to wrap
storage - the Dictionary to store results, or null to use a default cache.
checkModified - if true, last-modified times will be checked on every request

CachingNameResolver

public CachingNameResolver(NameResolver base,
                           java.util.Dictionary storage,
                           int msBetweenChecks)
Creates a caching name resolver that will check modification times on each request, with the ability to override the default amount of time that must go by before a modification time is rechecked.
Parameters:
base - a base NameResolver to wrap
storage - the Dictionary to store results, or null to use a default cache.
msBetweenChecks - The number of milliseconds required to elapse before checking the modification time again.
Method Detail

getProvider

public InputStreamProvider getProvider(java.lang.String name)
                                throws java.io.IOException
Given a name, returns an InputStreamProvider. This function should never return null - if the target cannot be resolved, throw an IOException.
Specified by:
getProvider in interface NameResolver
Parameters:
name - the name of the target

getResolver

public NameResolver getResolver(java.lang.String name)
Return the new NameResolver that should be used to resolve names relative to a given name. This function should never return null - if the target cannot be resolved, return a resolver that can only support absolute names.
Specified by:
getResolver in interface NameResolver
Parameters:
name - the name of the target

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

Copyright © 2002,2003, Oracle. All Rights Reserved.