"adrian(a)jboss.org" wrote :
| Is a vfs classloader policy a vfs cache or can a vfs classloader policy
| have a vfs cache?
|
I didn't want to change current impl at the following code:
| /**
| * Get virtual file for uri.
| *
| * @param uri the uri
| * @return virtual file for uri
| * @throws Exception for any error
| */
| protected VirtualFile getVirtualFile(URI uri) throws Exception
| {
| return VFS.getRoot(uri);
| }
|
instead doing an override that uses the newly added caching VirtualFile instance
re-usability:
| protected VirtualFile getVirtualFile(URI uri) throws Exception
| {
| return VFS.getCachedFile(uri);
| }
|
Perhaps I can use VFS::getCachedFile directly in the original impl?
Hence no need for the additional class.
VFS::getCachedFile:
| /**
| * Get cached file.
| *
| * If VFSContext matching the rootURL parameter is cached
| * this method will return cached virtual file
| * else it will use VFS::getRoot(rootURL).
| *
| * @param rootURL the root url
| * @return the cached virtual file
| * @throws IOException for any error
| * @throws IllegalArgumentException if the rootURL is null
| */
| public static VirtualFile getCachedFile(URL rootURL) throws IOException
| {
| VFSCache cache = VFSCacheFactory.getInstance();
| return cache.getFile(rootURL);
| }
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4186477#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...