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 <[EMAIL PROTECTED]> wrote:
> Isn't there a better way?

A static factory method maybe?

  SandeshaContext ctx = SandeshaContext.getInstanceABC(int);
  SandeshaContext ctx = SandeshaContext.getInstanceXYZ(int);

Hans

Reply via email to