Re: [mule-dev] EJBs Spring And Mule

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: [mule-dev] EJBs Spring And Mule

Foo Shoong Weng
Hi Ross,

Yep, I've got that working and in fact been answering this to user
mailist. The following is the mail telling how to achieve it.

Hope it helps up.

Best rgds,
Weng

-------- Original Message --------
Subject: Re: [mule-user] To call ejb via MULE....
Date: Sun, 26 Jun 2005 05:18:11 +0800
From: Foo Shoong Weng <[hidden email]>
Reply-To: [hidden email]
To: Arpit Mehta <[hidden email]>
CC: [hidden email]



Guillaume,
        Do you think we should add "Call Ejb via Spring container" into User
Guide or Cookbook?

Hi Arpit,

The following are the sample code and spring & mule config fragements
for your reference.Together with
examples on page
http://mule.codehaus.org/Using+Spring+as+a+Component+Factory, you should be
able to run the scenario.

Of course, you may need to tweak around with it to suit your scenario.
For instance, what Ejb
bean you are using whether it's local/remote or stateless/stateful etc.

You may refer to
http://static.springframework.org/spring/docs/1.2.x/reference/ejb.html
for usage of different types.


KitchenService.java
-------------------
/* Using business delegate pattern to extend those business methods on
Ejb Client class
*  that will be called by Mule UMO.
*/
public interface KitchenService extends KitchenServiceEjbClient{
       
        public void submitOrder(Order order);
}



applicationContext.xml (spring config)
--------------------------------------

    <bean id="kitchenService"
class="org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean">
        <property name="jndiEnvironment">
                        <props>
                                <prop
key="java.naming.factory.initial">InitialContextFactoryClassName</prop>
                                <prop key="java.naming.provider.url">ProviderUrl</prop>
                                <prop key="java.naming.security.principal">Uid</prop>
                                <prop key="java.naming.security.credentials">Password</prop>
                        </props>
                </property>
        <property name="jndiName">
            <value>kitchenService</value>
        </property>        
       
        <property name="businessInterface">
            <value>com.foo.KitchenService</value>
        </property>
       
    </bean>

    <bean id='restaurantWaiter' singleton='false'
class='com.foo.RestaurantWaiter'>
        <property name='kitchenService'><ref
local='kitchenService'/></property>
    </bean>



mule-config.xml
---------------
        <mule-descriptor name="Restaurant Waiter"
             inboundEndpoint="vm://order.queue"
             implementation="restaurantWaiter">
        </mule-descriptor>
        <container-context
className="org.mule.extras.spring.SpringContainerContext">
            <properties>
                <property name="configFile" value="applicationContext.xml"/>
            </properties>
        </container-context>

Hope it helps.


Best rgds,
Weng

----- Original Message -----
From: Arpit Mehta <[hidden email]>
Date: Sunday, June 26, 2005 2:28 am
Subject: Re: [mule-user] To call ejb via MULE....

> Hi
> thanx for the reply. can you tell me how to use that code or
> appropiately
> modify to suit it to JBoss requirements
> Anyhelp would be greatly welcomed
> On 6/24/05, Foo Shoong Weng <[hidden email]> wrote:
> >
> > Hi Arpit,
> >
> > Pls have a look at this link.
> > _http://mule.codehaus.org/Using+Spring+as+a+Component+Factory
> > _
> > Basically, it utilizes the Spring capability to call an EJB
> deployed on
> > apps server, while Mule allow us to expose the Spring bean as
> Mule UMO.
> >
> > Hope it helps.
> >
> >
> > Best rgds,
> > Weng
> >
> > Arpit Mehta wrote:
> >
> > >i have an ejb class which i have deployed on JBoss.... i would
> like to
> > >call this via MULE..... how shud i do that ??? u could pass me some
> > >references as well....
> > >thanx...
> > >
> > >
> > >
> > >
> > >
> >
>
>
>
> --
> Arpit Mehta
> Computer Science & Engineering
> Indian Institute of Technology, Madras
>