Quantcast

How to add proxy information to Wagon Manager?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to add proxy information to Wagon Manager?

amaresh mourya
Hi All,

I am creating an application using plexus container and in need of adding
proxy information to wagon manager,Right now I am adding proxy this way :

NOTE : pc is plexus container
////////////////////////////

DefaultWagonManager dwm;

try {
       dwm = (DefaultWagonManager)pc.lookup(WagonManager.ROLE);
       dwm.addProxy("http",www-myhost.com,80,null,null,null);
    }
    catch (ComponentLookupException e)
    {
    }

//////////////////////////

And this way everything works fine, but wondering ! is it the right way to
add proxy info to Wagon manager?
Is it possible that lookup will not always return me the Wagon manager?

Thanks,
Amaresh
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to add proxy information to Wagon Manager?

brettporter
Administrator
This works. You'll need to make sure to release it again when you are done with it - pc.release( dwm);

On 11/01/2010, at 4:57 PM, amaresh mourya wrote:

> Hi All,
>
> I am creating an application using plexus container and in need of adding
> proxy information to wagon manager,Right now I am adding proxy this way :
>
> NOTE : pc is plexus container
> ////////////////////////////
>
> DefaultWagonManager dwm;
>
> try {
>       dwm = (DefaultWagonManager)pc.lookup(WagonManager.ROLE);
>       dwm.addProxy("http",www-myhost.com,80,null,null,null);
>    }
>    catch (ComponentLookupException e)
>    {
>    }
>
> //////////////////////////
>
> And this way everything works fine, but wondering ! is it the right way to
> add proxy info to Wagon manager?
> Is it possible that lookup will not always return me the Wagon manager?
>
> Thanks,
> Amaresh

--
Brett Porter
[hidden email]
http://brettporter.wordpress.com/





---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to add proxy information to Wagon Manager?

amaresh mourya
Hi Brett,
Thanks for reply. Can you tell me

1. In what cases, pc.lookup() may not always return an instance of
DefaultWagonManager ??

2. Isn't there any other way to call addProxy method of DefaultWagonManager
to add proxy information ? I mean may be at the time when we register this
component with plexus container..
in META-INF/plexus/components.xml


On Mon, Jan 11, 2010 at 11:46 AM, Brett Porter <[hidden email]> wrote:

> This works. You'll need to make sure to release it again when you are done
> with it - pc.release( dwm);
>
> On 11/01/2010, at 4:57 PM, amaresh mourya wrote:
>
> > Hi All,
> >
> > I am creating an application using plexus container and in need of adding
> > proxy information to wagon manager,Right now I am adding proxy this way :
> >
> > NOTE : pc is plexus container
> > ////////////////////////////
> >
> > DefaultWagonManager dwm;
> >
> > try {
> >       dwm = (DefaultWagonManager)pc.lookup(WagonManager.ROLE);
> >       dwm.addProxy("http",www-myhost.com,80,null,null,null);
> >    }
> >    catch (ComponentLookupException e)
> >    {
> >    }
> >
> > //////////////////////////
> >
> > And this way everything works fine, but wondering ! is it the right way
> to
> > add proxy info to Wagon manager?
> > Is it possible that lookup will not always return me the Wagon manager?
> >
> > Thanks,
> > Amaresh
>
> --
> Brett Porter
> [hidden email]
> http://brettporter.wordpress.com/
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Loading...