synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Glen Daniels" <gdani...@sonicsoftware.com>
Subject RE: Mediator interface
Date Fri, 07 Oct 2005 13:13:16 GMT

+1 to Eran's point.  I think it should be a Context, and I think for
early prototyping work anyway we should leave it as the Axis2
MessageContext.  I'm fine with separating it out to
synapse.MessageContext at some point if necessary.

Another quick thought here - note that dependency injection requires
stateful componentry, and passing a Context does not.

--Glen 

> -----Original Message-----
> From: Eran Chinthaka [mailto:chinthaka@opensource.lk] 
> Sent: Friday, October 07, 2005 7:56 AM
> To: synapse-dev@ws.apache.org
> Subject: Re: Mediator interface
> 
> I think Synapse also will need some sort of context to hold 
> some other information which goes beyond the simple SOAP 
> message. This is even obvious in Axis as you pass message 
> cotexts to the handlers and stuff. 
> I agree that you can do this by dependency injection, but 
> when its obvious that you always need that (at least I think 
> so), I think its better to pass some context. If message 
> context reminds you Axis, then lets rename that to 
> SynapseContext or whatever :-) 
> 
> ant elder wrote: 
> 
> 	Or does there even need to be a MessageContext on the interface?
> 	
> 	If an aim of Mediators is that they're based on SOAP 
> Infoset and any containment aspects should be separate then 
> how about the mediate method taking just a SOAP message, 
> something like an AXIOM SOAPMessage or SOAPEnvelope? If the 
> Mediator really needs access to some context then Synapse can 
> use dependency injection to pass it in.
> 	
> 	interface Mediator {
> 	   public boolean mediate(SOAPEnvelope envelope);
> 	}
> 	
> 	And if a Mediator impl requires context it provides a 
> method like:  
> 	
> 	  public void 
> setMessageContext(org.apache.synapse.context.MessageContext mc) {...}
> 	  
> 	
> 	
> 	
> 	
> 
> 
> 		ant elder <ant.elder@gmail.com> on 07/10/2005 10:42:16 
> 		
> 		Please respond to synapse-dev@ws.apache.org
> 		
> 		To:    synapse-dev@ws.apache.org
> 		cc:
> 		
> 		Subject:    RE: Mediator interface 
> 		
> 		
> 		
> 		
> 		What do people think about having a new Synapse 
> MessageContext interface
> 		instead of using the AXIS2 MessageContext 
> class? It makes Synapse quite
> 		invasive - a mediation has dependencies on both 
> Synapse and AXIS2. 
> 		
> 		An aim of Synapse mediations is to be based on 
> the SOAP Infoset, but using
> 		the AXIS2 classes brings in far more than that, 
> eg the AXIS2 MC has methods
> 		relating to AXIS2 config - modules, 
> SystemConfiguration etc. And as its a 
> 		class not an interface you can't easily mock it 
> up for unit testing
> 		mediation beans in isolation, you endup needing 
> mocks for all sorts of
> 		unrelated AXIS2 classes. Which surely that goes 
> against Synapse being a
> 		non-invasive container for mediation POJOs?
> 		
> 		Similar thing with the AXISFault. I agree with 
> what Eric said earlier about
> 		not using AXISFault. If mediation exceptions 
> are going to be fundamentally
> 		SOAPy faults then AXISFault represents more than that. 
> 		
> 		...ant
> 		
> 		PS. Hi guys
> 		
> 		
> 		
> 		
> 
> 
> 

Mime
View raw message