Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.opensymphony.module.* (89)com.opensymphony.oscache.* (103)

Package Samples:

com.opensymphony.oscache.web.filter: Provides classes and interfaces that make up the base of OSCache's web application support.  
com.opensymphony.oscache.base.algorithm: Provides the base classes and interfaces that make up the core of OSCache.  
com.opensymphony.oscache.base.persistence: Provides the base classes and interfaces that make up the core of OSCache.  


AbstractConcurrentReadCache: A version of Hashtable that supports mostly-concurrent reading, but exclusive writing. Because reads are not limited to periods without writes, a concurrent reader policy is weaker than a classic reader/writer policy, but is generally faster and allows more concurrency. This class is a good choice especially for tables that are mainly created by one thread during the start-up phase of a program, and from then on, are mainly read (with perhaps occasional additions or removals) in many threads. If you also need concurrency among writes, consider instead using ConcurrentHashMap. Successful retrievals ...
HTMLPage: Extension of Page providing access to HTML data. The page is parsed and the <title> , <head> (minus the <title> ) and <body> are split into chunks. These can then be used by a Decorator . Properties are also extracted from the HTML. Page Properties When the page is parsed, values from certain tags are added to the properties to allow easy access to them. The following tags have properties extracted from them. HTML Tag All attributes of the <html> tag shall be added as properties. TITLE Tag The contents of the <title> tag shall be added as the title property. ...
GeneralCacheAdministrator: A GeneralCacheAdministrator creates, flushes and administers the cache. EXAMPLES : // --------------------------------------------------------------- // Typical use with fail over // --------------------------------------------------------------- String myKey = "myKey"; String myValue; int myRefreshPeriod = 1000; try { // Get from the cache myValue = (String) admin.getFromCache(myKey, myRefreshPeriod); } catch (NeedsRefreshException nre) { try { // Get the value (probably by calling an EJB) myValue = "This is the content retrieved."; // Store in the cache admin.putInCache(myKey, myValue); } catch ...
Page: The Page object wraps the contents of the original (undecorated) page. The original data in its entirity can be written using the writePage() methods. It may also contain a set of properties - these vary among different PageParser implementations. Typically a Page is no use to a Decorator as it needs specific details relevant to the content-type of that page ( e.g. HTML pages). The appropriate PageParser is responsible for returning extended implementations of pages such as HTMLPage which are of more use to the Decorator. New media types ( e.g. WML) could be added to the system by extending Page ...
AgentDecoratorMapper: The AgentDecoratorMapper can determine the user-agent (i.e. web-browser) requesting a page, and map to a suitable Decorator. This can be useful for supplying different versions of the same content for different browsers (e.g. vanilla HTML for Lynx, complex tables and frames for Netscape, extra stuff for IE5, etc). This can also be used to enhance search-engine ratings by using a 'bait and switch' system - this involves showing a search-engine friendly of the content to spiders only. When AgentDecoratorMapper is in the chain, it will request the appropriate Decorator from its parent. It will then ...
ApplyDecoratorTag: This tag inserts an external resource as a panel into the current Page. The page attribute should point to the panel resource which should expose an entire page (e.g. another JSP file producing HTML). This attribute can be relative to the page it is being called from or an absolute path from the context-root. OR If the page attribute is not specified, the body content is parsed into the com.opensymphony.module.sitemesh.Page object and has the com.opensymphony.module.sitemesh.Decorator applied. The (optional) decorator attribute is the name of the com.opensymphony.module.sitemesh.Decorator to apply ...
ParameterDecoratorMapper: The ParameterDecoratorMapper will map a suitable decorator based on request parameters. The ParameterDecoratorMapper is configured via three properties. decorator.parameter - the parameter which contains the name of the decorator which will be mapped. The default is "decorator". For example if decorator.parameter is "foobar" then myurl.jsp?foobar=mydecorator will map to the decorator named "mydecorator". You can also supply an optional 'confirmation parameter'. The decorator will only be mapped if the parameter named is in the request URI and the value of that parameter is equal ...
FlushTag: FlushTag flushes caches created with <cache>. This tag provides programmatic control over when caches are flushed, and can flush all caches at once. Usage Examples: <%@ taglib uri="oscache" prefix="cache" %> <cache:flush scope="application" /> <cache:flush scope="session" key="foobar" /> Note: If no scope is provided (or scope is null), it will flush all caches globally - use with care! Flushing is done by setting an appropriate application level time, which <cache> always looks at before retrieving the cache. If this 'flush time' is > that cache's last update, ...
ConfigLoader: The ConfigLoader reads a configuration XML file that contains Decorator definitions (name, url, init-params) and path-mappings (pattern, name). These can then be accessed by the getDecoratorByName() methods and getMappedName() methods respectively. The DTD for the configuration file in old (deprecated) format is located at . The DTD for the configuration file in new format is located at . Editing the config file will cause it to be auto-reloaded. This class is used by ConfigDecoratorMapper, ...
LanguageDecoratorMapper: The LanguageDecoratorMapper can determine the preferred language set in the browser requesting a page, and map to a suitable Decorator (using the "Accept-Language" HTTP header). This can be useful for supplying different versions of the same content for different languages. When LanguageDecoratorMapper is in the chain, it will request the appropriate Decorator from its parent. It will then add an extention to the filename of the Decorator, and if that file exists it shall be used as the Decorator instead. For example, if the Decorator path is /blah.jsp and the detected preferred language is en ...
JavaGroupsBroadcastingListener: A concrete implementation of the AbstractBroadcastingListener based on the JavaGroups library. This Class uses JavaGroups to broadcast cache flush messages across a cluster. One of the following properties should be configured in for this listener: cache.cluster.multicast.ip - The multicast IP that JavaGroups should use for broadcasting - The JavaGroups channel properties to use. Allows for precise control over the behaviour of JavaGroups Please refer to the clustering documentation for further details on the configuration of this listener.
EnvEntryDecoratorMapper: The EnvEntryDecoratorMapper allows the reference to a web-app environment entry for the decorator name, and falls back to ConfigDecoratorMapper's behavior if no matching environment entry is found. In some cases, it's desirable to allow a deployer, as opposed to a developer, to specify a decorator. In a .WAR file, this can be very difficult, since decorator mappings are specified in decorators.xml (more or less). This mapper corrects that by allowing two types of mapping. If the decorator name is found in an <env-entry> , the entry's value is used as the decorator reference. Known Issues: ...
AbstractPage: Abstract implementation of com.opensymphony.module.sitemesh.Page . Contains base methods for storing and accessing page properties. Also stores pageData 55 as byte[] and implements write???() methods. Concrete implementations need only set the pageData 55 and call addProperty(java.lang.String,java.lang.String) 55 to add all the required information.
PageDecoratorMapper: The PageDecoratorMapper allows the actual Page to determine the Decorator to be used. The 'meta.decorator' and 'decorator' properties of the page are accessed and if any of them contain the name of a valid Decorator, that Decorator shall be applied. As an example, if HTML is being used, the Decorator could be chosen by using a <html decorator="mydecorator"> root tag or by using a <meta name="decorator" content="mydecorator"> tag in the header. The actual properties to query are specified by passing properties to the mapper using the property.? prefix. As the properties are stored in ...
PathMapper: The PathMapper is used to map file patterns to keys, and find an approriate key for a given file path. The pattern rules are consistent with those defined in the Servlet 2.3 API on the whole. Wildcard patterns are also supported, using any combination of * and ?. Example PathMapper pm = new PathMapper(); pm.put("one","/"); pm.put("two","/mydir/*"); pm.put("three","*.xml"); pm.put("four","/myexactfile.html"); pm.put("five","/*\/admin/*.??ml"); String result1 = pm.get("/mydir/myfile.xml"); // returns "two"; String result2 = pm.get("/mydir/otherdir/admin/myfile.html"); // returns "five";
OSDecoratorMapper: The OSDecoratorMapper will map a suitable decorator based on the operating system of the remote client. OSDecoratorMapper works by checking to see if the "UA-OS" header was sent with the HTTP request. If it was, the class will check the value of the header with all the different os's the user has configured the Decorator Mapper to identify and, if a match is found, routes the request accordingly. Configuration is done using the sitemesh.xml file. The param name is a string literal (operating system name) you would like to match in the UA-OS header, and the value is what will be appended to the ...
PageParser: The PageParser is responsible for parsing the page data into an appropriate Page object. The implementation of this can be switched to parse different kind of data ( e.g. HTML, WML, FOP, images) or for performance enhancements. An implementation is obtained through the Factory . A single PageParser is reused, therefore the parse() methods need to be thread-safe.
Factory: Factory responsible for creating appropriate instances of implementations. This is specific to a web context and is obtained through getInstance(com.opensymphony.module.sitemesh.Config) 55 . The actual Factory method used is determined by the enviroment entry sitemesh.factory . If this doesn't exist, it defaults to com.opensymphony.module.sitemesh.factory.DefaultFactory .
PrintableDecoratorMapper: The PrintableDecoratorMapper is a sample DecoratorMapper that will check to see whether 'printable=true' is supplied as a request parameter and if so, use the specified decorator instead. The name of this decorator should be supplied in the decorator property. The exact 'printable=true' request criteria can be overriden with the and parameter.value properties. Although this DecoratorMapper was designed for creating printable versions of a page, it can be used for much more imaginative purposes.
TagTokenizer: Splits a chunk of HTML into 'text' and 'tag' tokens, for easy processing. Is VERY tolerant to badly formed HTML. Usage You need to supply a custom TokenHandler that will receive callbacks as text and tags are processed. char[] input = ...; HTMLTagTokenizer tokenizer = new HTMLTagTokenizer(input); TokenHandler handler = new MyTokenHandler(); tokenizer.start(handler);
UseCachedTag: UseCachedTag is a tag that tells a <cache> tag to reuse the cached body. Usage Example: <%@ taglib uri="oscache" prefix="cache" %> <cache:cache key="mycache" scope="application"> if (reuse cached) <cache:usecached /> else some other logic </cache:cache> Note this is very useful with try / catch blocks so that you can still produce old cached data if an exception occurs, eg your database goes down.
DecoratorMapper: The DecoratorMapper is responsible for determining which Decorator should be used for a Page . Implementations of this are returned by the Factory , and should be thread-safe.
LRUCache: LRU (Least Recently Used) algorithm for the cache. Since release 2.3 this class requires Java 1.4 to use the LinkedHashSet . Use prior OSCache release which require the Jakarta commons-collections SequencedHashMap class or the LinkedList class if neither of the above classes are available. No synchronization is required in this class since the AbstractConcurrentReadCache already takes care of any synchronization requirements.
WebEntryRefreshPolicy: Interface to implement an entry refresh policy. Specify the name of the implementing class using the refreshpolicyclass attribute of the cache tag. If any additional parameters are required, they should be supplied using the refreshpolicyparam attribute. For example: <cache:cache key="mykey" refreshpolicyclass="com.mycompany.cache.policy.MyRefreshPolicy" refreshpolicyparam="...additional data..."> My cached content </cache:cache>
CacheTag: CacheTag is a tag that allows for server-side caching of post-processed JSP content. It also gives great programatic control over refreshing, flushing and updating the cache. Usage Example: <%@ taglib uri="oscache" prefix="cache" %> <cache:cache key="mycache" scope="application" refresh="false" time="30"> jsp content here... refreshed every 30 seconds </cache:cache>

Home | Contact Us | Privacy Policy | Terms of Service