01: /**
02: * Copyright 2006 Webmedia Group Ltd.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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: **/package org.araneaframework.framework;
16:
17: import java.io.Serializable;
18:
19: /**
20: * TransactionContext filters routing of duplicate requests. The detection of
21: * duplicate requests is achieved through defining a transaction id
22: * <code>by getTransactionId()</code> and checking its consistency with
23: * <code>isConsistent()</code>
24: *
25: * @author "Toomas Römer" <toomas@webmedia.ee>
26: * @author Jevgeni Kabanov (ekabanov <i>at</i> araneaframework <i>dot</i> org)
27: */
28: public interface TransactionContext extends Serializable {
29: /**
30: * The key in the request, under which is the transaction id.
31: */
32: public static final String TRANSACTION_ID_KEY = "araTransactionId";
33:
34: /**
35: * The key in the request that indicates situation where transaction id
36: * was overrriden on purpose.
37: */
38: public static final String OVERRIDE_KEY = "override";
39:
40: /**
41: * Returns true if current request is consistent (not a rerecurring one).
42: */
43: public boolean isConsistent();
44:
45: /**
46: * Returns the transaction id of the current request.
47: */
48: public Object getTransactionId();
49:
50: /**
51: * Returns the transaction id expected in the next request.
52: * @since 1.1
53: */
54: public Long getNextTransactionId();
55: }
|