FileDocCategorySizeDatePackage
corbanameURLContext.javaAPI DocGlassfish v2 API3969Fri May 04 22:36:18 BST 2007com.sun.jndi.url.corbaname

corbanameURLContext

public class corbanameURLContext extends GenericURLContext
A corbaname URL context.
author
Rosanna Lee

Fields Summary
Constructors Summary
corbanameURLContext(Hashtable env)

	super(env);
    
Methods Summary
protected javax.naming.spi.ResolveResultgetRootURLContext(java.lang.String name, java.util.Hashtable env)
Resolves 'name' into a target context with remaining name. It only resolves the hostname/port number. The remaining name contains the rest of the name found in the URL. For example, with a corbaname URL "corbaname:iiop://localhost:900#rest/of/name", this method resolves "corbaname:iiop://localhost:900" to the "NameService" context on for the ORB at 'localhost' on port 900, and returns as the remaining name "rest/of/name".

	return corbanameURLContextFactory.getUsingURLIgnoreRest(name, env);
    
protected java.lang.StringgetURLPrefix(java.lang.String url)
Finds the prefix of a corbaname URL. This is all of the non-string name portion of the URL. The string name portion always occurs after the '#' so we just need to look for that.

	int start = url.indexOf('#");

	if (start < 0) {
	    return url;	    // No '#', prefix is the entire URL
	}

	return url.substring(0, start);
    
protected javax.naming.NamegetURLSuffix(java.lang.String prefix, java.lang.String url)
Return the suffix of a corbaname url. prefix parameter is ignored.

	    // Rewrite to corbaname url
	    url = corbanameURLContextFactory.rewriteUrl(url);
	    try {
		IiopUrl parsedUrl = new IiopUrl(url);
		return parsedUrl.getCosName();
	    } catch (MalformedURLException e) {
		throw new InvalidNameException(e.getMessage());
	    }