You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Mario Ivankovits <im...@apache.org> on 2004/06/21 16:26:16 UTC

Re: [vfs] VfsTask

Rami Ojares schrieb:

>I have pronlems with VfsTask.
>First of all I need to instantiate AntLogger in ant tasks
>so AntLogger needs to be made public.
>But that is not enough since I need to instantiate it also
>in DataTypes (FileSet in particular).
>Also resolveFile needs to be accessed from FileSet DataType.
>
>Therefore I would propably need VfsDataType that would be very
>similar to VfsTask. Which led me to wondering about FileSystemManager.
>
>Now ant tasks instantiate the manager if they invoke resolveFile method.
>And when the build completes the manager is closed.
>
>When ant tasks call some components (like toolbox components) that are not related to ant
>they have to open their own manager.
>  
>
What of your toolbox component do need the filesystemmanager?
I looked into them, but they only use the passed fileobjects.

>So I was wondering why not just use VFS class to get the manager also in ant tasks?
>  
>
I like the idea of the current ant task implementation, they instantiate 
their own manager in the context of the current ant project.
I am not sure if we should use the static way (VFS.getManager()) as this 
might have bad sideeffects when using ant embedded.
If the user use VFS.getManager() too and we close this instance after 
ant is done, we close this manager (and all open files) too (it is the 
same manager instance).
Also we can not simply use setLogger() on this instance, there might 
already be another logger set by the user on this instance (in the 
embedded case)


Might it be possible to implement a special ant task - say
<vfs-manager id="vfs" class="StandardFileSystemManager" />

this allows us to add some configuration options later (e.g. proxy 
settings, ssh settings) using this task and refer to this instance 
within the other tasks and maybe from within DataType (FileSet)

Maybe a construct like
<vfs-manager id="vfs" class="global" />
could be possible which will use the VFS.getManager().

And when using ant embedded, the developer could "inject" the manager 
instance.

Not sure if all this could work, as i havent written an ant task till now.
Do you think this could be an option?

-- 
Mario


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org