Package javax.naming

Examples of javax.naming.CannotProceedException


/* 388 */       return ((NamingServer)ctx).listBindings(name.getSuffix(1));
/* 389 */     }if ((ctx instanceof Reference))
/*     */     {
/* 392 */       if (((Reference)ctx).get("nns") != null)
/*     */       {
/* 394 */         CannotProceedException cpe = new CannotProceedException();
/* 395 */         cpe.setResolvedObj(ctx);
/* 396 */         cpe.setRemainingName(name.getSuffix(1));
/* 397 */         throw cpe;
/*     */       }
/*     */
/* 400 */       throw new NotContextException();
/*     */     }
View Full Code Here


/*     */         } else {
/* 427 */           if ((ctx instanceof Reference))
/*     */           {
/* 430 */             if (((Reference)ctx).get("nns") != null)
/*     */             {
/* 432 */               CannotProceedException cpe = new CannotProceedException();
/* 433 */               cpe.setResolvedObj(ctx);
/* 434 */               cpe.setRemainingName(subCtxName);
/* 435 */               throw cpe;
/*     */             }
/*     */
/* 439 */             ex = new NotContextException();
/* 440 */             ex.setResolvedName(name.getPrefix(0));
View Full Code Here

            }
        }
    }

    private static CannotProceedException cannotProceedException(final Object resolvedObject, final Name remainingName) {
        final CannotProceedException cpe = new CannotProceedException();
        cpe.setResolvedObj(resolvedObject);
        cpe.setRemainingName(remainingName);
        return cpe;
    }
View Full Code Here

        exception.setRemainingName(remainingName);
        return exception;
    }

    public static CannotProceedException cannotProceedException(final Object resolvedObject, final Name remainingName) {
        final CannotProceedException cpe = new CannotProceedException();
        cpe.setResolvedObj(resolvedObject);
        cpe.setRemainingName(remainingName);
        return cpe;
    }
View Full Code Here

                ne = new NameNotFoundException();
            }

        } else if (e instanceof CannotProceed) {

            ne = new CannotProceedException();
            NamingContext nc = ((CannotProceed) e).cxt;
            NameComponent[] rest = ((CannotProceed) e).rest_of_name;

            // %%% We assume that rest returns *all* unprocessed components.
            // Don't' know if that is a good assumption, given
View Full Code Here

                System.arraycopy(inputName, 0, resolvedName, 0, len);
            }
        }

        // Create CPE and set common fields
        CannotProceedException cpe = new CannotProceedException();
        cpe.setRootCause(e);
        if (rest != null && rest.length > 0) {
            cpe.setRemainingName(org.jboss.as.jacorb.naming.jndi.CNNameParser.cosNameToName(rest));
        }
        cpe.setEnvironment(ctx._env);

        if (debug) {
            System.out.println("rest of name: " + cpe.getRemainingName());
        }

        // Lookup resolved name to get resolved object
        final java.lang.Object resolvedObj =
                (resolvedName != null) ? ctx.callResolve(resolvedName) : ctx;

        if (resolvedObj instanceof javax.naming.Context) {
            // obj is a context and child is not found
            // try getting its nns dynamically by constructing
            // a Reference containing obj.
            RefAddr addr = new RefAddr("nns") {
                public java.lang.Object getContent() {
                    return resolvedObj;
                }

                private static final long serialVersionUID =
                        669984699392133792L;
            };
            Reference ref = new Reference("java.lang.Object", addr);

            // Resolved name has trailing slash to indicate nns
            CompositeName cname = new CompositeName();
            cname.add(""); // add trailing slash

            cpe.setResolvedObj(ref);
            cpe.setAltName(cname);
            cpe.setAltNameCtx((javax.naming.Context) resolvedObj);

            return cpe;
        } else {
            // Not a context, use object factory to transform object.

            Name cname = org.jboss.as.jacorb.naming.jndi.CNNameParser.cosNameToName(resolvedName);
            java.lang.Object resolvedObj2;
            try {
                resolvedObj2 = NamingManager.getObjectInstance(resolvedObj,
                        cname, ctx, ctx._env);
            } catch (NamingException ge) {
                throw ge;
            } catch (Exception ge) {
                NamingException ne = new NamingException(
                        "problem generating object using object factory");
                ne.setRootCause(ge);
                throw ne;
            }

            // If a context, continue operation with context
            if (resolvedObj2 instanceof javax.naming.Context) {
                cpe.setResolvedObj(resolvedObj2);
            } else {
                // Add trailing slash
                cname.add("");
                cpe.setAltName(cname);

                // Create nns reference
                final java.lang.Object rf2 = resolvedObj2;
                RefAddr addr = new RefAddr("nns") {
                    public java.lang.Object getContent() {
                        return rf2;
                    }

                    private static final long serialVersionUID =
                            -785132553978269772L;
                };
                Reference ref = new Reference("java.lang.Object", addr);
                cpe.setResolvedObj(ref);
                cpe.setAltNameCtx(ctx);
            }
            return cpe;
        }
    }
View Full Code Here

            }
        }
    }

    private static CannotProceedException cannotProceedException(final Object resolvedObject, final Name remainingName) {
        final CannotProceedException cpe = new CannotProceedException();
        cpe.setResolvedObj(resolvedObject);
        cpe.setRemainingName(remainingName);
        return cpe;
    }
View Full Code Here

            }
        }
    }

    private static CannotProceedException cannotProceedException(final Object resolvedObject, final Name remainingName) {
        final CannotProceedException cpe = new CannotProceedException();
        cpe.setResolvedObj(resolvedObject);
        cpe.setRemainingName(remainingName);
        return cpe;
    }
View Full Code Here

TOP

Related Classes of javax.naming.CannotProceedException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.