ws-sandesha-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Granqvist, Hans" <hgranqv...@verisign.com>
Subject RE: Changing Sandesha client port - programmatically
Date Wed, 31 Aug 2005 21:07:15 GMT
In my example, I was thinking you'd keep existing API and add the
factory ones,
then decide how to or whether to deprecate the constructors.


________________________________

	From: Chamikara Jayalath [mailto:chamikaramj@gmail.com] 
	Sent: Wednesday, August 31, 2005 10:30 AM
	To: Sanjiva Weerawarana; Granqvist, Hans
	Cc: Rajiv K Nistala; sandesha-dev@ws.apache.org
	Subject: Re: Changing Sandesha client port - programmatically
	
	

	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