synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Newcomer, Eric" <Eric.Newco...@iona.com>
Subject RE: Mediator interface
Date Mon, 26 Sep 2005 17:31:32 GMT
Paul,

 

The question of a SynapseFault is tricky all right since it involves the
issue of transparency.  However I would vote for including a
SynapseFault since it is possible for the mediation framework to
encounter unexpected errors, and the requestor would need to distinguish
between a SynapseFault and an AxisFault.  I would also think that the
AxisFault should be reserved for the provider endpoint's use rather than
the mediation framework's use, which should trap any AxisFault and
return it as a SynapseFault.  I believe in any case the requester will
need to know at some level (short of actual code that is) that an
intermediary is in place and therefore will find it helpful (if not
essential) to distinguish between mediation level faults and provider
endpoint level faults.

 

Eric

 

  _____  

From: Paul Fremantle [mailto:pzfreo@gmail.com] 
Sent: Sunday, September 25, 2005 7:21 PM
To: synapse-dev@ws.apache.org
Subject: Mediator interface

 

Guys 

Here is a first draft Mediator interface. Two comments.

1) No init/cleanup because we expect those to be managed by IoC.
2) I *nearly* added a SynapseFault - which may have value. But since the
messages are fundamentally SOAP Infoset, then the faults must sure be
fundamentally SOAPy faults? 

Thoughts?

Paul



/*
 * Copyright 2004,2005 The Apache Software Foundation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.synapse;

import org.apache.axis2.AxisFault;
import org.apache.axis2.context.MessageContext;

import javax.xml.namespace.QName;

/**
 * Interface Mediator
 */
 
public interface Mediator {
    
    /**
     * mediate is called by the framework when a message is expected to
be mediated
     * Any faults must be processed and wrapped as a SynapseException
     * 
     * mediate returns true if the message is still to be processed
     * mediate returns false if there is no more processing to be done
     *
     * @param msgContext the <code>MessageContext</code> to process with
this
     *                   <code>Mediator</code>.
     * @throws SynapseFault if the mediator encounters an error
     */
    public boolean mediate(MessageContext msgContext) throws AxisFault;
    public QName getName();

}


Mime
View raw message