KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > security > ejb > project > support > DirBinding


1 /*
2   * JBoss, Home of Professional Open Source
3   * Copyright 2005, JBoss Inc., and individual contributors as indicated
4   * by the @authors tag. See the copyright.txt in the distribution for a
5   * full listing of individual contributors.
6   *
7   * This is free software; you can redistribute it and/or modify it
8   * under the terms of the GNU Lesser General Public License as
9   * 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 JavaDoc;
25 import javax.naming.directory.Attributes JavaDoc;
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: 37406 $
32 */

33 public class DirBinding extends Binding JavaDoc
34 {
35     private transient Attributes JavaDoc attributes;
36
37     /** Constructs an instance of a Binding given its relative name, object,
38      attributes and whether the name is relative.
39     @param obj - The possibly null object bound to name.
40     @param attributes - the attributes associated with obj
41     */

42     public DirBinding(String JavaDoc name, Object JavaDoc obj, Attributes JavaDoc attributes)
43     {
44         this(name, null, obj, true, attributes);
45     }
46     /** Constructs an instance of a Binding given its relative name, class name,
47      object, attributes and whether the name is relative.
48     @param name - The non-null string name of the object.
49     @param className - The possibly null class name of the object bound to name.
50      If null, the class name of obj is returned by getClassName(). If obj is
51      also null, getClassName() will return null.
52     @param obj - The possibly null object bound to name.
53     @param attributes - the attributes associated with obj
54     */

55     public DirBinding(String JavaDoc name, String JavaDoc className, Object JavaDoc obj, Attributes JavaDoc attributes)
56     {
57         this(name, className, obj, true, attributes);
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 JavaDoc name, String JavaDoc className, Object JavaDoc obj, boolean isRelative,
69         Attributes JavaDoc attributes)
70     {
71         super(name, className, obj, isRelative);
72         this.attributes = attributes;
73     }
74
75     public Attributes JavaDoc getAttributes()
76     {
77         return attributes;
78     }
79     public void setAttributes(Attributes JavaDoc attributes)
80     {
81         this.attributes = attributes;
82     }
83 }
84
Popular Tags