ws-sandesha-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chamikara Jayalath <chamikar...@gmail.com>
Subject Re: Changing Sandesha client port - programmatically
Date Wed, 31 Aug 2005 17:29:36 GMT
SandeshaContext currently have following constructor.

public SandeshaContext(int sync) throws AxisFault {
this.sync = true;
//other code
}

so if some one call this he will always be working synchronously (i.e. the 
listner will not be started).

To start the listner he has to call the folowing constructor.

public SandeshaContext() throws AxisFault {
startListener();
//other code
}

I feel this should be refactored to following,

public SandeshaContext(bool sync) throws AxisFault {
if(!sync)
startListner (defaultPort)
}

public SandeshaContext(int port) throws AxisFault {
startLitner (port)
}

But both this and the solution given by Hans change the client interface of 
Sandesha.I was trying to add the functionality without affecting the 
existing client code. (But I understant that it looks wired :D ). Do u think 
it is ok to change the client interface (since we are just after a release)

Chamikara




On 8/31/05, Granqvist, Hans <hgranqvist@verisign.com> wrote:
> 
> > Isn't there a better way?
> 
> A static factory method maybe?
> 
> SandeshaContext ctx = SandeshaContext.getInstanceABC(int);
> SandeshaContext ctx = SandeshaContext.getInstanceXYZ(int);
> 
> Hans
>

Mime
View raw message