A factory + interface is the way to go, otherwise looks good.

xxxxxxxxxxxxxxxxxxxxxxxx
Scott Stark
Chief Technology Officer
JBoss Group, LLC
xxxxxxxxxxxxxxxxxxxxxxxx

----- Original Message ----- 
From: "Jeremy Boynes" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, December 07, 2002 11:59 PM
Subject: RE: [JBoss-dev] Proposal for changes to URL deployment to clean up netboot


> Scott Stark wrote:
> > Sounds ok, but let see some more details. Show how you propose to rewrite
> > SARDeployer.parseXMLClasspath using this helper framework.
> >
> > I think bbtaining a URLLister should mirror the mechanism for obtain a URL
> > protocol handler in that one can install the class that obtains a
> > listing for a given
> > URL via package search paths.
> >
> 
> I was thinking something like
> 
> public abstract class URLLister {
>    /**
>     * Obtain a lister appropriate for the supplied URL.
>     * @param baseUrl the URL to list; should end in "/" but need not
>     */
>    public static URLLister getLister(URL baseUrl)
>       throws UnsupportedProtocolException // or something
>    {
>    }
> 
>    /**
>     * Return the URLs of members matching the pattern.
>     * The pattern may contain multiple elements separated by ","
>     * Each element may be a wildcard e.g. "*.jar"
>     * @param pattern a pattern to filter members by
>     * @return a Collection of java.net.URL's containing every matching
> member
>     */
>    public abstract Collection listMembers(String pattern);
> }
> 
> but a URLListerFactory with URLLister as an interface is probably better.
> Either implementation would allow handlers to be plugged in.
> 
> Then the big block of code in SARDeployer.parseXMLClasspath beginning
>       // jason: This section needs to be rewritten to be non http & file
>       //        specific.  Should probably try to convert to a URL early.
> through the end of the for loop (lines 359 to 501)
> 
> would become something like:
>       // handle "." special - is this necessary?
>       URL baseUrl;
>       if (".".equals(codebase) || "".equals(codebase)) {
>          // use the parent of the location I am deploying
>          baseUrl = new URL(di.url, "..");
>       } else {
>          // resolve codebase URL relative to SERVER_HOME
>          baseUrl = new URL(serverHomeUrl, codebase);
>       }
> 
>       if ("".equals(archives)) {
>          // no archives supplied so add the codebase itself
>          classpath.add(baseUrl);
>       } else {
>          // obtain a URLLister for this location
>          URLLister lister = URLLister.getLister(baseUrl);
>          classpath.addAll(lister.listMembers(archives));
>       }



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to