Skip to content

Commit

Permalink
minor. short conversation timeout for example
Browse files Browse the repository at this point in the history
  • Loading branch information
nickarls committed Mar 6, 2009
1 parent 4d8b58b commit 2ef3b2e
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
7 changes: 7 additions & 0 deletions conversations/WebContent/WEB-INF/beans.xml
@@ -0,0 +1,7 @@
<Beans xmlns="urn:java:ee" xmlns:conversations="urn:java:org.jboss.webbeans.examples.conversations">
<Deploy>
<Standard />
<Production />
<conversations:Example />
</Deploy>
</Beans>
Expand Up @@ -12,10 +12,12 @@

import java.io.Serializable;

import org.jboss.webbeans.WebBean;
import org.jboss.webbeans.conversation.ConversationIdGenerator;
import org.jboss.webbeans.conversation.ConversationManager;
import org.jboss.webbeans.conversation.bindings.ConversationInactivityTimeout;


@SessionScoped
@Named("conversations")
public class Conversations implements Serializable {
Expand All @@ -29,6 +31,14 @@ public Conversations()
{
}

@Produces
@ConversationInactivityTimeout
@Example
public static long getConversationTimeoutInMilliseconds()
{
return 10000;
}

public void abandon()
{
conversation.begin(id.nextId());
Expand Down
@@ -0,0 +1,20 @@
package org.jboss.webbeans.examples.conversations;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;
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.DeploymentType;

@Target( { TYPE, METHOD, FIELD })
@Retention(RUNTIME)
@Documented
@DeploymentType
public @interface Example
{
}

0 comments on commit 2ef3b2e

Please sign in to comment.