CupertinoIndian <[EMAIL PROTECTED]> writes:

> 
> 
> Thanks for reply. I do not have a spring configuration file yet but I 
> get the point that a single file will suffice.
> 
> Let me explain what I mean by integration. We have an abstract layer on 
> top of EJBs and a layer of business components (lets call them BCs) on 
> top of this abstract layer. These are equivalent of EJBs in any other 
> architecture. I want these BCs to be callable from other JBI components 
> and vice versa. I also want these BCs to be manageable via Sping JMX and 
> want to switch their persistence to Hibernate via Spring.
> 
> To achieve this, as far as I understand, I need to to as follows:
> 1. Create an adapter that will expose these BCs as JBI components.
> 2. When J2EE container starts, load spring via some one time load 
> mechanism (J2EE containers provide such facilities).
> 3. When each of these BCs gets loaded (BCs are lazy loaded), (somehow) 
> plug into service mix dynamically to be able to receive/send normalized 
> messages.
> 4. Also, register with Spring (somehow) so that these components become 
> manageable via JMX. I think I need another adapter here.
> 5. I will be able to use hibernate as spring is already loaded.
> 
> Does this make sense? Thanks for your input.
> Ravi
> 
> What do you mean by integrating ? What j2ee resources do you need to
>  > access to ?
> 
> Guillaume Nodet wrote:
> > See comments inline ...
> > 
> > CupertinoIndian wrote:
> > 
> >>
> >> I am thinking of integrating spring and esb into our enterprise 
> >> application. I am not sure how to get started about this. Here are a 
> >> few thoughts and questions.
> >>
> >> 1. I am thinking that once I integrate servicemix, it means spring is 
> >> automatically integrated. I will be able to use the same configuration 
> >> file for hibernate, jmx etc. Or should the integration points be 
> >> different for different components?
> > 
> > 
> > If you (will) already have spring configuration files, the easiest way 
> > is to add the ServiceMix configuration to it (or import it from the 
> > existing one).
> > You do not need to have several unrelated spring configuration.
> > 
> >>
> >> 2. How can I integrate servicemix with a j2ee application assuming the 
> >> application server doesnt have servicemix in it already? Any thoughts?
> > 
> > 
> > What do you mean by integrating ? What j2ee resources do you need to 
> > access to ?
> > 
> > Cheers,
> > Guillaume Nodet
> > 
> >>
> >> Thanks for your help
> >> Ravi

Hi,
I'm also new to SM so my comment shuld be taken with precaution:). It'd be good 
if someone more experienced wold review all this...

I think it all depends on what kind of deployment you plan to use. If you go 
with SM as standalone ESB than you should make your BC remotely accessible 
(SOAP,JMS...) and provide JBI binding component for your BC. Other JBI 
components would then use your BC through that binding:
some JBI component --> binding --> BC

If you'd like SM embedded in j2ee appserv then you shuld think of SM as Spring 
application with provided spring container that can also host your spring 
components. In your case then the servicemix.xml (eg spring application 
context) could look smoething like this:

...
<!-- your JBI adapter config-->
<sm:activationSpec componentName="bcAdapter"    
        service="foo:myService"
        endpoint="myService">
         <sm:component>
          <bean xmlns="http://xbean.org/schemas/spring/1.0";
                class="BusinessComponentJBIAdapter">
                <property name="businessComponent">
                <ref local="businessComponent" />
                </property>
          </bean>
     </sm:component>
  </sm:activationSpec>
  
  ...
  <!-- your BC  config-->
  <bean id="businessComponent" class="BusinessComponent">
                <property name="prop1">
                <value>val1</value>
                </property>
                ...                                                     
        </bean>
...

Spring already has mechanism for different startup scenarios. In web app that's 
something like this (in your web.xml)

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/applicationContext.xml</param-value>
  </context-param>
  <context-param>
    <param-name>contextClass</param-name>
    <param-value>org.xbean.spring.context.XmlWebApplicationContext</param-value>
  </context-param>

  <listener>
    <listener-
class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>

Hope it helps

Cheers, Simon




Reply via email to