Author: konstantin.mishin
Date: 2008-10-06 14:13:47 -0400 (Mon, 06 Oct 2008)
New Revision: 10674
Added:
trunk/sandbox/samples/queue-sample/
trunk/sandbox/samples/queue-sample/pom.xml
trunk/sandbox/samples/queue-sample/src/
trunk/sandbox/samples/queue-sample/src/main/
trunk/sandbox/samples/queue-sample/src/main/java/
trunk/sandbox/samples/queue-sample/src/main/java/org/
trunk/sandbox/samples/queue-sample/src/main/java/org/richfaces/
trunk/sandbox/samples/queue-sample/src/main/java/org/richfaces/Bean.java
trunk/sandbox/samples/queue-sample/src/main/webapp/
trunk/sandbox/samples/queue-sample/src/main/webapp/META-INF/
trunk/sandbox/samples/queue-sample/src/main/webapp/META-INF/MANIFEST.MF
trunk/sandbox/samples/queue-sample/src/main/webapp/WEB-INF/
trunk/sandbox/samples/queue-sample/src/main/webapp/WEB-INF/faces-config.xml
trunk/sandbox/samples/queue-sample/src/main/webapp/WEB-INF/web.xml
trunk/sandbox/samples/queue-sample/src/main/webapp/index.jsp
trunk/sandbox/samples/queue-sample/src/main/webapp/pages/
trunk/sandbox/samples/queue-sample/src/main/webapp/pages/index.jsp
trunk/sandbox/samples/queue-sample/src/main/webapp/pages/index.xhtml
trunk/sandbox/samples/queue-sample/src/test/
trunk/sandbox/samples/queue-sample/src/test/java/
trunk/sandbox/samples/queue-sample/src/test/java/org/
trunk/sandbox/samples/queue-sample/src/test/java/org/richfaces/
trunk/sandbox/samples/queue-sample/src/test/java/org/richfaces/BeanTest.java
trunk/sandbox/ui/queue/
trunk/sandbox/ui/queue/pom.xml
trunk/sandbox/ui/queue/src/
trunk/sandbox/ui/queue/src/main/
trunk/sandbox/ui/queue/src/main/config/
trunk/sandbox/ui/queue/src/main/config/component/
trunk/sandbox/ui/queue/src/main/config/component/queue.xml
trunk/sandbox/ui/queue/src/main/java/
trunk/sandbox/ui/queue/src/main/java/org/
trunk/sandbox/ui/queue/src/main/java/org/ajax4jsf/
trunk/sandbox/ui/queue/src/main/java/org/ajax4jsf/taglib/
trunk/sandbox/ui/queue/src/main/java/org/ajax4jsf/taglib/html/
trunk/sandbox/ui/queue/src/main/java/org/ajax4jsf/taglib/html/facelets/
trunk/sandbox/ui/queue/src/main/java/org/ajax4jsf/taglib/html/facelets/QueueHandler.java
trunk/sandbox/ui/queue/src/main/java/org/ajax4jsf/taglib/html/jsp/
trunk/sandbox/ui/queue/src/main/java/org/ajax4jsf/taglib/html/jsp/QueueTag.java
Modified:
trunk/sandbox/samples/pom.xml
trunk/sandbox/ui/pom.xml
Log:
Modified: trunk/sandbox/samples/pom.xml
===================================================================
--- trunk/sandbox/samples/pom.xml 2008-10-06 17:25:49 UTC (rev 10673)
+++ trunk/sandbox/samples/pom.xml 2008-10-06 18:13:47 UTC (rev 10674)
@@ -18,5 +18,6 @@
<!--module>contextMenuDemo</module-->
<module>fileUploadPOC</module>
<module>editor-sample</module>
+ <module>queue-sample</module>
</modules>
</project>
\ No newline at end of file
Property changes on: trunk/sandbox/samples/queue-sample
___________________________________________________________________
Name: svn:ignore
+ .project
.settings
.classpath
target
Added: trunk/sandbox/samples/queue-sample/pom.xml
===================================================================
--- trunk/sandbox/samples/queue-sample/pom.xml (rev 0)
+++ trunk/sandbox/samples/queue-sample/pom.xml 2008-10-06 18:13:47 UTC (rev 10674)
@@ -0,0 +1,37 @@
+<?xml version="1.0"?><project>
+ <parent>
+ <artifactId>samples</artifactId>
+ <groupId>org.richfaces.sandbox</groupId>
+ <version>3.3.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces</groupId>
+ <artifactId>queue-sample</artifactId>
+ <packaging>war</packaging>
+ <name>queue-sample Maven Webapp</name>
+ <version>3.3.0-SNAPSHOT</version>
+ <build>
+ <finalName>queue-sample</finalName>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.sandbox.ui</groupId>
+ <artifactId>queue</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added: trunk/sandbox/samples/queue-sample/src/main/java/org/richfaces/Bean.java
===================================================================
--- trunk/sandbox/samples/queue-sample/src/main/java/org/richfaces/Bean.java
(rev 0)
+++ trunk/sandbox/samples/queue-sample/src/main/java/org/richfaces/Bean.java 2008-10-06
18:13:47 UTC (rev 10674)
@@ -0,0 +1,29 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces;
+/**
+ * @author $Autor$
+ *
+ */
+public class Bean {
+
+}
\ No newline at end of file
Added: trunk/sandbox/samples/queue-sample/src/main/webapp/META-INF/MANIFEST.MF
===================================================================
--- trunk/sandbox/samples/queue-sample/src/main/webapp/META-INF/MANIFEST.MF
(rev 0)
+++ trunk/sandbox/samples/queue-sample/src/main/webapp/META-INF/MANIFEST.MF 2008-10-06
18:13:47 UTC (rev 10674)
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+
Added: trunk/sandbox/samples/queue-sample/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/sandbox/samples/queue-sample/src/main/webapp/WEB-INF/faces-config.xml
(rev 0)
+++ trunk/sandbox/samples/queue-sample/src/main/webapp/WEB-INF/faces-config.xml 2008-10-06
18:13:47 UTC (rev 10674)
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces
Config 1.1//EN"
+
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
+<faces-config>
+ <managed-bean>
+ <managed-bean-name>bean</managed-bean-name>
+ <managed-bean-class>org.richfaces.Bean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+</faces-config>
Added: trunk/sandbox/samples/queue-sample/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/sandbox/samples/queue-sample/src/main/webapp/WEB-INF/web.xml
(rev 0)
+++ trunk/sandbox/samples/queue-sample/src/main/webapp/WEB-INF/web.xml 2008-10-06 18:13:47
UTC (rev 10674)
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+ <display-name>Archetype Created Web Application</display-name>
+ <context-param>
+ <param-name>javax.faces.CONFIG_FILES</param-name>
+ <param-value>/WEB-INF/faces-config.xml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+ <!--
+ -->
+ <filter>
+ <display-name>Ajax4jsf Filter</display-name>
+ <filter-name>ajax4jsf</filter-name>
+ <filter-class>org.ajax4jsf.Filter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>ajax4jsf</filter-name>
+ <servlet-name>Faces Servlet</servlet-name>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>FORWARD</dispatcher>
+ <dispatcher>INCLUDE</dispatcher>
+ <dispatcher>ERROR</dispatcher>
+ </filter-mapping>
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>/faces/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ </login-config>
+</web-app>
Added: trunk/sandbox/samples/queue-sample/src/main/webapp/index.jsp
===================================================================
--- trunk/sandbox/samples/queue-sample/src/main/webapp/index.jsp
(rev 0)
+++ trunk/sandbox/samples/queue-sample/src/main/webapp/index.jsp 2008-10-06 18:13:47 UTC
(rev 10674)
@@ -0,0 +1,11 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+
+<html>
+
+<head></head>
+
+ <body>
+ <jsp:forward page="/pages/index.jsf" />
+ </body>
+
+</html>
\ No newline at end of file
Added: trunk/sandbox/samples/queue-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/sandbox/samples/queue-sample/src/main/webapp/pages/index.jsp
(rev 0)
+++ trunk/sandbox/samples/queue-sample/src/main/webapp/pages/index.jsp 2008-10-06 18:13:47
UTC (rev 10674)
@@ -0,0 +1,21 @@
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib
uri="http://richfaces.org/a4j" prefix="a4j" %>
+<%@ taglib
uri="http://labs.jboss.com/jbossrichfaces/ui/ui/queue"
prefix="q"%>
+<html>
+ <head>
+ <title></title>
+ </head>
+ <body>
+ <f:view>
+ <h:form>
+ <q:queue name="queue" requestDelay="1000"/>
+ <h:outputText id ="outputText"
value="Test"></h:outputText>
+ <a4j:commandButton value="commandButton1"
reRender="outputText" eventsQueue="queue"/>
+ <a4j:commandButton value="commandButton2"
reRender="outputText" eventsQueue="queue"/>
+ <a4j:commandButton value="commandButton3"
reRender="outputText" eventsQueue="queue"/>
+ <a4j:commandButton value="commandButton4"
reRender="outputText" eventsQueue="queue"/>
+ </h:form>
+ </f:view>
+ </body>
+</html>
Added: trunk/sandbox/samples/queue-sample/src/main/webapp/pages/index.xhtml
===================================================================
--- trunk/sandbox/samples/queue-sample/src/main/webapp/pages/index.xhtml
(rev 0)
+++ trunk/sandbox/samples/queue-sample/src/main/webapp/pages/index.xhtml 2008-10-06
18:13:47 UTC (rev 10674)
@@ -0,0 +1,12 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:c="http://java.sun.com/jsp/jstl/core"
+ >
+ <f:view>
+
+ </f:view>
+</html>
\ No newline at end of file
Added: trunk/sandbox/samples/queue-sample/src/test/java/org/richfaces/BeanTest.java
===================================================================
--- trunk/sandbox/samples/queue-sample/src/test/java/org/richfaces/BeanTest.java
(rev 0)
+++
trunk/sandbox/samples/queue-sample/src/test/java/org/richfaces/BeanTest.java 2008-10-06
18:13:47 UTC (rev 10674)
@@ -0,0 +1,46 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+*/
+public class BeanTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public BeanTest( String testName )
+ {
+ super( testName );
+ }
+
+ public void testStub() throws Exception {
+
+ }
+}
Modified: trunk/sandbox/ui/pom.xml
===================================================================
--- trunk/sandbox/ui/pom.xml 2008-10-06 17:25:49 UTC (rev 10673)
+++ trunk/sandbox/ui/pom.xml 2008-10-06 18:13:47 UTC (rev 10674)
@@ -19,5 +19,6 @@
<!--module>rex-button</module-->
<module>sortableHeader</module>
<module>editor</module>
+ <module>queue</module>
</modules>
</project>
\ No newline at end of file
Property changes on: trunk/sandbox/ui/queue
___________________________________________________________________
Name: svn:ignore
+ .classpath
.project
.settings
target
Added: trunk/sandbox/ui/queue/pom.xml
===================================================================
--- trunk/sandbox/ui/queue/pom.xml (rev 0)
+++ trunk/sandbox/ui/queue/pom.xml 2008-10-06 18:13:47 UTC (rev 10674)
@@ -0,0 +1,50 @@
+<?xml version="1.0"?><project>
+ <parent>
+ <artifactId>ui</artifactId>
+ <groupId>org.richfaces.sandbox</groupId>
+ <version>3.3.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.sandbox.ui</groupId>
+ <artifactId>queue</artifactId>
+ <name>queue</name>
+ <version>3.3.0-SNAPSHOT</version>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ <version>3.3.0-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <library>
+ <prefix>org.richfaces.ui</prefix>
+ <taglib>
+ <shortName>queue</shortName>
+ </taglib>
+ </library>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>richfaces-impl</artifactId>
+ <version>3.3.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added: trunk/sandbox/ui/queue/src/main/config/component/queue.xml
===================================================================
--- trunk/sandbox/ui/queue/src/main/config/component/queue.xml
(rev 0)
+++ trunk/sandbox/ui/queue/src/main/config/component/queue.xml 2008-10-06 18:13:47 UTC
(rev 10674)
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN"
"http://labs.jboss.com/jbossrichfaces/component-config.dtd">
+<components>
+ <component>
+ <name>org.richfaces.Queue</name>
+ <family>org.richfaces.Queue</family>
+ <classname>org.richfaces.component.html.HtmlQueue</classname>
+ <superclass>javax.faces.component.UIComponentBase</superclass>
+ <description>
+ <![CDATA[The <rich:queue> tag.]]>
+ </description>
+ <tag generate="false" bodyContent="empty">
+ <name>queue</name>
+ <classname>org.ajax4jsf.taglib.html.jsp.QueueTag</classname>
+ <test/>
+ </tag>
+ <taghandler >
+ <classname>org.ajax4jsf.taglib.html.facelets.QueueHandler</classname>
+ </taghandler>
+ <property>
+ <name>name</name>
+ <classname>java.lang.String</classname>
+ <description>A name of this queue.</description>
+ </property>
+ <property >
+ <name>limitToList</name>
+ <classname>boolean</classname>
+ <description>If "true", updates on client side ONLY elements
from this 'reRender' property. If "false" (default) updates all rendered
by ajax region components</description>
+ </property>
+ <property >
+ <name>requestDelay</name>
+ <classname>int</classname>
+ <description>
+ Attribute defines the time (in ms.) that the request will be wait in the queue before it
is ready to send.
+ When the delay time is over, the request will be sent to the server or removed if the
newest 'similar' request is in a queue already
+ </description>
+ </property>
+ <property>
+ <name>ignoreDupResponses</name>
+ <classname>boolean</classname>
+ <description>
+ Attribute allows to ignore an Ajax Response produced by a request if the newest
'similar' request is
+ in a queue already. ignoreDupResponses="true" does not cancel the request
while it is processed on the server,
+ but just allows to avoid unnecessary updates on the client side if the response
isn't actual now
+ </description>
+ </property>
+ <property>
+ <name>timeout</name>
+ <classname>int</classname>
+ <description>Response waiting time on a particular request. If a response is not
received during this time, the request is aborted</description>
+ </property>
+ </component>
+</components>
Added:
trunk/sandbox/ui/queue/src/main/java/org/ajax4jsf/taglib/html/facelets/QueueHandler.java
===================================================================
---
trunk/sandbox/ui/queue/src/main/java/org/ajax4jsf/taglib/html/facelets/QueueHandler.java
(rev 0)
+++
trunk/sandbox/ui/queue/src/main/java/org/ajax4jsf/taglib/html/facelets/QueueHandler.java 2008-10-06
18:13:47 UTC (rev 10674)
@@ -0,0 +1,73 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.taglib.html.facelets;
+
+import java.io.IOException;
+
+import javax.el.ELException;
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+
+import org.ajax4jsf.model.QueueImpl;
+
+import com.sun.facelets.FaceletContext;
+import com.sun.facelets.FaceletException;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.tag.TagConfig;
+import com.sun.facelets.tag.TagHandler;
+
+/**
+ * @author Konstantin Mishin
+ *
+ */
+public class QueueHandler extends TagHandler {
+
+ private final TagAttribute name;
+
+ private final TagAttribute requestDelay;
+
+ private final TagAttribute timeout;
+
+ private final TagAttribute ignoreDupResponses;
+
+ private final TagAttribute limitToList;
+
+ public QueueHandler(TagConfig config) {
+ super(config);
+ name = getAttribute("name");
+ requestDelay = getAttribute("requestDelay");
+ timeout = getAttribute("timeout");
+ ignoreDupResponses = getAttribute("ignoreDupResponses");
+ limitToList = getAttribute("limitToList");
+ }
+
+ public void apply(FaceletContext ctx, UIComponent parent)
+ throws IOException, FacesException, FaceletException, ELException {
+ QueueImpl queue = new QueueImpl();
+ queue.setIgnoreDupResponsesExpression(ignoreDupResponses.getValueExpression(ctx,
Boolean.class));
+ queue.setLimitToListExpression(limitToList.getValueExpression(ctx, Boolean.class));
+ queue.setNameExpression(name.getValueExpression(ctx, String.class));
+ queue.setRequestDelayExpression(requestDelay.getValueExpression(ctx, Integer.class));
+ queue.setTimeoutExpression(timeout.getValueExpression(ctx, Integer.class));
+ }
+
+}
Added: trunk/sandbox/ui/queue/src/main/java/org/ajax4jsf/taglib/html/jsp/QueueTag.java
===================================================================
--- trunk/sandbox/ui/queue/src/main/java/org/ajax4jsf/taglib/html/jsp/QueueTag.java
(rev 0)
+++
trunk/sandbox/ui/queue/src/main/java/org/ajax4jsf/taglib/html/jsp/QueueTag.java 2008-10-06
18:13:47 UTC (rev 10674)
@@ -0,0 +1,73 @@
+package org.ajax4jsf.taglib.html.jsp;
+
+import javax.el.ValueExpression;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.Tag;
+import javax.servlet.jsp.tagext.TagSupport;
+
+import org.ajax4jsf.model.QueueImpl;
+import org.ajax4jsf.model.QueuesManager;
+
+/**
+ * @author Konstantin Mishin
+ *
+ */
+public class QueueTag extends TagSupport {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 2597802287523562588L;
+
+ private ValueExpression name;
+
+ private ValueExpression requestDelay;
+
+ private ValueExpression timeout;
+
+ private ValueExpression ignoreDupResponses;
+
+ private ValueExpression limitToList;
+
+ public int doStartTag() throws JspException {
+ QueueImpl queue = new QueueImpl();
+ queue.setIgnoreDupResponsesExpression(ignoreDupResponses);
+ queue.setLimitToListExpression(limitToList);
+ queue.setNameExpression(name);
+ queue.setRequestDelayExpression(requestDelay);
+ queue.setTimeoutExpression(timeout);
+
+ QueuesManager.put(queue);
+
+ return Tag.SKIP_BODY;
+ }
+
+ public void release() {
+ name = null;
+ requestDelay = null;
+ timeout = null;
+ ignoreDupResponses = null;
+ limitToList = null;
+ super.release();
+ }
+
+ public void setName(ValueExpression name) {
+ this.name = name;
+ }
+
+ public void setRequestDelay(ValueExpression requestDelay) {
+ this.requestDelay = requestDelay;
+ }
+
+ public void setTimeout(ValueExpression timeout) {
+ this.timeout = timeout;
+ }
+
+ public void setIgnoreDupResponses(ValueExpression ignoreDupResponses) {
+ this.ignoreDupResponses = ignoreDupResponses;
+ }
+
+ public void setLimitToList(ValueExpression limitToList) {
+ this.limitToList = limitToList;
+ }
+}