jdk/src/java.corba/share/classes/com/sun/jndi/cosnaming/ExceptionMapper.java
author shade
Thu, 24 Mar 2016 12:52:03 +0300
changeset 36668 ceb837301c53
parent 25859 3317bb8137f4
permissions -rw-r--r--
8150463: StringConcat MH_INLINE_SIZED_EXACT should skip storage initialization Reviewed-by: plevart, chegar
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.cosnaming;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import javax.naming.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import javax.naming.directory.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import javax.naming.spi.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import org.omg.CosNaming.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import org.omg.CosNaming.NamingContextPackage.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import org.omg.CORBA.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
  * A convenience class to map the COS Naming exceptions to the JNDI exceptions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
  * @author Raj Krishnamurthy
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
  */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
public final class ExceptionMapper {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
    private ExceptionMapper() {} // ensure no instance
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
    private static final boolean debug = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
    public static final NamingException mapException(Exception e,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
        CNCtx ctx, NameComponent[] inputName) throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
        if (e instanceof NamingException) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
            return (NamingException)e;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
        if (e instanceof RuntimeException) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
            throw (RuntimeException)e;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
        NamingException ne;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
        if (e instanceof NotFound) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
            if (ctx.federation) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
                return tryFed((NotFound)e, ctx, inputName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
            } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
                ne = new NameNotFoundException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
        } else if (e instanceof CannotProceed) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
            ne = new CannotProceedException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
            NamingContext nc = ((CannotProceed) e).cxt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
            NameComponent[] rest = ((CannotProceed) e).rest_of_name;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
            // %%% We assume that rest returns *all* unprocessed components.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
            // Don't' know if that is a good assumption, given
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
            // NotFound doesn't set rest as expected. -RL
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
            if (inputName != null && (inputName.length > rest.length)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
                NameComponent[] resolvedName =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
                    new NameComponent[inputName.length - rest.length];
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
                System.arraycopy(inputName, 0, resolvedName, 0, resolvedName.length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
                // Wrap resolved NamingContext inside a CNCtx
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
                // Guess that its name (which is relative to ctx)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
                // is the part of inputName minus rest_of_name
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
                ne.setResolvedObj(new CNCtx(ctx._orb, ctx.orbTracker, nc,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
                                                ctx._env,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
                    ctx.makeFullName(resolvedName)));
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
            } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
                ne.setResolvedObj(ctx);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
            ne.setRemainingName(CNNameParser.cosNameToName(rest));
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
        } else if (e instanceof InvalidName) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
            ne = new InvalidNameException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
        } else if (e instanceof AlreadyBound) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
            ne = new NameAlreadyBoundException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
        } else if (e instanceof NotEmpty) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
            ne = new ContextNotEmptyException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
            ne = new NamingException("Unknown reasons");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
        ne.setRootCause(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
        return ne;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
    private static final NamingException tryFed(NotFound e, CNCtx ctx,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
        NameComponent[] inputName) throws NamingException {
10324
e28265130e4f 7072353: JNDI libraries do not build with javac -Xlint:all -Werror
jjg
parents: 5506
diff changeset
   105
        NameComponent[] rest = e.rest_of_name;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
        if (debug) {
10324
e28265130e4f 7072353: JNDI libraries do not build with javac -Xlint:all -Werror
jjg
parents: 5506
diff changeset
   108
            System.out.println(e.why.value());
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
            System.out.println(rest.length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
        // %%% Using 1.2 & 1.3 Sun's tnameserv, 'rest' contains only the first
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
        // component that failed, not *rest* as advertized. This is useless
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
        // because what if you have something like aa/aa/aa/aa/aa.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
        // If one of those is not found, you get "aa" as 'rest'.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
        if (rest.length == 1 && inputName != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
            // Check that we're not talking to 1.2/1.3 Sun tnameserv
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
            NameComponent lastIn = inputName[inputName.length-1];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
            if (rest[0].id.equals(lastIn.id) &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
                rest[0].kind != null &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
                rest[0].kind.equals(lastIn.kind)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
                // Might be legit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
                ;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
            } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
                // Due to 1.2/1.3 bug that always returns single-item 'rest'
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
                NamingException ne = new NameNotFoundException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
                ne.setRemainingName(CNNameParser.cosNameToName(rest));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
                ne.setRootCause(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
                throw ne;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
        // Fixed in 1.4; perform calculations based on correct (1.4) behavior
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
        // Calculate the components of the name that has been resolved
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
        NameComponent[] resolvedName = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
        int len = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
        if (inputName != null && (inputName.length >= rest.length)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
            if (e.why == NotFoundReason.not_context) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
                // First component of rest is found but not a context; keep it
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
                // as part of resolved name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
                len = inputName.length - (rest.length - 1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
                // Remove resolved component from rest
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
                if (rest.length == 1) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
                    // No more remaining
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
                    rest = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
                } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
                    NameComponent[] tmp = new NameComponent[rest.length-1];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
                    System.arraycopy(rest, 1, tmp, 0, tmp.length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
                    rest = tmp;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
            } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
                len = inputName.length - rest.length;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
            if (len > 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
                resolvedName = new NameComponent[len];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
                System.arraycopy(inputName, 0, resolvedName, 0, len);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
        // Create CPE and set common fields
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
        CannotProceedException cpe = new CannotProceedException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
        cpe.setRootCause(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
        if (rest != null && rest.length > 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
            cpe.setRemainingName(CNNameParser.cosNameToName(rest));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
        cpe.setEnvironment(ctx._env);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
        if (debug) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
            System.out.println("rest of name: " + cpe.getRemainingName());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
        // Lookup resolved name to get resolved object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
        final java.lang.Object resolvedObj =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
            (resolvedName != null) ? ctx.callResolve(resolvedName) : ctx;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
        if (resolvedObj instanceof javax.naming.Context) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
            // obj is a context and child is not found
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
            // try getting its nns dynamically by constructing
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
            // a Reference containing obj.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
            RefAddr addr = new RefAddr("nns") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
                public java.lang.Object getContent() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
                    return resolvedObj;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
                private static final long serialVersionUID =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
                    669984699392133792L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
            };
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
            Reference ref = new Reference("java.lang.Object", addr);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
            // Resolved name has trailing slash to indicate nns
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
            CompositeName cname = new CompositeName();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
            cname.add(""); // add trailing slash
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
            cpe.setResolvedObj(ref);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
            cpe.setAltName(cname);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
            cpe.setAltNameCtx((javax.naming.Context)resolvedObj);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
            return cpe;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
            // Not a context, use object factory to transform object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
            Name cname = CNNameParser.cosNameToName(resolvedName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
            java.lang.Object resolvedObj2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
            try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
                resolvedObj2 = NamingManager.getObjectInstance(resolvedObj,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
                    cname, ctx, ctx._env);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
            } catch (NamingException ge) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
                throw ge;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
            } catch (Exception ge) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
                NamingException ne = new NamingException(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
                    "problem generating object using object factory");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
                ne.setRootCause(ge);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
                throw ne;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
            // If a context, continue operation with context
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
            if (resolvedObj2 instanceof javax.naming.Context) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
                cpe.setResolvedObj(resolvedObj2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
            } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
                // Add trailing slash
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
                cname.add("");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
                cpe.setAltName(cname);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
                // Create nns reference
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
                final java.lang.Object rf2 = resolvedObj2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
                RefAddr addr = new RefAddr("nns") {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
                    public java.lang.Object getContent() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
                        return rf2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
                    private static final long serialVersionUID =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
                        -785132553978269772L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
                };
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
                Reference ref = new Reference("java.lang.Object", addr);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
                cpe.setResolvedObj(ref);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
                cpe.setAltNameCtx(ctx);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
            return cpe;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
}