maven-wagon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michal Maczka <mmac...@interia.pl>
Subject Re: Support for Sessions and other planned changes in Wagon API
Date Thu, 19 Aug 2004 01:38:38 GMT
Trygve Laugstøl wrote:

>On Mon, Aug 16, 2004 at 10:39:06PM -0700, Michal Maczka wrote:
>  
>
>>Hey!
>>
>>I've seen the latest discussion regarding session in wagon. and ideas
>>like "Plexus returning Map which hides the access to container".
>>
>>I've walk this path long ago in early days of wagon and I don't think it
>>is a right way as it leads to nowhere
>>
>>There are three problems which we have to solve here:
>>
>>a) per lookup requires contextalizable lookup requires access to
>>container and we don't want this
>>    
>>
>
>Why does a "per lookup" strategy require access to the container?
>
>  
>
>>b) how components are released (what  does " the magic Map" buy us here?)
>>    
>>
>
>I don't think anyone has been talking about needing the special map for
>wagon. The biggest issue the special map is adding newly discovered
>components to the existing map. I would like the map to have a release()
>method on the map too for components that doesn't use the singleton
>lifecycle. I don't know if a special plexus map would implement
>java.util.Map but it would have about the same semantics.
>
>  
>
>>c) we need to support the concept of session in Wagon API
>>    
>>
>
>Indeed and thats the only problem that you are trying to solve, right?
>
>  
>
>>The simplest fix which I know is ... to come back to the old design
>>which was used in
>>Wagon before and was specially develop to  support all those
>>requirements and to use WagonFactories
>>
>>Note that
>>- not every class needs to be a component
>>- Wagon is loosely modeled after JDBC API - Wagon corresponds to
>>Connection, Wagon Factory to DataSource.
>>
>>Datasouce is the perfect candidate for component - connection is rather not.
>>The same applies to WagonFactory and Wagon
>>
>>Once we have back WagonFactory classes (which will be plexus component)
>>- any component willing to talk to repositories will
>>use them for obtaining an instance of Wagon. They can be declared as any
>>their dependencies - and WagonFactoryManager will give an access to all
>>of them.
>>    
>>
>
>If you don't use plexus for discovery of wagons, how do you propose to
>find all the available implementations?
>
>  
>
Plexus will be used for discovering WagonFactory components. 
WagonFactory will be used for instatiating Wagons.
We will have one WagonFactory per one Wagon implementation.
WagonFactory is thread safe component which has no state. If you will 
replace the word  Wagon with Session
it will be more intuitive what's happening - we have SessionFactory ( 
WagonFactory component) and Session (Wagon which is statful object, 
which can be cached in objects like MavenSession ).

You will be just required to close a session (connection) in Wagon - as 
Wagon are not components they are not required
to be "released"  back to the container.

 From the point of view of m2 this should be all hidden in WagonManager 
so classes using WagonManager class will feel almost no difference (only 
difference will be that WagonManager won't have "release" method anymore)


Michal


----------------------------------------------------------------------
Ateny 2004 w Internecie! >>> http://link.interia.pl/f182d


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


Mime
View raw message