1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 """Provides information about the running context of the application."""
17
18
20 """C{IApplicationContext} provides information about the running context
21 of the application. Each context is shared by all applications that are
22 open for one user. In a web-environment this corresponds to a HttpSession.
23
24 @author: Vaadin Ltd.
25 @author: Richard Lincoln
26 @version: 1.1.2
27 """
28
30 """Returns application context base directory.
31
32 Typically an application is deployed in a such way that is has an
33 application directory. For web applications this directory is the root
34 directory of the web applications. In some cases applications might not
35 have an application directory.
36
37 @return: The application base directory or C{None} if the application
38 has no base directory.
39 """
40 raise NotImplementedError
41
42
44 """Returns a collection of all the applications in this context.
45
46 Each application context contains all active applications for one user.
47
48 @return: A collection containing all the applications in this context.
49 """
50 raise NotImplementedError
51
52
53 - def addTransactionListener(self, listener):
54 """Adds a transaction listener to this context. The transaction
55 listener is called before and after each each request related to this
56 session except when serving static resources.
57
58 The transaction listener must not be C{None}.
59 """
60 raise NotImplementedError
61
62
64 """Removes a transaction listener from this context.
65
66 @param listener:
67 the listener to be removed.
68 @see: ITransactionListener
69 """
70 raise NotImplementedError
71
72
73 - def generateApplicationResourceURL(self, resource, urlKey):
74 """Generate a URL that can be used as the relative location of e.g. an
75 L{ApplicationResource}.
76
77 This method should only be called from the processing of a UIDL
78 request, not from a background thread. The return value is null if used
79 outside a suitable request.
80
81 @deprecated: this method is intended for terminal implementation only
82 and is subject to change/removal from the interface (to
83 L{AbstractCommunicationManager})
84
85 @param resource:
86 @param urlKey:
87 a key for the resource that can later be extracted from a URL
88 with L{getURLKey}
89 """
90 raise NotImplementedError
91
92
93 - def isApplicationResourceURL(self, context, relativeUri):
94 """Tests if a URL is for an application resource (APP/...).
95
96 @deprecated: this method is intended for terminal implementation only
97 and is subject to change/removal from the interface (to
98 L{AbstractCommunicationManager})
99 """
100 raise NotImplementedError
101
102
103 - def getURLKey(self, context, relativeUri):
104 """Gets the identifier (key) from an application resource URL. This key
105 is the one that was given to L{generateApplicationResourceURL} when
106 creating the URL.
107
108 @deprecated: this method is intended for terminal implementation only
109 and is subject to change/removal from the interface (to
110 L{AbstractCommunicationManager})
111 """
112 raise NotImplementedError
113
114
116 """Interface for listening to transaction events. Implement this interface
117 to listen to all transactions between the client and the application.
118 """
119
121 """Invoked at the beginning of every transaction.
122
123 The transaction is linked to the context, not the application so if
124 you have multiple applications running in the same context you need
125 to check that the request is associated with the application you are
126 interested in. This can be done looking at the application parameter.
127
128 @param application:
129 the Application object.
130 @param transactionData:
131 the Data identifying the transaction.
132 """
133 raise NotImplementedError
134
135
137 """Invoked at the end of every transaction.
138
139 The transaction is linked to the context, not the application so if
140 you have multiple applications running in the same context you need
141 to check that the request is associated with the application you are
142 interested in. This can be done looking at the application parameter.
143
144 @param application:
145 the application object.
146 @param transactionData:
147 the data identifying the transaction.
148 """
149 raise NotImplementedError
150