Subversion Repositories Integrator Subversion

Rev

Blame | Last modification | View Log | Download | RSS feed

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
        xmlns:context="http://www.springframework.org/schema/context"
        xmlns:lang="http://www.springframework.org/schema/lang" xmlns:tx="http://www.springframework.org/schema/tx"
        xmlns:jee="http://www.springframework.org/schema/jee" xmlns:util="http://www.springframework.org/schema/util"
        xmlns:jaxws="http://cxf.apache.org/jaxws"
        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
      http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
      http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-3.0.xsd
      http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
      http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
      http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
      http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
      http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd">


        <description>
                Arquivo context principal do Spring
    </description>
     
        <context:spring-configured/>
       
        <import resource="classpath:META-INF/security-context.xml"/>
    <import resource="classpath:META-INF/framework-context.xml"/>
    <import resource="classpath:META-INF/scg-modal-context.xml"/>
       
        <jee:jndi-lookup id="webServicePropertiesWsi" jndi-name="resource/wsi" expected-type="java.util.Properties" />
        <!--
   <util:properties id="webServiceProperties" location="classpath:META-INF/webservice.properties"/>
   <util:properties id="securityProperties" location="classpath:META-INF/cas.properties"/>
   -->
   
         <!-- Habilita suporte a annotations para componentes -->
        <context:annotation-config/>
       
        <!-- Pacote base para scanear componentes anotados -->    
        <context:component-scan base-package="br.gov.al.saude"/>
        <context:component-scan base-package="scs-*.jar!br.gov.al.saude"/>
        <!-- <context:component-scan base-package="scs-*.jar!br.gov.al.saude"/> -->
        <context:component-scan base-package="sesau-*.jar!br.gov.al.saude" />
       
        <!-- Tomcat            
        <tx:annotation-driven transaction-manager="transactionManager" />
        <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
                <property name="entityManagerFactory" ref="entityManagerFactory" />
        </bean>
        <jee:jndi-lookup id="dataSource" jndi-name="jdbc/scsDS" />
        <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
                <property name="dataSource" ref="dataSource" />
                <property name="persistenceUnitName" value="scsPU" />
        </bean>
        Tomcat-FIM --> 
       
        <!-- Glassfish -->
        <bean id="txManager" class="org.springframework.transaction.jta.JtaTransactionManager" />
        <tx:annotation-driven transaction-manager="txManager"/>
       
        <tx:advice id="txAdvice" transaction-manager="txManager">
            <tx:attributes>
                <tx:method name="*" />
            </tx:attributes>
        </tx:advice>
       
        <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiName" value="jdbc/scsDS"/>
        </bean>
       
        <bean id="dataSourceScgModalFramework" class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiName" value="jdbc/scgDS"/>
        </bean>
       
        <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
            <property name="dataSource" ref="dataSource"/>
            <property name="persistenceUnitName" value="scsPU"/>
            <property name="loadTimeWeaver">
                <bean class="org.springframework.instrument.classloading.glassfish.GlassFishLoadTimeWeaver"/>
            </property>
            <property name="persistenceProvider">
                <bean class="org.hibernate.ejb.HibernatePersistence"/>
            </property>
        </bean>
       
        <!-- Glassfish-FIM -->
         
        <bean id="securityRepository" class="br.gov.al.saude.sca.security.repository.SecurityRepositoryImpl">
                 <property name="entityManager">
                <bean class="org.springframework.orm.jpa.support.SharedEntityManagerBean">
                    <property name="entityManagerFactory" ref="entityManagerFactory" />
                </bean>
            </property>
        </bean>
 
        <!-- Habilita suporte a bean validation -->
        <bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean"/>
        <bean id="passwordEncoder" class="org.springframework.security.authentication.encoding.Md5PasswordEncoder"/>
       
        <!-- Suporte a annotations @Controller e @RequestMapping a nĂ­vel de classe -->
        <bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"/>
       
        <bean class="org.springframework.beans.factory.config.CustomScopeConfigurer">
            <property name="scopes">
                <map>
                    <entry key="view">
                        <bean class="br.gov.al.saude.framework.web.scope.ViewScope"/>
                    </entry>
                </map>
            </property>
        </bean>

</beans>