> Hyperactive >>>>>>
>> Author: Sethuraman Ramasundaram>>
1. >> Introduction >>
Do you want to display your JSP pages faster? Do you have database calls, Middleware messages and others in the same page which increases the response time? Have you ever wondered if different parts of a JSP could be processed in parallel? Enter Hyperactive. Normally you use jsp:include tag to include any JSP. Hyperactive provides hyperactive:include tag which processes the included JSP in a new thread and does not block the main thread. So if you can divide sections of page into few different includes, then by using hyperactive, you can process all the included JSPs in parallel. In the end of the page, the response from the parent and includes are collected, ordered and flushed to the client.
Hyperactive is JSP on Steroids.
In the alpha version currently, this library is in testing phase – waiting for people to test and provide feedback. You could us help by downloading and testing this. Your comments and suggestions are most important to us, please send it to email@example.com
Currently Hyperactive supports weblogic and tomcat application servers. It has not been tested in other appservers and probably might not work. We are working to add support to most of the popular app servers. Check the website for updates and do drop us a mail.
Hyperactive was designed keeping in mind the simplicity of usage. If you want to use hyperactive for a JSP, then use a <hyperactive:page> at the page starting and a closing tag </hyperactive:page> at the page end. Now if you want to include JSPs, use the <hyperactive:include> tag. This is how the JSP would like:
<%@ taglib uri="/WEB-INF/hyperactive.tld" prefix="hyperactive" %>
This is parent JSP
Some text in parent JSP
The hyperactive:page tag has an optional attribute “flushAvailableFragments”. If flushAvailableFragments is true(default), then whenever content is available it flushed in a sequential manner i.e. if child1.jsp has completed before child2.jsp, then the output till child1.jsp is flushed to the client. But if child2.jsp completes before child1.jsp, then content is not flushed, but it waits for child1.jsp’s response to be available – to maintain the sequential order in display. If flushAvailableFragments is false then only when all the content is available, the response is flushed out.
Hyperactive can be downloaded here
This was tested in Tomcat 5.0 and Weblogic 8.1, but might work in other versions of these app servers too.
Step 1: Place the hyperactive.jar in the WEB-INF\classes directory
Step 2: Extract the file hyperactive.properties to WEB-INF\classes directory. Kindly see the configuration section on know more on the properties of this file.
Step 3: Extract the file hyperactive.tld to WEB-INF directory
Download the source code here
Note: There are two packages, starting with org and edu. “org “ is the hyperactive source and “edu” is the source of concurrency library of Doug Lea.
The attributes in the hyperactive.properties are:
applicationServer=tomcat (it can be either tomcat or weblogic)
minThreadPoolSize=10 (The number of threads in the thread pool to start with)
maxThreadPoolSize=50 (The max number of threads the thread pool can use)
preallocateThreads=10 (The number to threads to create at startup)
Your comments and suggestions are most important to us, please send it to firstname.lastname@example.org