Source code: org/acegisecurity/intercept/InterceptorStatusToken.java
1 /* Copyright 2004 Acegi Technology Pty Limited
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 package org.acegisecurity.intercept;
17
18 import org.acegisecurity.Authentication;
19 import org.acegisecurity.ConfigAttributeDefinition;
20
21
22 /**
23 * A return object received by {@link AbstractSecurityInterceptor} subclasses.
24 *
25 * <P>
26 * This class reflects the status of the security interception, so that the
27 * final call to {@link
28 * org.acegisecurity.intercept.AbstractSecurityInterceptor#afterInvocation(InterceptorStatusToken,
29 * Object)} can tidy up correctly.
30 * </p>
31 *
32 * @author Ben Alex
33 * @version $Id: InterceptorStatusToken.java,v 1.3 2005/11/17 00:55:51 benalex Exp $
34 */
35 public class InterceptorStatusToken {
36 //~ Instance fields ========================================================
37
38 private Authentication authentication;
39 private ConfigAttributeDefinition attr;
40 private Object secureObject;
41 private boolean contextHolderRefreshRequired;
42
43 //~ Constructors ===========================================================
44
45 public InterceptorStatusToken(Authentication authentication,
46 boolean contextHolderRefreshRequired, ConfigAttributeDefinition attr,
47 Object secureObject) {
48 this.authentication = authentication;
49 this.contextHolderRefreshRequired = contextHolderRefreshRequired;
50 this.attr = attr;
51 this.secureObject = secureObject;
52 }
53
54 protected InterceptorStatusToken() {
55 throw new IllegalArgumentException("Cannot use default constructor");
56 }
57
58 //~ Methods ================================================================
59
60 public ConfigAttributeDefinition getAttr() {
61 return attr;
62 }
63
64 public Authentication getAuthentication() {
65 return authentication;
66 }
67
68 public boolean isContextHolderRefreshRequired() {
69 return contextHolderRefreshRequired;
70 }
71
72 public Object getSecureObject() {
73 return secureObject;
74 }
75 }