01: /**
02: * JOnAS: Java(TM) Open Application Server
03: * Copyright (C) 1999-2004 Bull S.A.
04: * Contact: jonas-team@objectweb.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2.1 of the License, or any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public
17: * License along with this library; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19: * USA
20: *
21: * --------------------------------------------------------------------------
22: * $Id: SecurityServiceContext.java 4804 2004-05-25 15:13:29Z benoitf $
23: * --------------------------------------------------------------------------
24: *
25: */package org.objectweb.jonas.security.interceptors.jrmp;
26:
27: // jonas import
28: import org.objectweb.carol.rmi.jrmp.interceptor.JServiceContext;
29: import org.objectweb.security.context.SecurityContext;
30:
31: /**
32: * Class <code>SecurityServiceContext</code> is a JRMP Class for Security
33: * Context Propagation
34: * @author Guillaume Riviere
35: * @version 1.0, 10/03/2003
36: */
37: public class SecurityServiceContext implements JServiceContext {
38:
39: /**
40: * context id
41: */
42: private int context_id;
43:
44: /**
45: * the JServiceContext id
46: */
47: public int getContextId() {
48: return context_id;
49: }
50:
51: /**
52: * Security Context
53: */
54: SecurityContext sctx = null;
55:
56: /**
57: * Empty constructor for Externalizable
58: */
59: public SecurityServiceContext() {
60: this .context_id = ServerSecurityInterceptor.SEC_CTX_ID;
61: }
62:
63: /**
64: * constructor
65: * @param int the context_id
66: * @param SecurityContext the RMI (Serializable) Security Context
67: */
68: public SecurityServiceContext(int context_id, SecurityContext sctx) {
69: this .context_id = ServerSecurityInterceptor.SEC_CTX_ID;
70: this .sctx = sctx;
71: }
72:
73: /**
74: * get the security context
75: * @return SecurityContext the Security context
76: */
77: public SecurityContext getSecurityContext() {
78: return sctx;
79: }
80:
81: }
|