Is this different from using CLAP, or is this what you need: 

component.getClients().add(Protocol.CLAP); 
router.attach("/content",new Directory(getContext(), 
"clap://thread/com/solertium/example/content")); 

- Rob 

----- Original Message ----- 
From: "Alex Milowski" <[EMAIL PROTECTED]> 
To: [email protected] 
Sent: Friday, September 7, 2007 2:20:55 PM (GMT-0500) America/New_York 
Subject: LocalReference given a Class Instance? 

I'm loading applications dynamically from a jar file and I'd really 
like to attach a 
Directory instance give a class instance. That is, something like: 

router.attach("/content",new 
Directory(getContext(),LocalReference.createClassReference(MyApp.class,"content"));
 

where the resource path is constructed as: 

Class.getName()+"/" + path 

so that in the above example, if the package of MyApp was "org.example": 

"org/example/content" 

and then the directory instance would load content via the ClassLoader 
associated 
with the class instance. 

It may be the case that "Directory" is the wrong thing here. 

Maybe we need a new Finder called ClassResourceFinder such that you can do: 

router.attach("/content",new ClassResourceFinder(MyApp.clas,"content")); 

and get resources from getResource() calls against the ClassLoader. 

--Alex Milowski 

Reply via email to