Author: nickarls
Date: 2009-03-06 05:44:07 -0500 (Fri, 06 Mar 2009)
New Revision: 1784
Added:
examples/trunk/conversations/src/main/java/org/jboss/webbeans/examples/conversations/Data.java
Modified:
examples/trunk/conversations/WebContent/home.xhtml
examples/trunk/conversations/src/main/java/org/jboss/webbeans/examples/conversations/Conversations.java
Log:
new stuff broken in completely fresh and improved ways.
Modified: examples/trunk/conversations/WebContent/home.xhtml
===================================================================
--- examples/trunk/conversations/WebContent/home.xhtml 2009-03-06 10:23:40 UTC (rev 1783)
+++ examples/trunk/conversations/WebContent/home.xhtml 2009-03-06 10:44:07 UTC (rev 1784)
@@ -8,6 +8,7 @@
<ui:define name="content">
<h:form>
<h:panelGrid columns="1">
+ <h:inputText value="#{data.data}" />
<h:outputText value="Long-running:
#{conversations.conversationList}"/>
<h:outputText value="Current: #{conversation}"/>
<h:panelGroup>
@@ -15,7 +16,7 @@
<h:commandButton action="#{conversations.noop}"
value="noop"/>
<h:commandButton action="#{conversation.end}"
value="end"/>
<h:commandButton action="#{conversations.abandon}"
value="abandon"/>
- <h:commandButton action="#{conversations.longop}"
value="longop"/>
+ <h:commandButton action="#{data.longop}"
value="longop"/>
</h:panelGroup>
<h:inputText value="#{conversations.cid}"/>
<h:commandButton action="#{conversations.switchConversation}"
value="switch"/>
Modified:
examples/trunk/conversations/src/main/java/org/jboss/webbeans/examples/conversations/Conversations.java
===================================================================
---
examples/trunk/conversations/src/main/java/org/jboss/webbeans/examples/conversations/Conversations.java 2009-03-06
10:23:40 UTC (rev 1783)
+++
examples/trunk/conversations/src/main/java/org/jboss/webbeans/examples/conversations/Conversations.java 2009-03-06
10:44:07 UTC (rev 1784)
@@ -63,17 +63,6 @@
return longRunningConversations;
}
- public void longop() {
- try
- {
- Thread.sleep(5000);
- }
- catch (InterruptedException e)
- {
- // non-issue
- }
- }
-
public void switchConversation()
{
conversation.begin(cid);
Added:
examples/trunk/conversations/src/main/java/org/jboss/webbeans/examples/conversations/Data.java
===================================================================
---
examples/trunk/conversations/src/main/java/org/jboss/webbeans/examples/conversations/Data.java
(rev 0)
+++
examples/trunk/conversations/src/main/java/org/jboss/webbeans/examples/conversations/Data.java 2009-03-06
10:44:07 UTC (rev 1784)
@@ -0,0 +1,50 @@
+package org.jboss.webbeans.examples.conversations;
+
+import javax.context.ConversationScoped;
+import javax.annotation.Named;
+import javax.annotation.PreDestroy;
+
+import org.jboss.webbeans.log.LogProvider;
+import org.jboss.webbeans.log.Logging;
+
+import java.io.Serializable;
+
+@ConversationScoped
+@Named
+public class Data implements Serializable
+{
+ private static LogProvider log = Logging.getLogProvider(Data.class);
+ private String data;
+
+ public Data()
+ {
+ }
+
+ public String getData()
+ {
+ return data;
+ }
+
+ public void setData(String data)
+ {
+ this.data = data;
+ }
+
+ public void longop() {
+ try
+ {
+ Thread.sleep(5000);
+ }
+ catch (InterruptedException e)
+ {
+ // non-issue
+ }
+ }
+
+ @PreDestroy
+ public void bye()
+ {
+ log.info("Data " + data + " destroyed");
+ }
+
+}
\ No newline at end of file