Paul

To do this without making the Synapse core (i.e. SynapseConfiguration) dependent on Spring classes, we could keep the reference to the ApplicationContext as just an Object?  Maybe the approach should be to make the Spring configuration definitions "named" (as other elements within the "definitions" section), and keep these named "configuration"s as a Map of Objects.. just thinking out aloud. .maybe something like...

SynapseConfiguration will keep a Map of named "configuration" Objects, and expose methods
     Object getNamedConfiguration(String configName)
     void addNamedConfiguration(String configName, Object config)

This configuration returns an Object, and if/since we know these configurations are of ApplicationContext type, we could cast it and use them.. So it would also be possible to have "other" types of named configuration objects as shown below..

e.g.

<synapse>
    <definitions>
       ....
      <spring name="spring1" configuration="file:/springconfig1.xml"/>
            .. extensibility ..
      </spring>
      <spring name="spring2" configuration="file:/springconfig2.xml"/>
       ....
       <someotherconfig name="someother" configuration="url"/>
        ...
    </definitions>

    </rules>
        ......
        <springmediator ref="exampleBean1" configuration="spring1"/>
        ....
        <springmediator ref="exampleBean2" configuration="spring2"/>
        ....
        <someothermediator configuration="someother"/>
           ....
    </rules>
<synapse>

Do you think this would be good?

asankha

Paul Fremantle wrote:
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
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to