Asankha

Interesting approach.

A couple of questions:

How would the spring application context be stored in the SynapseConfiguration?
How would you handle more than one spring configuration?

Paul

On 5/17/06, Asankha C. Perera <[EMAIL PROTECTED]> wrote:
I am updating the Spring support of Synapse, and was thinking about
allowing one to define the Spring bean mediators within the
<definitions> section (in XML configuration terms) and refer to the
mediators through a <spring ref="beanname"> for usage.

an example of this would be as follows

<synapse>
    <definitions>
       ....
      <spring configuration="file:/springconfig.xml"/>
       ....
    </definitions>

    </rules>
        ......
        <springmediator ref="exampleBean"/>
        ....
    </rules>
<synapse>

The Spring configuration thus would be kept outside of the synapse XML
configuration (as the synapse configuration could be created
programmatically as well).

The spring configuration for the above example thus would be something like

....
<bean id="exampleBean" class=" examples.ExampleBean">
  <property name="beanOne"><ref bean="anotherExampleBean"/></property>
  <property name="beanTwo"><ref bean="yetAnotherBean"/></property>
  <property name="integerProperty"><value>1</value></property>
</bean>
....

Hence at runtime (mediator use time) the spring mediator would get the
Spring ApplicationContext (from the SynapseConfiguration) and look for
the bean named by the ref attribute and if found and it implements the
Mediator interface, delegate mediation. This way, the Spring
configuration could also be updated programatically (if one desires!)
and could be reused by multiple Spring mediators.

Your thoughts on this approach are very much appreciated

asankha




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Paul Fremantle
VP/Technology, WSO2 and OASIS WS-RX TC Co-chair

http://bloglines.com/blog/paulfremantle
[EMAIL PROTECTED]

"Oxygenating the Web Service Platform", www.wso2.com

Reply via email to