Seam SVN: r12510 - in modules/remoting/trunk: core/src/main/java/org/jboss/seam/remoting/model and 2 other directories.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-04-16 04:38:30 -0400 (Fri, 16 Apr 2010)
New Revision: 12510
Added:
modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/util/
modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/util/Strings.java
Modified:
modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/Call.java
modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/ExecutionHandler.java
modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/model/Model.java
modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/model/ModelHandler.java
modules/remoting/trunk/examples/helloworld/src/main/webapp/helloworld.xhtml
Log:
SEAMREMOTING-3
Modified: modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/Call.java
===================================================================
--- modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/Call.java 2010-04-16 07:15:06 UTC (rev 12509)
+++ modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/Call.java 2010-04-16 08:38:30 UTC (rev 12510)
@@ -17,6 +17,7 @@
import javax.enterprise.inject.spi.BeanManager;
import org.jboss.seam.remoting.annotations.WebRemote;
+import org.jboss.seam.remoting.util.Strings;
import org.jboss.seam.remoting.wrapper.ConversionException;
import org.jboss.seam.remoting.wrapper.ConversionScore;
import org.jboss.seam.remoting.wrapper.Wrapper;
@@ -58,7 +59,7 @@
{
Class<?> beanType = Class.forName(beanName);
- Annotation[] q = qualifiers != null && !qualifiers.isEmpty() ?
+ Annotation[] q = qualifiers != null && !Strings.isEmpty(qualifiers) ?
new AnnotationsParser(beanType, qualifiers, beanManager).getAnnotations() :
EMPTY_ANNOTATIONS;
Modified: modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/ExecutionHandler.java
===================================================================
--- modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/ExecutionHandler.java 2010-04-16 07:15:06 UTC (rev 12509)
+++ modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/ExecutionHandler.java 2010-04-16 08:38:30 UTC (rev 12510)
@@ -16,6 +16,7 @@
import org.dom4j.Document;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
+import org.jboss.seam.remoting.util.Strings;
import org.jboss.seam.remoting.wrapper.Wrapper;
import org.jboss.weld.conversation.ConversationManager;
import org.slf4j.Logger;
@@ -68,7 +69,7 @@
final Element env = doc.getRootElement();
final RequestContext ctx = new RequestContext(env.element("header"));
- if (ctx.getConversationId() != null && !ctx.getConversationId().isEmpty())
+ if (ctx.getConversationId() != null && !Strings.isEmpty(ctx.getConversationId()))
{
// this is non portable ;/
conversationManager.beginOrRestoreConversation(ctx.getConversationId());
Modified: modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/model/Model.java
===================================================================
--- modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/model/Model.java 2010-04-16 07:15:06 UTC (rev 12509)
+++ modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/model/Model.java 2010-04-16 08:38:30 UTC (rev 12510)
@@ -16,6 +16,7 @@
import org.jboss.seam.remoting.AnnotationsParser;
import org.jboss.seam.remoting.Call;
import org.jboss.seam.remoting.CallContext;
+import org.jboss.seam.remoting.util.Strings;
/**
* Manages a model request
@@ -156,7 +157,7 @@
{
Class<?> beanType = Class.forName(beanName);
- Annotation[] q = qualifiers != null && !qualifiers.isEmpty() ?
+ Annotation[] q = qualifiers != null && !Strings.isEmpty(qualifiers) ?
new AnnotationsParser(beanType, qualifiers, beanManager).getAnnotations() :
Call.EMPTY_ANNOTATIONS;
Modified: modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/model/ModelHandler.java
===================================================================
--- modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/model/ModelHandler.java 2010-04-16 07:15:06 UTC (rev 12509)
+++ modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/model/ModelHandler.java 2010-04-16 08:38:30 UTC (rev 12510)
@@ -24,6 +24,7 @@
import org.jboss.seam.remoting.MarshalUtils;
import org.jboss.seam.remoting.RequestContext;
import org.jboss.seam.remoting.RequestHandler;
+import org.jboss.seam.remoting.util.Strings;
import org.jboss.seam.remoting.wrapper.BagWrapper;
import org.jboss.seam.remoting.wrapper.BeanWrapper;
import org.jboss.seam.remoting.wrapper.MapWrapper;
@@ -81,7 +82,7 @@
// written it, and non-portable code should be abstracted out
conversationContext = Container.instance().services().get(ContextLifecycle.class).getConversationContext();
- if (ctx.getConversationId() != null && !ctx.getConversationId().isEmpty())
+ if (ctx.getConversationId() != null && !Strings.isEmpty(ctx.getConversationId()))
{
conversationContext.setBeanStore(new ConversationBeanStore(
request.getSession(), false, ctx.getConversationId()));
Added: modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/util/Strings.java
===================================================================
--- modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/util/Strings.java (rev 0)
+++ modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/util/Strings.java 2010-04-16 08:38:30 UTC (rev 12510)
@@ -0,0 +1,22 @@
+package org.jboss.seam.remoting.util;
+
+public class Strings
+{
+ public static boolean isEmpty(String string)
+ {
+ int len;
+ if (string == null || (len = string.length()) == 0)
+ {
+ return true;
+ }
+
+ for (int i = 0; i < len; i++)
+ {
+ if ((Character.isWhitespace(string.charAt(i)) == false))
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+}
Modified: modules/remoting/trunk/examples/helloworld/src/main/webapp/helloworld.xhtml
===================================================================
--- modules/remoting/trunk/examples/helloworld/src/main/webapp/helloworld.xhtml 2010-04-16 07:15:06 UTC (rev 12509)
+++ modules/remoting/trunk/examples/helloworld/src/main/webapp/helloworld.xhtml 2010-04-16 08:38:30 UTC (rev 12510)
@@ -1,8 +1,7 @@
<!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:ui="http://java.sun.com/jsf/facelets"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:s="http://jboss.com/products/seam/taglib">
+ xmlns:h="http://java.sun.com/jsf/html">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
16 years
Seam SVN: r12509 - modules/servlet/trunk/docs/reference/src/main/docbook/en-US.
by seam-commits@lists.jboss.org
Author: nickarls
Date: 2010-04-16 03:15:06 -0400 (Fri, 16 Apr 2010)
New Revision: 12509
Added:
modules/servlet/trunk/docs/reference/src/main/docbook/en-US/events.xml
Log:
docs update
Added: modules/servlet/trunk/docs/reference/src/main/docbook/en-US/events.xml
===================================================================
--- modules/servlet/trunk/docs/reference/src/main/docbook/en-US/events.xml (rev 0)
+++ modules/servlet/trunk/docs/reference/src/main/docbook/en-US/events.xml 2010-04-16 07:15:06 UTC (rev 12509)
@@ -0,0 +1,585 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+ "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" []>
+<chapter id="events">
+ <title>Servlet event propagation</title>
+ <para>
+ By including the seam-servlet module in your web application you will also have the
+ servlet lifecycle events propagated to the CDI event bridge so you can observe them in your beans.
+ The event bridge works by installing a servlet listener and firing events on the BeanManager with
+ associated qualifiers, passing along the event object.
+ </para>
+
+ <section id="events.installation">
+ <title>Installation</title>
+ <para>
+ The event bridge is installed automatically by including the seam-servlet.jar and seam-servlet-api.jar
+ in the web application library folder. If you are using Maven as your build tool, you can add the
+ following dependency:
+ </para>
+ <programlisting role="XML"><![CDATA[
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>seam-servlet</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ </dependency>]]></programlisting>
+ </section>
+ <section id="events.session_lifecycle_listener">
+ <title>The session lifecycle listener</title>
+ <para>
+ These events correspond to the interface <literal>javax.servlet.HttpSessionListener</literal>
+ The event object fired is a <literal>javax.servlet.http.HttpSessionEvent</literal> and there are
+ two qualifiers available that can be used for selecting the initialization or destruction of
+ the session.
+ </para>
+ <para>
+ <informaltable>
+ <tgroup cols="2">
+ <colspec colnum="1" colwidth="1*" />
+ <colspec colnum="2" colwidth="3*" />
+ <thead>
+ <row>
+ <entry>Qualifier</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>@Created</entry>
+ <entry>Qualifies the creation event</entry>
+ </row>
+ <row>
+ <entry>@Destroyed</entry>
+ <entry>Qualifies the destruction event</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ <para>
+ If you want to listen to both lifecycle events, leave out the qualifiers. Note that omitting all qualifiers will
+ observe all events with a <literal>HttpSessionEvent</literal> as event object and these include the activation
+ and passivation events.
+ <programlisting role="Java">
+ public void observeSession(@Observes HttpSessionEvent e)
+ {
+ // Do something with the "session lifecycle" event object
+ }
+ </programlisting>
+ If you are interested in only a particular one, use a qualifer
+ <programlisting role="Java">
+ public void observeSessionCreated(@Observes @Created HttpSessionEvent e)
+ {
+ // Do something with the "session created" event object
+ }
+ </programlisting>
+ The name of the observer method is insignificant.
+ </para>
+ </section>
+ <section id="events.session_activation_listener">
+ <title>The session activation listener</title>
+ <para>
+ These events correspond to the interface <literal>javax.servlet.HttpSessionActivationListener</literal>
+ The event object fired is a <literal>javax.servlet.http.HttpSessionEvent</literal> and there are
+ two qualifiers available that can be used for selecting the activation or passivation of
+ the session.
+ </para>
+ <para>
+ <informaltable>
+ <tgroup cols="2">
+ <colspec colnum="1" colwidth="1*" />
+ <colspec colnum="2" colwidth="3*" />
+ <thead>
+ <row>
+ <entry>Qualifier</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>@DidActivate</entry>
+ <entry>Qualifies the activation event</entry>
+ </row>
+ <row>
+ <entry>@WillPassivate</entry>
+ <entry>Qualifies the passivation event</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ <para>
+ If you want to listen to both lifecycle events, leave out the qualifiers. Note that omitting all qualifiers will
+ observe all events with a <literal>HttpSessionEvent</literal> as event object and these include the session
+ lifecycle events.
+ <programlisting role="Java">
+ public void observeSession(@Observes HttpSessionEvent e)
+ {
+ // Do something with the "session activation" event object
+ }
+ </programlisting>
+ If you are interested in only a particular one, use a qualifer
+ <programlisting role="Java">
+ public void observeSessionCreated(@Observes @WillPassivate HttpSessionEvent e)
+ {
+ // Do something with the "session will passivate" event object
+ }
+ </programlisting>
+ The name of the observer method is insignificant.
+ </para>
+ </section>
+ <section id="events.session_attribute_listener">
+ <title>The servlet context attribute listener</title>
+ <para>
+ These events correspond to the interface <literal>javax.servlet.http.HttpSessionAttributeListener</literal>
+ The event object fired is a <literal>javax.servlet.http.HttpSessionBindingEvent</literal> and there are
+ three qualifiers available that can be used for selecting the adding, removing or replacing of an
+ attribute in the servlet context. The <literal>@Attribute</literal> qualifier can further narrow down
+ the events to attributes with a particular name.
+ </para>
+ <para>
+ <informaltable>
+ <tgroup cols="2">
+ <colspec colnum="1" colwidth="1*" />
+ <colspec colnum="2" colwidth="3*" />
+ <thead>
+ <row>
+ <entry>Qualifier</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>@Added</entry>
+ <entry>Qualifies the adding of an attribute</entry>
+ </row>
+ <row>
+ <entry>@Removed</entry>
+ <entry>Qualifies the removal of an attribute</entry>
+ </row>
+ <row>
+ <entry>@Replaced</entry>
+ <entry>Qualifies the replacing of an attribute</entry>
+ </row>
+ <row>
+ <entry>@Attribute</entry>
+ <entry>Qualifies the name of an attribute</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ <para>
+ If you want to listen to all attribute events, leave out the qualifiers. Note that omitting all qualifiers will
+ observe all events with a <literal>HttpSessionBindingEvent</literal> as event object and these include the session
+ binding events.
+ <programlisting role="Java">
+ public void observeSessionAttribute(@Observes HttpSessionBindingEvent e)
+ {
+ // Do something with the "session attribute" event object
+ }
+ </programlisting>
+ If you are interested in only a particular type, use a type qualifer
+ <programlisting role="Java">
+ public void observeSessionAttributeAdded(@Observes @Added HttpSessionBindingEvent e)
+ {
+ // Do something with the "session attribute added" event object
+ }
+ </programlisting>
+ If you are interested in all events for a partical attribute, use
+ <programlisting role="Java">
+ public void observeFooAttribute(@Observes @Attribute("foo") HttpSessionBindingEvent e)
+ {
+ // Do something with the "'foo' attribute changed" event object
+ }
+ </programlisting>
+ By combining a type qualifier with the <literal>@Attribute</literal> qualifier, the tightest
+ filtering can be achieved
+ <programlisting role="Java">
+ public void observeFooAttributeRemoved(@Observes @Attribute("foo") @Removed HttpSessionBindingEvent e)
+ {
+ // Do something with the "'foo' attribute removed" event object
+ }
+ </programlisting>
+ The name of the observer method is insignificant.
+ </para>
+ </section>
+ <section id="events.session_binding_listener">
+ <title>The session binding listener</title>
+ <para>
+ These events correspond to the interface <literal>javax.servlet.http.HttpSessionBindingListener</literal>
+ The event object fired is a <literal>javax.servlet.http.HttpSessionBindingEvent</literal> and there are
+ two qualifiers available that can be used for selecting the binding or unbinding of an
+ value in the session. The <literal>@Value</literal> qualifier can further narrow down
+ the events to values with a particular name.
+ </para>
+ <para>
+ <informaltable>
+ <tgroup cols="2">
+ <colspec colnum="1" colwidth="1*" />
+ <colspec colnum="2" colwidth="3*" />
+ <thead>
+ <row>
+ <entry>Qualifier</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>@Bound</entry>
+ <entry>Qualifies the binding of a value</entry>
+ </row>
+ <row>
+ <entry>@Unbound</entry>
+ <entry>Qualifies the unbinding of a value</entry>
+ </row>
+ <row>
+ <entry>@Value</entry>
+ <entry>Qualifies the name of a value</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ <para>
+ If you want to listen to all binding events, leave out the qualifiers. Note that omitting all qualifiers will
+ observe all events with a <literal>HttpSessionBindingEvent</literal> as event object and these include the session
+ attribute modifying events.
+ <programlisting role="Java">
+ public void observeSessionBinding(@Observes HttpSessionBindingEvent e)
+ {
+ // Do something with the "session binding" event object
+ }
+ </programlisting>
+ If you are interested in only a particular type, use a type qualifer
+ <programlisting role="Java">
+ public void observeSessionValueBound(@Observes @Bound HttpSessionBindingEvent e)
+ {
+ // Do something with the "session value bound" event object
+ }
+ </programlisting>
+ If you are interested in all events for a partical attribute, use
+ <programlisting role="Java">
+ public void observeFooAttribute(@Observes @Value("foo") HttpSessionBindingEvent e)
+ {
+ // Do something with the "'foo' value changed" event object
+ }
+ </programlisting>
+ By combining a type qualifier with the <literal>@Value</literal> qualifier, the tightest
+ filtering can be achieved
+ <programlisting role="Java">
+ public void observeFooValueBound(@Observes @Value("foo") @Bound HttpSessionBindingEvent e)
+ {
+ // Do something with the "'foo' value bound" event object
+ }
+ </programlisting>
+ The name of the observer method is insignificant.
+ </para>
+ </section>
+ <section id="events.servlet_context_lifecycle_listener">
+ <title>The servlet context lifecycle listener</title>
+ <para>
+ These events correspond to the interface <literal>javax.servlet.ServletContextListener</literal>
+ The event object fired is a <literal>javax.servlet.ServletContextEvent</literal> and there are
+ two qualifiers available that can be used for selecting the initialization or destruction of
+ the servlet context.
+ </para>
+ <para>
+ <informaltable>
+ <tgroup cols="2">
+ <colspec colnum="1" colwidth="1*" />
+ <colspec colnum="2" colwidth="3*" />
+ <thead>
+ <row>
+ <entry>Qualifier</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>@Initialized</entry>
+ <entry>Qualifies the creation event</entry>
+ </row>
+ <row>
+ <entry>@Destroyed</entry>
+ <entry>Qualifies the destruction event</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ <para>
+ If you want to listen to both lifecycle events, leave out the qualifiers
+ <programlisting role="Java">
+ public void observeServletContext(@Observes ServletContextEvent e)
+ {
+ // Do something with the "servlet context lifecycle" event object
+ }
+ </programlisting>
+ If you are interested in only a particular one, use a qualifer
+ <programlisting role="Java">
+ public void observeServletContextCreated(@Observes @Initialized ServletContextEvent e)
+ {
+ // Do something with the "servlet context initialized" event object
+ }
+ </programlisting>
+ The name of the observer method is insignificant.
+ </para>
+ </section>
+ <section id="events.servlet_context_attribute_listener">
+ <title>The servlet context attribute listener</title>
+ <para>
+ These events correspond to the interface <literal>javax.servlet.ServletContextAttributeListener</literal>
+ The event object fired is a <literal>javax.servlet.ServletContextAttributeEvent</literal> and there are
+ three qualifiers available that can be used for selecting the adding, removing or replacing of an
+ attribute in the servlet context. The <literal>@Attribute</literal> qualifier can further narrow down
+ the events to attributes with a particular name.
+ </para>
+ <para>
+ <informaltable>
+ <tgroup cols="2">
+ <colspec colnum="1" colwidth="1*" />
+ <colspec colnum="2" colwidth="3*" />
+ <thead>
+ <row>
+ <entry>Qualifier</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>@Added</entry>
+ <entry>Qualifies the adding of an attribute</entry>
+ </row>
+ <row>
+ <entry>@Removed</entry>
+ <entry>Qualifies the removal of an attribute</entry>
+ </row>
+ <row>
+ <entry>@Replaced</entry>
+ <entry>Qualifies the replacing of an attribute</entry>
+ </row>
+ <row>
+ <entry>@Attribute</entry>
+ <entry>Qualifies the name of an attribute</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ <para>
+ If you want to listen to all attribute events, leave out the qualifiers
+ <programlisting role="Java">
+ public void observeServletContextAttribute(@Observes ServletContextAttributeEvent e)
+ {
+ // Do something with the "servlet context attribute" event object
+ }
+ </programlisting>
+ If you are interested in only a particular type, use a type qualifer
+ <programlisting role="Java">
+ public void observeServletContextAttributeAdded(@Observes @Added ServletContextAttributeEvent e)
+ {
+ // Do something with the "servlet context attribute added" event object
+ }
+ </programlisting>
+ If you are interested in all events for a partical attribute, use
+ <programlisting role="Java">
+ public void observeFooAttribute(@Observes @Attribute("foo") ServletContextAttributeEvent e)
+ {
+ // Do something with the "'foo' attribute changed" event object
+ }
+ </programlisting>
+ By combining a type qualifier with the <literal>@Attribute</literal> qualifier, the tightest
+ filtering can be achieved
+ <programlisting role="Java">
+ public void observeFooAttributeRemoved(@Observes @Attribute("foo") @Removed ServletContextAttributeEvent e)
+ {
+ // Do something with the "'foo' attribute removed" event object
+ }
+ </programlisting>
+ The name of the observer method is insignificant.
+ </para>
+ </section>
+ <section id="events.servlet_request_listener">
+ <title>The servlet request lifecycle listener</title>
+ <para>
+ These events correspond to the interface <literal>javax.servlet.ServletRequestListener</literal>
+ The event object fired is a <literal>javax.servlet.ServletRequestEvent</literal> and there are
+ two qualifiers available that can be used for selecting the initialization or destruction of
+ the request.
+ </para>
+ <para>
+ <informaltable>
+ <tgroup cols="2">
+ <colspec colnum="1" colwidth="1*" />
+ <colspec colnum="2" colwidth="3*" />
+ <thead>
+ <row>
+ <entry>Qualifier</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>@Initialized</entry>
+ <entry>Qualifies the initialization event</entry>
+ </row>
+ <row>
+ <entry>@Destroyed</entry>
+ <entry>Qualifies the destruction event</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ <para>
+ If you want to listen to both lifecycle events, leave out the qualifiers.
+ <programlisting role="Java">
+ public void observeRequest(@Observes ServletRequestEvent e)
+ {
+ // Do something with the "servlet request lifecycle" event object
+ }
+ </programlisting>
+ If you are interested in only a particular one, use a qualifer
+ <programlisting role="Java">
+ public void observeRequestInitialized(@Observes @Initialized ServletRequestEvent e)
+ {
+ // Do something with the "request initialized" event object
+ }
+ </programlisting>
+ The name of the observer method is insignificant.
+ </para>
+ </section>
+ <section id="events.servlet_request_attribute_listener">
+ <title>The servlet context attribute listener</title>
+ <para>
+ These events correspond to the interface <literal>javax.servlet.ServletRequestAttributeListener</literal>
+ The event object fired is a <literal>javax.servlet.ServletRequestAttributeEvent</literal> and there are
+ three qualifiers available that can be used for selecting the adding, removing or replacing of an
+ attribute in the servlet request. The <literal>@Attribute</literal> qualifier can further narrow down
+ the events to attributes with a particular name.
+ </para>
+ <para>
+ <informaltable>
+ <tgroup cols="2">
+ <colspec colnum="1" colwidth="1*" />
+ <colspec colnum="2" colwidth="3*" />
+ <thead>
+ <row>
+ <entry>Qualifier</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>@Added</entry>
+ <entry>Qualifies the adding of an attribute</entry>
+ </row>
+ <row>
+ <entry>@Removed</entry>
+ <entry>Qualifies the removal of an attribute</entry>
+ </row>
+ <row>
+ <entry>@Replaced</entry>
+ <entry>Qualifies the replacing of an attribute</entry>
+ </row>
+ <row>
+ <entry>@Attribute</entry>
+ <entry>Qualifies the name of an attribute</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ <para>
+ If you want to listen to all attribute events, leave out the qualifiers
+ <programlisting role="Java">
+ public void observeServletRequestAttribute(@Observes ServletRequestAttributeEvent e)
+ {
+ // Do something with the "servlet request attribute" event object
+ }
+ </programlisting>
+ If you are interested in only a particular type, use a type qualifer
+ <programlisting role="Java">
+ public void observeServletRequestAttributeAdded(@Observes @Added ServletRequestAttributeEvent e)
+ {
+ // Do something with the "servlet request attribute added" event object
+ }
+ </programlisting>
+ If you are interested in all events for a partical attribute, use
+ <programlisting role="Java">
+ public void observeFooAttribute(@Observes @Attribute("foo") ServletRequestAttributeEvent e)
+ {
+ // Do something with the "'foo' attribute changed" event object
+ }
+ </programlisting>
+ By combining a type qualifier with the <literal>@Attribute</literal> qualifier, the tightest
+ filtering can be achieved
+ <programlisting role="Java">
+ public void observeFooAttributeRemoved(@Observes @Attribute("foo") @Removed ServletRequestAttributeEvent e)
+ {
+ // Do something with the "'foo' attribute removed" event object
+ }
+ </programlisting>
+ The name of the observer method is insignificant.
+ </para>
+ </section>
+ <section id="events.asynchronous_listener">
+ <title>The servlet context attribute listener</title>
+ <para>
+ These events correspond to the interface <literal>javax.servlet.AsyncListene</literal>
+ The event object fired is a <literal>javax.servlet.AsynchEvent</literal> and there are
+ four qualifiers available that can be used for selecting the lifecycles of an asynchronous event.
+ </para>
+ <para>
+ <informaltable>
+ <tgroup cols="2">
+ <colspec colnum="1" colwidth="1*" />
+ <colspec colnum="2" colwidth="3*" />
+ <thead>
+ <row>
+ <entry>Qualifier</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>@Completed</entry>
+ <entry>Qualifies the completion of a request</entry>
+ </row>
+ <row>
+ <entry>@Error</entry>
+ <entry>Qualifies the error in a request</entry>
+ </row>
+ <row>
+ <entry>@StartAsynch</entry>
+ <entry>Qualifies the starting of a request</entry>
+ </row>
+ <row>
+ <entry>@Timeout</entry>
+ <entry>Qualifies the timeout of a request</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ <para>
+ If you want to listen to all asynchronous events, leave out the qualifiers
+ <programlisting role="Java">
+ public void observeAsynchronousRequest(@Observes AsynchEvent e)
+ {
+ // Do something with the "asynchronous" event object
+ }
+ </programlisting>
+ If you are interested in only a particular type, use a type qualifer
+ <programlisting role="Java">
+ public void observeAsynchronousRequestTimedOut(@Observes @Timeout AsynchEvent e)
+ {
+ // Do something with the "request timed out" event object
+ }
+ </programlisting>
+ The name of the observer method is insignificant.
+ </para>
+ </section>
+
+</chapter>
\ No newline at end of file
16 years
Seam SVN: r12508 - modules/servlet/trunk/docs/reference/src/main/docbook/en-US.
by seam-commits@lists.jboss.org
Author: nickarls
Date: 2010-04-16 03:14:03 -0400 (Fri, 16 Apr 2010)
New Revision: 12508
Modified:
modules/servlet/trunk/docs/reference/src/main/docbook/en-US/master.xml
Log:
docs update
Modified: modules/servlet/trunk/docs/reference/src/main/docbook/en-US/master.xml
===================================================================
--- modules/servlet/trunk/docs/reference/src/main/docbook/en-US/master.xml 2010-04-15 20:59:16 UTC (rev 12507)
+++ modules/servlet/trunk/docs/reference/src/main/docbook/en-US/master.xml 2010-04-16 07:14:03 UTC (rev 12508)
@@ -8,6 +8,7 @@
<toc />
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="preface.xml" />
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="events.xml" />
<!--
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="chapterXX.xml" />
16 years
Seam SVN: r12507 - in modules/international/trunk: impl/src/main/java/org/jboss/seam/international/timezone and 2 other directories.
by seam-commits@lists.jboss.org
Author: kenfinni
Date: 2010-04-15 16:59:16 -0400 (Thu, 15 Apr 2010)
New Revision: 12507
Added:
modules/international/trunk/api/src/main/java/org/jboss/seam/international/timezone/Changed.java
modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/test/
modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/test/AvailableTimeZoneBean.java
modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/test/AvailableTimeZonesTest.java
modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/test/DefaultTimeZoneTest.java
modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/test/UserTimeZoneTest.java
Removed:
modules/international/trunk/api/src/main/java/org/jboss/seam/international/timezone/DefaultTimeZone.java
modules/international/trunk/api/src/main/java/org/jboss/seam/international/timezone/TimeZones.java
modules/international/trunk/api/src/main/java/org/jboss/seam/international/timezone/events/
modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/AvailableTimeZoneBean.java
modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/AvailableTimeZonesTest.java
modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/DefaultTimeZoneTest.java
modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/UserTimeZoneTest.java
Modified:
modules/international/trunk/api/src/main/java/org/jboss/seam/international/timezone/UserTimeZone.java
modules/international/trunk/impl/src/main/java/org/jboss/seam/international/timezone/AvailableTimeZones.java
modules/international/trunk/impl/src/main/java/org/jboss/seam/international/timezone/DefaultTimeZoneProducer.java
modules/international/trunk/impl/src/main/java/org/jboss/seam/international/timezone/TimeZoneWrapper.java
modules/international/trunk/impl/src/main/java/org/jboss/seam/international/timezone/UserTimeZoneProducer.java
Log:
SEAMINTL-1 - Refactored code based on Pete's suggestions. Added copyright headers
Added: modules/international/trunk/api/src/main/java/org/jboss/seam/international/timezone/Changed.java
===================================================================
--- modules/international/trunk/api/src/main/java/org/jboss/seam/international/timezone/Changed.java (rev 0)
+++ modules/international/trunk/api/src/main/java/org/jboss/seam/international/timezone/Changed.java 2010-04-15 20:59:16 UTC (rev 12507)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.international.timezone;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+/**
+ * Change TimeZone of the User.
+ *
+ * @author Ken Finnigan
+ */
+@Target( { PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@Qualifier
+public @interface Changed
+{
+
+}
Deleted: modules/international/trunk/api/src/main/java/org/jboss/seam/international/timezone/DefaultTimeZone.java
===================================================================
--- modules/international/trunk/api/src/main/java/org/jboss/seam/international/timezone/DefaultTimeZone.java 2010-04-15 20:12:47 UTC (rev 12506)
+++ modules/international/trunk/api/src/main/java/org/jboss/seam/international/timezone/DefaultTimeZone.java 2010-04-15 20:59:16 UTC (rev 12507)
@@ -1,27 +0,0 @@
-package org.jboss.seam.international.timezone;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import javax.inject.Qualifier;
-
-/**
- * Default Application TimeZone
- *
- * @author Ken Finnigan
- */
-@Target( { METHOD, PARAMETER, FIELD })
-@Retention(RUNTIME)
-@Documented
-@Qualifier
-@Inherited
-public @interface DefaultTimeZone
-{
-}
Deleted: modules/international/trunk/api/src/main/java/org/jboss/seam/international/timezone/TimeZones.java
===================================================================
--- modules/international/trunk/api/src/main/java/org/jboss/seam/international/timezone/TimeZones.java 2010-04-15 20:12:47 UTC (rev 12506)
+++ modules/international/trunk/api/src/main/java/org/jboss/seam/international/timezone/TimeZones.java 2010-04-15 20:59:16 UTC (rev 12507)
@@ -1,27 +0,0 @@
-package org.jboss.seam.international.timezone;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import javax.inject.Qualifier;
-
-/**
- * Qualifier for Time Zones
- *
- * @author Ken Finnigan
- */
-@Target( { METHOD, PARAMETER, FIELD })
-@Retention(RUNTIME)
-@Documented
-@Qualifier
-@Inherited
-public @interface TimeZones
-{
-}
Modified: modules/international/trunk/api/src/main/java/org/jboss/seam/international/timezone/UserTimeZone.java
===================================================================
--- modules/international/trunk/api/src/main/java/org/jboss/seam/international/timezone/UserTimeZone.java 2010-04-15 20:12:47 UTC (rev 12506)
+++ modules/international/trunk/api/src/main/java/org/jboss/seam/international/timezone/UserTimeZone.java 2010-04-15 20:59:16 UTC (rev 12507)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.seam.international.timezone;
import static java.lang.annotation.ElementType.FIELD;
@@ -14,7 +35,7 @@
/**
* User TimeZone
- *
+ *
* @author Ken Finnigan
*/
@Target( { METHOD, PARAMETER, FIELD })
Modified: modules/international/trunk/impl/src/main/java/org/jboss/seam/international/timezone/AvailableTimeZones.java
===================================================================
--- modules/international/trunk/impl/src/main/java/org/jboss/seam/international/timezone/AvailableTimeZones.java 2010-04-15 20:12:47 UTC (rev 12506)
+++ modules/international/trunk/impl/src/main/java/org/jboss/seam/international/timezone/AvailableTimeZones.java 2010-04-15 20:59:16 UTC (rev 12507)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.seam.international.timezone;
import java.util.ArrayList;
@@ -6,60 +27,69 @@
import java.util.List;
import java.util.TimeZone;
+import javax.annotation.PostConstruct;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Produces;
-import javax.inject.Inject;
/**
- * <p>Seam component that provides a list of time zones, limited to time zones
- * with IDs in the form Continent/Place, excluding deprecated three-letter time
- * zone IDs. The time zones returned have a fixed offset from UTC, which takes
+ * <p>
+ * Seam component that provides a list of time zones, limited to time zones with
+ * IDs in the form Continent/Place, excluding deprecated three-letter time zone
+ * IDs. The time zones returned have a fixed offset from UTC, which takes
* daylight savings time into account. For example, Europe/Amsterdam is UTC+1;
- * in winter this is GMT+1 and in summer GMT+2.</p>
- *
- * <p>The time zone objects returned are wrapped in an implementation of
- * TimeZone that provides a more friendly interface for accessing the time zone
+ * in winter this is GMT+1 and in summer GMT+2.
+ * </p>
+ *
+ * <p>
+ * The time zone objects returned are wrapped in an implementation of TimeZone
+ * that provides a more friendly interface for accessing the time zone
* information. In particular, this type provides a more bean-friend property
* for the time zone id (id than ID) and provides a convenience property named
* label that formats the time zone for display in the UI. This wrapper can be
- * disabled by setting the component property wrap to false.</p>
- *
+ * disabled by setting the component property wrap to false.
+ * </p>
+ *
* @author Peter Hilton, Lunatech Research
* @author Dan Allen
*/
@ApplicationScoped
public class AvailableTimeZones
{
- private static final String TIMEZONE_ID_PREFIXES =
- "^(Africa|America|Asia|Atlantic|Australia|Europe|Indian|Pacific)/.*";
+ private static final String TIMEZONE_ID_PREFIXES = "^(Africa|America|Asia|Atlantic|Australia|Europe|Indian|Pacific)/.*";
private boolean wrap = true;
@Produces
- @TimeZones
private List<TimeZone> timeZones = null;
-
- @Inject
- public void init() {
+
+ @PostConstruct
+ public void init()
+ {
timeZones = new ArrayList<TimeZone>();
final String[] timeZoneIds = TimeZone.getAvailableIDs();
- for (final String id : timeZoneIds) {
- if (id.matches(TIMEZONE_ID_PREFIXES)) {
+ for (final String id : timeZoneIds)
+ {
+ if (id.matches(TIMEZONE_ID_PREFIXES))
+ {
timeZones.add(wrap ? new TimeZoneWrapper(TimeZone.getTimeZone(id)) : TimeZone.getTimeZone(id));
}
}
- Collections.sort(timeZones, new Comparator<TimeZone>() {
- public int compare(final TimeZone a, final TimeZone b) {
+ Collections.sort(timeZones, new Comparator<TimeZone>()
+ {
+ public int compare(final TimeZone a, final TimeZone b)
+ {
return a.getID().compareTo(b.getID());
}
});
}
- public boolean isWrap() {
+ public boolean isWrap()
+ {
return wrap;
}
- public void setWrap(boolean wrap) {
+ public void setWrap(boolean wrap)
+ {
this.wrap = wrap;
}
}
Modified: modules/international/trunk/impl/src/main/java/org/jboss/seam/international/timezone/DefaultTimeZoneProducer.java
===================================================================
--- modules/international/trunk/impl/src/main/java/org/jboss/seam/international/timezone/DefaultTimeZoneProducer.java 2010-04-15 20:12:47 UTC (rev 12506)
+++ modules/international/trunk/impl/src/main/java/org/jboss/seam/international/timezone/DefaultTimeZoneProducer.java 2010-04-15 20:59:16 UTC (rev 12507)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.seam.international.timezone;
import java.io.Serializable;
@@ -3,14 +24,13 @@
import java.util.TimeZone;
+import javax.annotation.PostConstruct;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Produces;
-import javax.inject.Inject;
import javax.inject.Named;
/**
- * Default TimeZone of the application. If configuration of the default
- * TimeZone is found that will be used, otherwise the JVM default TimeZone
- * otherwise.
- *
+ * Default TimeZone of the application. If configuration of the default TimeZone
+ * is found that will be used, otherwise the JVM default TimeZone otherwise.
+ *
* @author Ken Finnigan
*/
@@ -21,10 +41,11 @@
{
private static final long serialVersionUID = 6181892144731122500L;
- @Produces @DefaultTimeZone @Named
+ @Produces
+ @Named
private TimeZone defaultTimeZone;
- @Inject
+ @PostConstruct
public void init()
{
defaultTimeZone = TimeZone.getDefault();
Modified: modules/international/trunk/impl/src/main/java/org/jboss/seam/international/timezone/TimeZoneWrapper.java
===================================================================
--- modules/international/trunk/impl/src/main/java/org/jboss/seam/international/timezone/TimeZoneWrapper.java 2010-04-15 20:12:47 UTC (rev 12506)
+++ modules/international/trunk/impl/src/main/java/org/jboss/seam/international/timezone/TimeZoneWrapper.java 2010-04-15 20:59:16 UTC (rev 12507)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.seam.international.timezone;
import java.util.Date;
@@ -5,9 +26,9 @@
/**
* A wrapper around a TimeZone that provides a more convenience interface to
- * access the time zone information in the UI, in particular in the options of
- * a select menu.
- *
+ * access the time zone information in the UI, in particular in the options of a
+ * select menu.
+ *
* @author Dan Allen
*/
public class TimeZoneWrapper extends TimeZone
@@ -18,85 +39,102 @@
private TimeZone timeZone;
- public TimeZoneWrapper(TimeZone tz) {
+ public TimeZoneWrapper(TimeZone tz)
+ {
timeZone = tz;
setID(tz.getID());
}
@Override
- public void setID(String id) {
+ public void setID(String id)
+ {
super.setID(id);
timeZone = TimeZone.getTimeZone(id);
}
- public String getId() {
+ public String getId()
+ {
return timeZone.getID();
}
- public String getLabel() {
+ public String getLabel()
+ {
StringBuilder label = new StringBuilder(50);
label.append(getId().replace("_", " "));
label.append(" (UTC");
label.append(timeZone.getRawOffset() > 0 ? "+" : "-");
- if (Math.abs(timeZone.getRawOffset()) < MILLISECONDS_PER_HOUR * 10) {
+ if (Math.abs(timeZone.getRawOffset()) < MILLISECONDS_PER_HOUR * 10)
+ {
label.append("0");
}
- label.append(Math.abs(timeZone.getRawOffset())/MILLISECONDS_PER_HOUR);
+ label.append(Math.abs(timeZone.getRawOffset()) / MILLISECONDS_PER_HOUR);
label.append(":00)");
return label.toString();
}
- public TimeZone getTimeZone() {
+ public TimeZone getTimeZone()
+ {
return timeZone;
}
@Override
- public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis) {
+ public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis)
+ {
return timeZone.getOffset(era, year, month, day, dayOfWeek, millis);
}
@Override
- public void setRawOffset(int offset) {
+ public void setRawOffset(int offset)
+ {
timeZone.setRawOffset(offset);
}
@Override
- public int getRawOffset() {
+ public int getRawOffset()
+ {
return timeZone.getRawOffset();
}
@Override
- public boolean useDaylightTime() {
+ public boolean useDaylightTime()
+ {
return timeZone.useDaylightTime();
}
@Override
- public boolean inDaylightTime(Date date) {
+ public boolean inDaylightTime(Date date)
+ {
return timeZone.inDaylightTime(date);
}
@Override
- public Object clone() {
+ public Object clone()
+ {
return timeZone.clone();
}
@Override
- public boolean equals(Object obj) {
- if (obj == null) {
+ public boolean equals(Object obj)
+ {
+ if (obj == null)
+ {
return false;
}
- if (getClass() != obj.getClass()) {
+ if (getClass() != obj.getClass())
+ {
return false;
}
final TimeZoneWrapper other = (TimeZoneWrapper) obj;
- if (timeZone != other.timeZone && (timeZone == null || !timeZone.equals(other.timeZone))) {
+ if (timeZone != other.timeZone && (timeZone == null || !timeZone.equals(other.timeZone)))
+ {
return false;
}
return true;
}
@Override
- public int hashCode() {
+ public int hashCode()
+ {
int hash = 7;
hash = 79 * hash + (timeZone != null ? timeZone.hashCode() : 0);
return hash;
Modified: modules/international/trunk/impl/src/main/java/org/jboss/seam/international/timezone/UserTimeZoneProducer.java
===================================================================
--- modules/international/trunk/impl/src/main/java/org/jboss/seam/international/timezone/UserTimeZoneProducer.java 2010-04-15 20:12:47 UTC (rev 12506)
+++ modules/international/trunk/impl/src/main/java/org/jboss/seam/international/timezone/UserTimeZoneProducer.java 2010-04-15 20:59:16 UTC (rev 12507)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.seam.international.timezone;
import java.io.Serializable;
@@ -9,13 +30,10 @@
import javax.inject.Inject;
import javax.inject.Named;
-import org.jboss.seam.international.timezone.events.TimeZoneSelectedEvent;
-
/**
- * TimeZone for a User Session. Defaults to the TimeZone within
- * DefaultTimeZone and is altered when it receives the
- * TimeZoneSelectedEvent.
- *
+ * TimeZone for a User Session. Defaults to the TimeZone within DefaultTimeZone
+ * and is altered when it receives the TimeZoneSelectedEvent.
+ *
* @author Ken Finnigan
*/
@@ -24,17 +42,19 @@
{
private static final long serialVersionUID = -9008203923830420841L;
- @Produces @UserTimeZone @Named
+ @Produces
+ @UserTimeZone
+ @Named
private TimeZone userTimeZone;
@Inject
- public void init(@DefaultTimeZone TimeZone defaultTimeZone)
+ public void init(TimeZone defaultTimeZone)
{
this.userTimeZone = defaultTimeZone;
}
- public void afterTimeZoneUpdate(@Observes TimeZoneSelectedEvent event)
+ public void changeTimeZone(@Observes @Changed TimeZone tz)
{
- this.userTimeZone = TimeZone.getTimeZone(event.getTimeZoneId());
+ this.userTimeZone = tz;
}
}
Deleted: modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/AvailableTimeZoneBean.java
===================================================================
--- modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/AvailableTimeZoneBean.java 2010-04-15 20:12:47 UTC (rev 12506)
+++ modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/AvailableTimeZoneBean.java 2010-04-15 20:59:16 UTC (rev 12507)
@@ -1,24 +0,0 @@
-package org.jboss.seam.international.timezone;
-
-import java.util.List;
-import java.util.TimeZone;
-
-import javax.enterprise.context.ApplicationScoped;
-import javax.inject.Inject;
-
-@ApplicationScoped
-public class AvailableTimeZoneBean
-{
- @Inject
- @TimeZones
- private List<TimeZone> timeZones;
-
- public AvailableTimeZoneBean()
- {
- }
-
- public List<TimeZone> getAvailTimeZones()
- {
- return timeZones;
- }
-}
Deleted: modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/AvailableTimeZonesTest.java
===================================================================
--- modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/AvailableTimeZonesTest.java 2010-04-15 20:12:47 UTC (rev 12506)
+++ modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/AvailableTimeZonesTest.java 2010-04-15 20:59:16 UTC (rev 12507)
@@ -1,52 +0,0 @@
-package org.jboss.seam.international.timezone;
-
-import java.util.List;
-import java.util.TimeZone;
-
-import javax.enterprise.inject.Instance;
-import javax.inject.Inject;
-
-import org.jboss.arquillian.api.Deployment;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.seam.international.timezone.events.TimeZoneSelectedEvent;
-import org.jboss.shrinkwrap.api.ArchivePaths;
-import org.jboss.shrinkwrap.api.Archives;
-import org.jboss.shrinkwrap.api.spec.JavaArchive;
-import org.jboss.shrinkwrap.impl.base.asset.ByteArrayAsset;
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-(a)RunWith(Arquillian.class)
-public class AvailableTimeZonesTest
-{
- @Deployment
- public static JavaArchive createTestArchive()
- {
- return Archives.create("availabletimezonetest.jar", JavaArchive.class).addClasses(AvailableTimeZones.class, AvailableTimeZoneBean.class, TimeZoneWrapper.class, TimeZoneSelectedEvent.class).addManifestResource(new ByteArrayAsset(new byte[0]), ArchivePaths.create("beans.xml"));
- }
-
- @Inject
- Instance<AvailableTimeZoneBean> availBean;
- @Inject
- @TimeZones
- List<TimeZone> timeZones;
-
- @Test
- public void testAvailableTimeZonesProducerViaBean()
- {
- Assert.assertNotNull(availBean);
- List<TimeZone> list = availBean.get().getAvailTimeZones();
- Assert.assertNotNull(list);
- Assert.assertTrue(!list.isEmpty());
- Assert.assertTrue(list.size() > 0);
- }
-
- @Test
- public void testAvailableTimeZonesProducerDirect()
- {
- Assert.assertNotNull(timeZones);
- Assert.assertTrue(!timeZones.isEmpty());
- Assert.assertTrue(timeZones.size() > 0);
- }
-}
Deleted: modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/DefaultTimeZoneTest.java
===================================================================
--- modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/DefaultTimeZoneTest.java 2010-04-15 20:12:47 UTC (rev 12506)
+++ modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/DefaultTimeZoneTest.java 2010-04-15 20:59:16 UTC (rev 12507)
@@ -1,35 +0,0 @@
-package org.jboss.seam.international.timezone;
-
-import java.util.TimeZone;
-
-import javax.inject.Inject;
-
-import org.jboss.arquillian.api.Deployment;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.shrinkwrap.api.ArchivePaths;
-import org.jboss.shrinkwrap.api.Archives;
-import org.jboss.shrinkwrap.api.spec.JavaArchive;
-import org.jboss.shrinkwrap.impl.base.asset.ByteArrayAsset;
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-(a)RunWith(Arquillian.class)
-public class DefaultTimeZoneTest
-{
- @Deployment
- public static JavaArchive createTestArchive()
- {
- return Archives.create("defaulttimezonetest.jar", JavaArchive.class).addClasses(DefaultTimeZoneProducer.class, DefaultTimeZone.class).addManifestResource(new ByteArrayAsset(new byte[0]), ArchivePaths.create("beans.xml"));
- }
-
- @Inject
- @DefaultTimeZone
- TimeZone timeZone;
-
- @Test
- public void testDefaultTimeZoneProducerDirect()
- {
- Assert.assertNotNull(timeZone);
- }
-}
Deleted: modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/UserTimeZoneTest.java
===================================================================
--- modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/UserTimeZoneTest.java 2010-04-15 20:12:47 UTC (rev 12506)
+++ modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/UserTimeZoneTest.java 2010-04-15 20:59:16 UTC (rev 12507)
@@ -1,55 +0,0 @@
-package org.jboss.seam.international.timezone;
-
-import java.util.TimeZone;
-
-import javax.enterprise.event.Event;
-import javax.enterprise.inject.Instance;
-import javax.inject.Inject;
-
-import org.jboss.arquillian.api.Deployment;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.seam.international.timezone.events.TimeZoneSelectedEvent;
-import org.jboss.shrinkwrap.api.ArchivePaths;
-import org.jboss.shrinkwrap.api.Archives;
-import org.jboss.shrinkwrap.api.spec.JavaArchive;
-import org.jboss.shrinkwrap.impl.base.asset.ByteArrayAsset;
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-(a)RunWith(Arquillian.class)
-public class UserTimeZoneTest
-{
- @Deployment
- public static JavaArchive createTestArchive()
- {
- return Archives.create("usertimezonetest.jar", JavaArchive.class).addClasses(UserTimeZoneProducer.class, UserTimeZone.class, TimeZoneSelectedEvent.class, DefaultTimeZone.class, DefaultTimeZoneProducer.class).addManifestResource(new ByteArrayAsset(new byte[0]), ArchivePaths.create("beans.xml"));
- }
-
- @Inject
- @UserTimeZone
- TimeZone timeZone;
- @Inject
- Event<TimeZoneSelectedEvent> timeZoneEvent;
- @Inject
- @UserTimeZone
- Instance<TimeZone> timeZoneSource;
-
- @Test
- public void testUserTimeZoneProducerDirect()
- {
- Assert.assertNotNull(timeZone);
- }
-
- @Test
- public void testUserTimeZoneEvent()
- {
- TimeZone tijuana = TimeZone.getTimeZone("America/Tijuana");
- Assert.assertNotNull(timeZone);
- Assert.assertFalse(timeZone.equals(tijuana));
- timeZoneEvent.fire(new TimeZoneSelectedEvent("America/Tijuana"));
- TimeZone tz = timeZoneSource.get();
- Assert.assertNotNull(tz);
- Assert.assertTrue(tz.equals(tijuana));
- }
-}
Copied: modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/test/AvailableTimeZoneBean.java (from rev 12505, modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/AvailableTimeZoneBean.java)
===================================================================
--- modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/test/AvailableTimeZoneBean.java (rev 0)
+++ modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/test/AvailableTimeZoneBean.java 2010-04-15 20:59:16 UTC (rev 12507)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.international.timezone.test;
+
+import java.util.List;
+import java.util.TimeZone;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+
+@ApplicationScoped
+public class AvailableTimeZoneBean
+{
+ @Inject
+ private List<TimeZone> timeZones;
+
+ public AvailableTimeZoneBean()
+ {
+ }
+
+ public List<TimeZone> getAvailTimeZones()
+ {
+ return timeZones;
+ }
+}
Copied: modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/test/AvailableTimeZonesTest.java (from rev 12505, modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/AvailableTimeZonesTest.java)
===================================================================
--- modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/test/AvailableTimeZonesTest.java (rev 0)
+++ modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/test/AvailableTimeZonesTest.java 2010-04-15 20:59:16 UTC (rev 12507)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.international.timezone.test;
+
+import java.util.List;
+import java.util.TimeZone;
+
+import javax.enterprise.inject.Instance;
+import javax.inject.Inject;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.international.timezone.AvailableTimeZones;
+import org.jboss.seam.international.timezone.TimeZoneWrapper;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.Archives;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.impl.base.asset.ByteArrayAsset;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(Arquillian.class)
+public class AvailableTimeZonesTest
+{
+ @Deployment
+ public static JavaArchive createTestArchive()
+ {
+ return Archives.create("availabletimezonetest.jar", JavaArchive.class).addClasses(AvailableTimeZones.class, AvailableTimeZoneBean.class, TimeZoneWrapper.class).addManifestResource(new ByteArrayAsset(new byte[0]), ArchivePaths.create("beans.xml"));
+ }
+
+ @Inject
+ Instance<AvailableTimeZoneBean> availBean;
+ @Inject
+ List<TimeZone> timeZones;
+
+ @Test
+ public void testAvailableTimeZonesProducerViaBean()
+ {
+ Assert.assertNotNull(availBean);
+ List<TimeZone> list = availBean.get().getAvailTimeZones();
+ Assert.assertNotNull(list);
+ Assert.assertTrue(!list.isEmpty());
+ Assert.assertTrue(list.size() > 0);
+ }
+
+ @Test
+ public void testAvailableTimeZonesProducerDirect()
+ {
+ Assert.assertNotNull(timeZones);
+ Assert.assertTrue(!timeZones.isEmpty());
+ Assert.assertTrue(timeZones.size() > 0);
+ }
+}
Copied: modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/test/DefaultTimeZoneTest.java (from rev 12505, modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/DefaultTimeZoneTest.java)
===================================================================
--- modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/test/DefaultTimeZoneTest.java (rev 0)
+++ modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/test/DefaultTimeZoneTest.java 2010-04-15 20:59:16 UTC (rev 12507)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.international.timezone.test;
+
+import java.util.TimeZone;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.international.timezone.DefaultTimeZoneProducer;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.Archives;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.impl.base.asset.ByteArrayAsset;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(Arquillian.class)
+public class DefaultTimeZoneTest
+{
+ @Deployment
+ public static JavaArchive createTestArchive()
+ {
+ return Archives.create("defaulttimezonetest.jar", JavaArchive.class).addClasses(DefaultTimeZoneProducer.class).addManifestResource(new ByteArrayAsset(new byte[0]), ArchivePaths.create("beans.xml"));
+ }
+
+ @Inject
+ TimeZone timeZone;
+
+ @Test
+ public void testDefaultTimeZoneProducerDirect()
+ {
+ Assert.assertNotNull(timeZone);
+ }
+}
Copied: modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/test/UserTimeZoneTest.java (from rev 12505, modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/UserTimeZoneTest.java)
===================================================================
--- modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/test/UserTimeZoneTest.java (rev 0)
+++ modules/international/trunk/impl/src/test/java/org/jboss/seam/international/timezone/test/UserTimeZoneTest.java 2010-04-15 20:59:16 UTC (rev 12507)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.international.timezone.test;
+
+import java.util.TimeZone;
+
+import javax.enterprise.event.Event;
+import javax.enterprise.inject.Instance;
+import javax.inject.Inject;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.international.timezone.Changed;
+import org.jboss.seam.international.timezone.DefaultTimeZoneProducer;
+import org.jboss.seam.international.timezone.UserTimeZone;
+import org.jboss.seam.international.timezone.UserTimeZoneProducer;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.Archives;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.impl.base.asset.ByteArrayAsset;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(Arquillian.class)
+public class UserTimeZoneTest
+{
+ @Deployment
+ public static JavaArchive createTestArchive()
+ {
+ return Archives.create("usertimezonetest.jar", JavaArchive.class).addClasses(UserTimeZoneProducer.class, UserTimeZone.class, DefaultTimeZoneProducer.class).addManifestResource(new ByteArrayAsset(new byte[0]), ArchivePaths.create("beans.xml"));
+ }
+
+ @Inject
+ @UserTimeZone
+ TimeZone timeZone;
+
+ @Inject
+ @Changed
+ Event<TimeZone> timeZoneEvent;
+
+ @Inject
+ @UserTimeZone
+ Instance<TimeZone> timeZoneSource;
+
+ @Test
+ public void testUserTimeZoneProducerDirect()
+ {
+ Assert.assertNotNull(timeZone);
+ }
+
+ @Test
+ public void testUserTimeZoneEvent()
+ {
+ TimeZone tijuana = TimeZone.getTimeZone("America/Tijuana");
+ Assert.assertNotNull(timeZone);
+ Assert.assertFalse(timeZone.equals(tijuana));
+ timeZoneEvent.fire(tijuana);
+ TimeZone tz = timeZoneSource.get();
+ Assert.assertNotNull(tz);
+ Assert.assertTrue(tz.equals(tijuana));
+ }
+}
16 years
Seam SVN: r12506 - modules/international.
by seam-commits@lists.jboss.org
Author: kenfinni
Date: 2010-04-15 16:12:47 -0400 (Thu, 15 Apr 2010)
New Revision: 12506
Added:
modules/international/branches/
modules/international/tags/
Log:
Add tags and branches
16 years
Seam SVN: r12505 - branches/enterprise/JBPAPP_4_3_FP01/seam-gen/build-scripts.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-04-15 13:47:27 -0400 (Thu, 15 Apr 2010)
New Revision: 12505
Modified:
branches/enterprise/JBPAPP_4_3_FP01/seam-gen/build-scripts/build-war.xml
Log:
JBPAPP-4054
Modified: branches/enterprise/JBPAPP_4_3_FP01/seam-gen/build-scripts/build-war.xml
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/seam-gen/build-scripts/build-war.xml 2010-04-15 16:41:41 UTC (rev 12504)
+++ branches/enterprise/JBPAPP_4_3_FP01/seam-gen/build-scripts/build-war.xml 2010-04-15 17:47:27 UTC (rev 12505)
@@ -48,7 +48,7 @@
<mkdir dir="${classes.action.dir}" />
<mkdir dir="${dist.dir}" />
<!-- if a .groovy file is in model or action, set groovy.present -->
- <available property="groovy.present" value="true" file="" searchparents="true">
+ <available property="groovy.present" value="true" file="">
<filepath>
<fileset dir="${src.action.dir}">
<include name="**/*.groovy"/>
16 years
Seam SVN: r12504 - in branches/enterprise/JBPAPP_4_2_CP01/examples: hibernate/src/org/jboss/seam/example/hibernate and 3 other directories.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-04-15 12:41:41 -0400 (Thu, 15 Apr 2010)
New Revision: 12504
Modified:
branches/enterprise/JBPAPP_4_2_CP01/examples/booking/src/org/jboss/seam/example/booking/User.java
branches/enterprise/JBPAPP_4_2_CP01/examples/hibernate/src/org/jboss/seam/example/hibernate/User.java
branches/enterprise/JBPAPP_4_2_CP01/examples/hibernate2/src/org/jboss/seam/example/hibernate/User.java
branches/enterprise/JBPAPP_4_2_CP01/examples/icefaces/src/org/jboss/seam/example/booking/User.java
branches/enterprise/JBPAPP_4_2_CP01/examples/jpa/src/org/jboss/seam/example/jpa/User.java
Log:
JBPAPP-4093
Modified: branches/enterprise/JBPAPP_4_2_CP01/examples/booking/src/org/jboss/seam/example/booking/User.java
===================================================================
--- branches/enterprise/JBPAPP_4_2_CP01/examples/booking/src/org/jboss/seam/example/booking/User.java 2010-04-15 13:23:22 UTC (rev 12503)
+++ branches/enterprise/JBPAPP_4_2_CP01/examples/booking/src/org/jboss/seam/example/booking/User.java 2010-04-15 16:41:41 UTC (rev 12504)
@@ -46,7 +46,7 @@
}
@NotNull
- @Length(min=5, max=15)
+ @Length(min=4, max=15)
public String getPassword()
{
return password;
@@ -57,7 +57,7 @@
}
@Id
- @Length(min=5, max=15)
+ @Length(min=4, max=15)
@Pattern(regex="^\\w*$", message="not a valid username")
public String getUsername()
{
Modified: branches/enterprise/JBPAPP_4_2_CP01/examples/hibernate/src/org/jboss/seam/example/hibernate/User.java
===================================================================
--- branches/enterprise/JBPAPP_4_2_CP01/examples/hibernate/src/org/jboss/seam/example/hibernate/User.java 2010-04-15 13:23:22 UTC (rev 12503)
+++ branches/enterprise/JBPAPP_4_2_CP01/examples/hibernate/src/org/jboss/seam/example/hibernate/User.java 2010-04-15 16:41:41 UTC (rev 12504)
@@ -45,7 +45,7 @@
}
@NotNull
- @Length(min=5, max=15)
+ @Length(min=4, max=15)
public String getPassword()
{
return password;
@@ -56,7 +56,7 @@
}
@Id
- @Length(min=5, max=15)
+ @Length(min=4, max=15)
public String getUsername()
{
return username;
Modified: branches/enterprise/JBPAPP_4_2_CP01/examples/hibernate2/src/org/jboss/seam/example/hibernate/User.java
===================================================================
--- branches/enterprise/JBPAPP_4_2_CP01/examples/hibernate2/src/org/jboss/seam/example/hibernate/User.java 2010-04-15 13:23:22 UTC (rev 12503)
+++ branches/enterprise/JBPAPP_4_2_CP01/examples/hibernate2/src/org/jboss/seam/example/hibernate/User.java 2010-04-15 16:41:41 UTC (rev 12504)
@@ -46,7 +46,7 @@
}
@NotNull
- @Length(min=5, max=15)
+ @Length(min=4, max=15)
public String getPassword()
{
return password;
@@ -57,7 +57,7 @@
}
@Id
- @Length(min=5, max=15)
+ @Length(min=4, max=15)
@Pattern(regex="^\\w*$", message="not a valid username")
public String getUsername()
{
Modified: branches/enterprise/JBPAPP_4_2_CP01/examples/icefaces/src/org/jboss/seam/example/booking/User.java
===================================================================
--- branches/enterprise/JBPAPP_4_2_CP01/examples/icefaces/src/org/jboss/seam/example/booking/User.java 2010-04-15 13:23:22 UTC (rev 12503)
+++ branches/enterprise/JBPAPP_4_2_CP01/examples/icefaces/src/org/jboss/seam/example/booking/User.java 2010-04-15 16:41:41 UTC (rev 12504)
@@ -46,7 +46,7 @@
}
@NotNull
- @Length(min=5, max=15)
+ @Length(min=4, max=15)
public String getPassword()
{
return password;
@@ -57,7 +57,7 @@
}
@Id
- @Length(min=5, max=15)
+ @Length(min=4, max=15)
@Pattern(regex="^\\w*$", message="not a valid username")
public String getUsername()
{
Modified: branches/enterprise/JBPAPP_4_2_CP01/examples/jpa/src/org/jboss/seam/example/jpa/User.java
===================================================================
--- branches/enterprise/JBPAPP_4_2_CP01/examples/jpa/src/org/jboss/seam/example/jpa/User.java 2010-04-15 13:23:22 UTC (rev 12503)
+++ branches/enterprise/JBPAPP_4_2_CP01/examples/jpa/src/org/jboss/seam/example/jpa/User.java 2010-04-15 16:41:41 UTC (rev 12504)
@@ -46,7 +46,7 @@
}
@NotNull
- @Length(min=5, max=15)
+ @Length(min=4, max=15)
public String getPassword()
{
return password;
@@ -57,7 +57,7 @@
}
@Id
- @Length(min=5, max=15)
+ @Length(min=4, max=15)
@Pattern(regex="^\\w*$", message="not a valid username")
public String getUsername()
{
16 years
Seam SVN: r12502 - in branches/enterprise/JBPAPP_4_3_FP01: examples/blog/resources and 1 other directory.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-04-15 08:54:08 -0400 (Thu, 15 Apr 2010)
New Revision: 12502
Modified:
branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Cache.xml
branches/enterprise/JBPAPP_4_3_FP01/examples/blog/resources/treecache.xml
Log:
JBPAPP-4056 changed jboss-cache filename
Modified: branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Cache.xml
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Cache.xml 2010-04-15 10:16:53 UTC (rev 12501)
+++ branches/enterprise/JBPAPP_4_3_FP01/doc/Seam_Reference_Guide/en-US/Cache.xml 2010-04-15 12:54:08 UTC (rev 12502)
@@ -136,9 +136,9 @@
<para>
- For an EAR depoyment of Seam, we recommend that the JBossCache jars and
+ For an EAR deployment of Seam, we recommend that the JBossCache jars and
configuration go directly into the EAR. Make sure you place both
- <literal>jboss-cache.jar</literal> and <literal>jgroups.jar</literal>
+ <literal>jboss-cache-jdk50.jar</literal> and <literal>jgroups.jar</literal>
in your EAR's lib folder.
</para>
Modified: branches/enterprise/JBPAPP_4_3_FP01/examples/blog/resources/treecache.xml
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/examples/blog/resources/treecache.xml 2010-04-15 10:16:53 UTC (rev 12501)
+++ branches/enterprise/JBPAPP_4_3_FP01/examples/blog/resources/treecache.xml 2010-04-15 12:54:08 UTC (rev 12502)
@@ -8,7 +8,7 @@
<server>
- <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar"/>
+ <classpath codebase="./lib" archives="jboss-cache-jdk50.jar, jgroups.jar"/>
<!-- ==================================================================== -->
16 years
Seam SVN: r12501 - modules/international/trunk.
by seam-commits@lists.jboss.org
Author: jharting
Date: 2010-04-15 06:16:53 -0400 (Thu, 15 Apr 2010)
New Revision: 12501
Modified:
modules/international/trunk/pom.xml
Log:
Switched to 1.5 target for the module to be buildable on JDK 5.
Modified: modules/international/trunk/pom.xml
===================================================================
--- modules/international/trunk/pom.xml 2010-04-15 04:15:34 UTC (rev 12500)
+++ modules/international/trunk/pom.xml 2010-04-15 10:16:53 UTC (rev 12501)
@@ -104,10 +104,10 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
- <source>1.6</source>
- <target>1.6</target>
+ <source>1.5</source>
+ <target>1.5</target>
</configuration>
</plugin>
</plugins>
</build>
-</project>
\ No newline at end of file
+</project>
16 years