01: /*
02: * JBoss, Home of Professional Open Source.
03: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
04: * as indicated by the @author tags. See the copyright.txt file in the
05: * distribution for a full listing of individual contributors.
06: *
07: * This is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU Lesser General Public License as
09: * published by the Free Software Foundation; either version 2.1 of
10: * the License, or (at your option) any later version.
11: *
12: * This software is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: *
17: * You should have received a copy of the GNU Lesser General Public
18: * License along with this software; if not, write to the Free
19: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21: */
22: package org.jboss.test.security.ejb.project.support;
23:
24: import javax.naming.Binding;
25: import javax.naming.directory.Attributes;
26:
27: /** A subclass of Binding that adds support for Attributes. This class is used
28: to pass a contexts raw bindings to NameBindingIterator.
29:
30: @author Scott_Stark@displayscape.com
31: @version $Revision: 57211 $
32: */
33: public class DirBinding extends Binding {
34: private transient Attributes attributes;
35:
36: /** Constructs an instance of a Binding given its relative name, object,
37: attributes and whether the name is relative.
38: @param obj - The possibly null object bound to name.
39: @param attributes - the attributes associated with obj
40: */
41: public DirBinding(String name, Object obj, Attributes attributes) {
42: this (name, null, obj, true, attributes);
43: }
44:
45: /** Constructs an instance of a Binding given its relative name, class name,
46: object, attributes and whether the name is relative.
47: @param name - The non-null string name of the object.
48: @param className - The possibly null class name of the object bound to name.
49: If null, the class name of obj is returned by getClassName(). If obj is
50: also null, getClassName() will return null.
51: @param obj - The possibly null object bound to name.
52: @param attributes - the attributes associated with obj
53: */
54: public DirBinding(String name, String className, Object obj,
55: Attributes attributes) {
56: this (name, className, obj, true, attributes);
57: }
58:
59: /** Constructs an instance of a Binding given its name, object, attributes
60: and whether the name is relative.
61: @param name - The non-null string name of the object.
62: @param obj - The possibly null object bound to name.
63: @param isRelative - true if name is a name relative to the target context
64: (which is named by the first parameter of the listBindings() method);
65: false if name is a URL string.
66: @param attributes - the attributes associated with obj
67: */
68: public DirBinding(String name, String className, Object obj,
69: boolean isRelative, Attributes attributes) {
70: super (name, className, obj, isRelative);
71: this .attributes = attributes;
72: }
73:
74: public Attributes getAttributes() {
75: return attributes;
76: }
77:
78: public void setAttributes(Attributes attributes) {
79: this.attributes = attributes;
80: }
81: }
|