jdk/src/share/classes/com/sun/jndi/toolkit/ctx/PartialCompositeDirContext.java
author jjg
Wed, 10 Aug 2011 13:44:58 -0700
changeset 10324 e28265130e4f
parent 5506 202f599c92aa
permissions -rw-r--r--
7072353: JNDI libraries do not build with javac -Xlint:all -Werror Reviewed-by: xuelei Contributed-by: alexandre.boulgakov@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
10324
e28265130e4f 7072353: JNDI libraries do not build with javac -Xlint:all -Werror
jjg
parents: 5506
diff changeset
     2
 * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package com.sun.jndi.toolkit.ctx;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.util.Hashtable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import javax.naming.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import javax.naming.directory.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import javax.naming.spi.DirectoryManager;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * Inherit from AtomicContext so that subclasses of PartialCompositeDirContext
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * can get the ns methods defined in subclasses of PartialCompositeContext.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * Direct subclasses of DirContext should provide implementations for
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * the p_ abstract DirContext methods and override the p_ Context methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * (not abstract anymore because they are overridden by ComponentContext
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * (the superclass of AtomicContext)).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * @author Rosanna Lee
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
public abstract class PartialCompositeDirContext
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
        extends AtomicContext implements DirContext {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
    protected PartialCompositeDirContext() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
        _contextType = _PARTIAL;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
// ------ Abstract methods whose implementation come from subclasses
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
     /* Equivalent to DirContext methods */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
     protected abstract Attributes p_getAttributes(Name name, String[] attrIds,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
                                                     Continuation cont)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
         throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
     protected abstract void p_modifyAttributes(Name name, int mod_op,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
                                                Attributes attrs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
                                                Continuation cont)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
         throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
     protected abstract void p_modifyAttributes(Name name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
                                                ModificationItem[] mods,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
                                                Continuation cont)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
         throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
     protected abstract void p_bind(Name name, Object obj,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
                                    Attributes attrs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
                                    Continuation cont)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
         throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
     protected abstract void p_rebind(Name name, Object obj,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
                                      Attributes attrs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
                                      Continuation cont)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
         throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
     protected abstract DirContext p_createSubcontext(Name name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
                                                     Attributes attrs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
                                                     Continuation cont)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
         throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
10324
e28265130e4f 7072353: JNDI libraries do not build with javac -Xlint:all -Werror
jjg
parents: 5506
diff changeset
    85
     protected abstract NamingEnumeration<SearchResult> p_search(
e28265130e4f 7072353: JNDI libraries do not build with javac -Xlint:all -Werror
jjg
parents: 5506
diff changeset
    86
                            Name name,
e28265130e4f 7072353: JNDI libraries do not build with javac -Xlint:all -Werror
jjg
parents: 5506
diff changeset
    87
                            Attributes matchingAttributes,
e28265130e4f 7072353: JNDI libraries do not build with javac -Xlint:all -Werror
jjg
parents: 5506
diff changeset
    88
                            String[] attributesToReturn,
e28265130e4f 7072353: JNDI libraries do not build with javac -Xlint:all -Werror
jjg
parents: 5506
diff changeset
    89
                            Continuation cont)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
         throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
10324
e28265130e4f 7072353: JNDI libraries do not build with javac -Xlint:all -Werror
jjg
parents: 5506
diff changeset
    92
     protected abstract NamingEnumeration<SearchResult> p_search(
e28265130e4f 7072353: JNDI libraries do not build with javac -Xlint:all -Werror
jjg
parents: 5506
diff changeset
    93
                            Name name,
e28265130e4f 7072353: JNDI libraries do not build with javac -Xlint:all -Werror
jjg
parents: 5506
diff changeset
    94
                            String filter,
e28265130e4f 7072353: JNDI libraries do not build with javac -Xlint:all -Werror
jjg
parents: 5506
diff changeset
    95
                            SearchControls cons,
e28265130e4f 7072353: JNDI libraries do not build with javac -Xlint:all -Werror
jjg
parents: 5506
diff changeset
    96
                            Continuation cont)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
         throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
10324
e28265130e4f 7072353: JNDI libraries do not build with javac -Xlint:all -Werror
jjg
parents: 5506
diff changeset
    99
     protected abstract NamingEnumeration<SearchResult> p_search(
e28265130e4f 7072353: JNDI libraries do not build with javac -Xlint:all -Werror
jjg
parents: 5506
diff changeset
   100
                            Name name,
e28265130e4f 7072353: JNDI libraries do not build with javac -Xlint:all -Werror
jjg
parents: 5506
diff changeset
   101
                            String filterExpr,
e28265130e4f 7072353: JNDI libraries do not build with javac -Xlint:all -Werror
jjg
parents: 5506
diff changeset
   102
                            Object[] filterArgs,
e28265130e4f 7072353: JNDI libraries do not build with javac -Xlint:all -Werror
jjg
parents: 5506
diff changeset
   103
                            SearchControls cons,
e28265130e4f 7072353: JNDI libraries do not build with javac -Xlint:all -Werror
jjg
parents: 5506
diff changeset
   104
                            Continuation cont)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
         throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     protected abstract DirContext p_getSchema(Name name, Continuation cont)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
         throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
     protected abstract DirContext p_getSchemaClassDefinition(Name name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
                                                             Continuation cont)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
         throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
// ------ implementation for DirContext methods using
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
// ------ corresponding p_ methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
    public Attributes getAttributes(String name)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
            throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
        return getAttributes(name, null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
    public Attributes getAttributes(Name name)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
            throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
        return getAttributes(name, null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
    public Attributes getAttributes(String name, String[] attrIds)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
            throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
        return getAttributes(new CompositeName(name), attrIds);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
    public Attributes getAttributes(Name name, String[] attrIds)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
            throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
        PartialCompositeDirContext ctx = this;
10324
e28265130e4f 7072353: JNDI libraries do not build with javac -Xlint:all -Werror
jjg
parents: 5506
diff changeset
   135
        Hashtable<?,?> env = p_getEnvironment();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
        Continuation cont = new Continuation(name, env);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
        Attributes answer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
        Name nm = name;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
            answer = ctx.p_getAttributes(nm, attrIds, cont);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
            while (cont.isContinue()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
                nm = cont.getRemainingName();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
                ctx = getPCDirContext(cont);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
                answer = ctx.p_getAttributes(nm, attrIds, cont);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
        } catch (CannotProceedException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
            DirContext cctx = DirectoryManager.getContinuationDirContext(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
            answer = cctx.getAttributes(e.getRemainingName(), attrIds);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
        return answer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
    public void modifyAttributes(String name, int mod_op, Attributes attrs)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
            throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
        modifyAttributes(new CompositeName(name), mod_op, attrs);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
    public void modifyAttributes(Name name, int mod_op, Attributes attrs)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
            throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
        PartialCompositeDirContext ctx = this;
10324
e28265130e4f 7072353: JNDI libraries do not build with javac -Xlint:all -Werror
jjg
parents: 5506
diff changeset
   162
        Hashtable<?,?> env = p_getEnvironment();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
        Continuation cont = new Continuation(name, env);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
        Name nm = name;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
            ctx.p_modifyAttributes(nm, mod_op, attrs, cont);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
            while (cont.isContinue()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
                nm = cont.getRemainingName();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
                ctx = getPCDirContext(cont);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
                ctx.p_modifyAttributes(nm, mod_op, attrs, cont);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
        } catch (CannotProceedException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
            DirContext cctx = DirectoryManager.getContinuationDirContext(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
            cctx.modifyAttributes(e.getRemainingName(), mod_op, attrs);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
    public void modifyAttributes(String name, ModificationItem[] mods)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
            throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
        modifyAttributes(new CompositeName(name), mods);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
    public void modifyAttributes(Name name, ModificationItem[] mods)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
            throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
        PartialCompositeDirContext ctx = this;
10324
e28265130e4f 7072353: JNDI libraries do not build with javac -Xlint:all -Werror
jjg
parents: 5506
diff changeset
   187
        Hashtable<?,?> env = p_getEnvironment();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
        Continuation cont = new Continuation(name, env);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
        Name nm = name;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
            ctx.p_modifyAttributes(nm, mods, cont);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
            while (cont.isContinue()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
                nm = cont.getRemainingName();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
                ctx = getPCDirContext(cont);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
                ctx.p_modifyAttributes(nm, mods, cont);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
        } catch (CannotProceedException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
            DirContext cctx = DirectoryManager.getContinuationDirContext(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
            cctx.modifyAttributes(e.getRemainingName(), mods);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
    public void bind(String name, Object obj, Attributes attrs)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
            throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
        bind(new CompositeName(name), obj, attrs);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
    public void bind(Name name, Object obj, Attributes attrs)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
            throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
        PartialCompositeDirContext ctx = this;
10324
e28265130e4f 7072353: JNDI libraries do not build with javac -Xlint:all -Werror
jjg
parents: 5506
diff changeset
   212
        Hashtable<?,?> env = p_getEnvironment();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
        Continuation cont = new Continuation(name, env);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
        Name nm = name;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
            ctx.p_bind(nm, obj, attrs, cont);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
            while (cont.isContinue()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
                nm = cont.getRemainingName();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
                ctx = getPCDirContext(cont);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
                ctx.p_bind(nm, obj, attrs, cont);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
        } catch (CannotProceedException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
            DirContext cctx = DirectoryManager.getContinuationDirContext(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
            cctx.bind(e.getRemainingName(), obj, attrs);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
    public void rebind(String name, Object obj, Attributes attrs)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
            throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
        rebind(new CompositeName(name), obj, attrs);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
    public void rebind(Name name, Object obj, Attributes attrs)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
            throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
        PartialCompositeDirContext ctx = this;
10324
e28265130e4f 7072353: JNDI libraries do not build with javac -Xlint:all -Werror
jjg
parents: 5506
diff changeset
   237
        Hashtable<?,?> env = p_getEnvironment();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
        Continuation cont = new Continuation(name, env);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
        Name nm = name;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
            ctx.p_rebind(nm, obj, attrs, cont);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
            while (cont.isContinue()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
                nm = cont.getRemainingName();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
                ctx = getPCDirContext(cont);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
                ctx.p_rebind(nm, obj, attrs, cont);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
        } catch (CannotProceedException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
            DirContext cctx = DirectoryManager.getContinuationDirContext(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
            cctx.rebind(e.getRemainingName(), obj, attrs);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
    public DirContext createSubcontext(String name, Attributes attrs)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
            throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
        return createSubcontext(new CompositeName(name), attrs);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
    public DirContext createSubcontext(Name name, Attributes attrs)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
            throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
        PartialCompositeDirContext ctx = this;
10324
e28265130e4f 7072353: JNDI libraries do not build with javac -Xlint:all -Werror
jjg
parents: 5506
diff changeset
   262
        Hashtable<?,?> env = p_getEnvironment();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
        Continuation cont = new Continuation(name, env);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
        DirContext answer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
        Name nm = name;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
            answer = ctx.p_createSubcontext(nm, attrs, cont);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
            while (cont.isContinue()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
                nm = cont.getRemainingName();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
                ctx = getPCDirContext(cont);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
                answer = ctx.p_createSubcontext(nm, attrs, cont);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
        } catch (CannotProceedException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
            DirContext cctx = DirectoryManager.getContinuationDirContext(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
            answer = cctx.createSubcontext(e.getRemainingName(), attrs);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
        return answer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
    public NamingEnumeration<SearchResult>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
        search(String name, Attributes matchingAttributes)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
        throws NamingException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
        return search(name, matchingAttributes, null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
    public NamingEnumeration<SearchResult>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
        search(Name name, Attributes matchingAttributes)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
        throws NamingException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
        return search(name, matchingAttributes, null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
    public NamingEnumeration<SearchResult>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
        search(String name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
               Attributes matchingAttributes,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
               String[] attributesToReturn)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
        throws NamingException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
        return search(new CompositeName(name),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
                      matchingAttributes, attributesToReturn);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
    public NamingEnumeration<SearchResult>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
        search(Name name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
               Attributes matchingAttributes,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
               String[] attributesToReturn)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
        throws NamingException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
        PartialCompositeDirContext ctx = this;
10324
e28265130e4f 7072353: JNDI libraries do not build with javac -Xlint:all -Werror
jjg
parents: 5506
diff changeset
   313
        Hashtable<?,?> env = p_getEnvironment();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
        Continuation cont = new Continuation(name, env);
10324
e28265130e4f 7072353: JNDI libraries do not build with javac -Xlint:all -Werror
jjg
parents: 5506
diff changeset
   315
        NamingEnumeration<SearchResult> answer;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
        Name nm = name;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
            answer = ctx.p_search(nm, matchingAttributes,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
                                  attributesToReturn, cont);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
            while (cont.isContinue()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
                nm = cont.getRemainingName();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
                ctx = getPCDirContext(cont);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
                answer = ctx.p_search(nm, matchingAttributes,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
                                      attributesToReturn, cont);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
        } catch (CannotProceedException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
            DirContext cctx = DirectoryManager.getContinuationDirContext(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
            answer = cctx.search(e.getRemainingName(), matchingAttributes,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
                                 attributesToReturn);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
        return answer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
    public NamingEnumeration<SearchResult>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
        search(String name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
               String filter,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
               SearchControls cons)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
        throws NamingException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
        return search(new CompositeName(name), filter, cons);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
    public NamingEnumeration<SearchResult>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
        search(Name name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
               String filter,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
               SearchControls cons)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
        throws NamingException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
        PartialCompositeDirContext ctx = this;
10324
e28265130e4f 7072353: JNDI libraries do not build with javac -Xlint:all -Werror
jjg
parents: 5506
diff changeset
   352
        Hashtable<?,?> env = p_getEnvironment();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
        Continuation cont = new Continuation(name, env);
10324
e28265130e4f 7072353: JNDI libraries do not build with javac -Xlint:all -Werror
jjg
parents: 5506
diff changeset
   354
        NamingEnumeration<SearchResult> answer;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
        Name nm = name;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
            answer = ctx.p_search(nm, filter, cons, cont);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
            while (cont.isContinue()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
                nm = cont.getRemainingName();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
                ctx = getPCDirContext(cont);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
                answer = ctx.p_search(nm, filter, cons, cont);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
        } catch (CannotProceedException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
            DirContext cctx = DirectoryManager.getContinuationDirContext(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
            answer = cctx.search(e.getRemainingName(), filter, cons);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
        return answer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
    public NamingEnumeration<SearchResult>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
        search(String name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
               String filterExpr,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
               Object[] filterArgs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
               SearchControls cons)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
        throws NamingException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
        return search(new CompositeName(name), filterExpr, filterArgs, cons);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
    public NamingEnumeration<SearchResult>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
        search(Name name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
               String filterExpr,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
               Object[] filterArgs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
               SearchControls cons)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
        throws NamingException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
        PartialCompositeDirContext ctx = this;
10324
e28265130e4f 7072353: JNDI libraries do not build with javac -Xlint:all -Werror
jjg
parents: 5506
diff changeset
   390
        Hashtable<?,?> env = p_getEnvironment();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
        Continuation cont = new Continuation(name, env);
10324
e28265130e4f 7072353: JNDI libraries do not build with javac -Xlint:all -Werror
jjg
parents: 5506
diff changeset
   392
        NamingEnumeration<SearchResult> answer;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
        Name nm = name;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
            answer = ctx.p_search(nm, filterExpr, filterArgs, cons, cont);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
            while (cont.isContinue()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
                nm = cont.getRemainingName();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
                ctx = getPCDirContext(cont);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
                answer = ctx.p_search(nm, filterExpr, filterArgs, cons, cont);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
        } catch (CannotProceedException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
            DirContext cctx = DirectoryManager.getContinuationDirContext(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
            answer = cctx.search(e.getRemainingName(), filterExpr, filterArgs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
                                 cons);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
        return answer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
    public DirContext getSchema(String name) throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
        return getSchema(new CompositeName(name));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
    public DirContext getSchema(Name name) throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
        PartialCompositeDirContext ctx = this;
10324
e28265130e4f 7072353: JNDI libraries do not build with javac -Xlint:all -Werror
jjg
parents: 5506
diff changeset
   416
        Hashtable<?,?> env = p_getEnvironment();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
        Continuation cont = new Continuation(name, env);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
        DirContext answer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
        Name nm = name;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
            answer = ctx.p_getSchema(nm, cont);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
            while (cont.isContinue()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
                nm = cont.getRemainingName();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
                ctx = getPCDirContext(cont);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
                answer = ctx.p_getSchema(nm, cont);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
        } catch (CannotProceedException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
            DirContext cctx = DirectoryManager.getContinuationDirContext(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
            answer = cctx.getSchema(e.getRemainingName());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
        return answer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
    public DirContext getSchemaClassDefinition(String name)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
            throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
        return getSchemaClassDefinition(new CompositeName(name));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
    public DirContext getSchemaClassDefinition(Name name)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
            throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
        PartialCompositeDirContext ctx = this;
10324
e28265130e4f 7072353: JNDI libraries do not build with javac -Xlint:all -Werror
jjg
parents: 5506
diff changeset
   443
        Hashtable<?,?> env = p_getEnvironment();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
        Continuation cont = new Continuation(name, env);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
        DirContext answer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
        Name nm = name;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
            answer = ctx.p_getSchemaClassDefinition(nm, cont);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
            while (cont.isContinue()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
                nm = cont.getRemainingName();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
                ctx = getPCDirContext(cont);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
                answer = ctx.p_getSchemaClassDefinition(nm, cont);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
        } catch (CannotProceedException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
            DirContext cctx = DirectoryManager.getContinuationDirContext(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
            answer = cctx.getSchemaClassDefinition(e.getRemainingName());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
        return answer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
// ------ internal method used by PartialCompositeDirContext
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
     * Retrieves a PartialCompositeDirContext for the resolved object in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
     * cont.  Throws CannotProceedException if not successful.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
    protected static PartialCompositeDirContext getPCDirContext(Continuation cont)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
            throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
        PartialCompositeContext pctx =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
            PartialCompositeContext.getPCContext(cont);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
        if (!(pctx instanceof PartialCompositeDirContext)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
            throw cont.fillInException(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
                    new NotContextException(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
                            "Resolved object is not a DirContext."));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
        return (PartialCompositeDirContext)pctx;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   482
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
//------ Compensation for inheriting from AtomicContext
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   487
     * Dummy implementations defined here so that direct subclasses
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
     * of PartialCompositeDirContext or ComponentDirContext do not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
     * have to provide dummy implementations for these.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
     * Override these for subclasses of AtomicDirContext.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   492
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
    protected StringHeadTail c_parseComponent(String inputName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
        Continuation cont) throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   495
            OperationNotSupportedException e = new
90ce3da70b43 Initial load
duke
parents:
diff changeset
   496
                OperationNotSupportedException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
            throw cont.fillInException(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
90ce3da70b43 Initial load
duke
parents:
diff changeset
   500
    protected Object a_lookup(String name, Continuation cont)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
        throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
            OperationNotSupportedException e = new
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
                OperationNotSupportedException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   504
            throw cont.fillInException(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   505
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   506
90ce3da70b43 Initial load
duke
parents:
diff changeset
   507
    protected Object a_lookupLink(String name, Continuation cont)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   508
        throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   509
            OperationNotSupportedException e = new
90ce3da70b43 Initial load
duke
parents:
diff changeset
   510
                OperationNotSupportedException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   511
            throw cont.fillInException(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   512
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   513
10324
e28265130e4f 7072353: JNDI libraries do not build with javac -Xlint:all -Werror
jjg
parents: 5506
diff changeset
   514
    protected NamingEnumeration<NameClassPair> a_list(
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   515
        Continuation cont) throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   516
            OperationNotSupportedException e = new
90ce3da70b43 Initial load
duke
parents:
diff changeset
   517
                OperationNotSupportedException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   518
            throw cont.fillInException(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   519
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   520
10324
e28265130e4f 7072353: JNDI libraries do not build with javac -Xlint:all -Werror
jjg
parents: 5506
diff changeset
   521
    protected NamingEnumeration<Binding> a_listBindings(
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   522
        Continuation cont) throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   523
            OperationNotSupportedException e = new
90ce3da70b43 Initial load
duke
parents:
diff changeset
   524
                OperationNotSupportedException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   525
            throw cont.fillInException(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   526
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   527
90ce3da70b43 Initial load
duke
parents:
diff changeset
   528
    protected void a_bind(String name, Object obj, Continuation cont)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
        throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   530
            OperationNotSupportedException e = new
90ce3da70b43 Initial load
duke
parents:
diff changeset
   531
                OperationNotSupportedException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   532
            throw cont.fillInException(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   533
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   534
90ce3da70b43 Initial load
duke
parents:
diff changeset
   535
    protected void a_rebind(String name, Object obj, Continuation cont)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   536
        throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   537
            OperationNotSupportedException e = new
90ce3da70b43 Initial load
duke
parents:
diff changeset
   538
                OperationNotSupportedException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   539
            throw cont.fillInException(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   540
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   541
90ce3da70b43 Initial load
duke
parents:
diff changeset
   542
    protected void a_unbind(String name, Continuation cont)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   543
        throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   544
            OperationNotSupportedException e = new
90ce3da70b43 Initial load
duke
parents:
diff changeset
   545
                OperationNotSupportedException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   546
            throw cont.fillInException(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   547
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   548
90ce3da70b43 Initial load
duke
parents:
diff changeset
   549
    protected void a_destroySubcontext(String name, Continuation cont)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   550
        throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   551
            OperationNotSupportedException e = new
90ce3da70b43 Initial load
duke
parents:
diff changeset
   552
                OperationNotSupportedException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   553
            throw cont.fillInException(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   554
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   555
90ce3da70b43 Initial load
duke
parents:
diff changeset
   556
    protected Context a_createSubcontext(String name, Continuation cont)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   557
        throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   558
            OperationNotSupportedException e = new
90ce3da70b43 Initial load
duke
parents:
diff changeset
   559
                OperationNotSupportedException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   560
            throw cont.fillInException(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   562
90ce3da70b43 Initial load
duke
parents:
diff changeset
   563
    protected void a_rename(String oldname, Name newname,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   564
        Continuation cont) throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   565
            OperationNotSupportedException e = new
90ce3da70b43 Initial load
duke
parents:
diff changeset
   566
                OperationNotSupportedException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
            throw cont.fillInException(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   568
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   569
90ce3da70b43 Initial load
duke
parents:
diff changeset
   570
    protected NameParser a_getNameParser(Continuation cont)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   571
        throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   572
            OperationNotSupportedException e = new
90ce3da70b43 Initial load
duke
parents:
diff changeset
   573
                OperationNotSupportedException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   574
            throw cont.fillInException(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   575
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   576
}