KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > webflow > conversation > Conversation


1 /*
2  * Copyright 2002-2006 the original author or authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.springframework.webflow.conversation;
17
18 /**
19  * A service interface for working with state associated with a single logical
20  * user interaction called a "conversation".
21  * <p>
22  * A conversation provides a "task" context that is begun and eventually ends.
23  * Between the beginning and the end attributes can be placed in and read from a
24  * conversation's context.
25  * <p>
26  * Once begun, the conversation can be locked to obtain exclusive access to
27  * manipulating it. Once the conversation is "done", it can be ended.
28  * <p>
29  * Note that the attributes associated with a conversation are not
30  * "conversation scope" as defined for a flow execution. They can be
31  * any attributes, possibly technical in nature, associated with the
32  * conversation.
33  *
34  * @author Keith Donald
35  */

36 public interface Conversation {
37
38     /**
39      * Returns the unique id assigned to this conversation. This id remains the
40      * same throughout the life of the conversation.
41      * @return the conversation id
42      */

43     public ConversationId getId();
44
45     /**
46      * Lock this conversation. May block until the lock is available, if someone
47      * else has acquired the lock.
48      */

49     public void lock();
50
51     /**
52      * Returns the conversation attribute with the specified name.
53      * @param name the attribute name
54      * @return the attribute value
55      */

56     public Object JavaDoc getAttribute(Object JavaDoc name);
57
58     /**
59      * Puts a conversation attribute into this context.
60      * @param name the attribute name
61      * @param value the attribute value
62      */

63     public void putAttribute(Object JavaDoc name, Object JavaDoc value);
64
65     /**
66      * Removes a conversation attribute.
67      * @param name the attribute name
68      */

69     public void removeAttribute(Object JavaDoc name);
70
71     /**
72      * Ends this conversation. This method should only be called once to
73      * terminate the conversation and cleanup any allocated resources.
74      */

75     public void end();
76
77     /**
78      * Unlock this conversation, making it available for others for
79      * manipulation.
80      */

81     public void unlock();
82 }
Popular Tags