aboutsummaryrefslogtreecommitdiffstats
path: root/servicegateway/service/src/main/resources/spring/service.xml
blob: c91ed1caae6348b6f8c27b2057ddff762e5f7568 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?xml version="1.0" encoding="utf-8"?>
<!-- /* * Copyright (c) 2016, Huawei Technologies Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); 
    * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 
    * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on 
    an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific 
    language governing permissions and * limitations under the License. */ -->
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:jaxrs="http://cxf.apache.org/jaxrs" xmlns:ctx="http://www.springframework.org/schema/context" xmlns:context="http://www.springframework.org/schema/context"
    xmlns:oms="http://www.huawei.com/schema/oms"
    xsi:schemaLocation="
    http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context.xsd
    http://www.huawei.com/schema/oms
    http://www.huawei.com/schema/oms/oms.xsd
    http://cxf.apache.org/jaxrs 
    http://cxf.apache.org/schemas/jaxrs.xsd">

    <!-- these are included in the dependency jar -->
    <import resource="classpath:META-INF/cxf/cxf.xml" />
    <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />

    <!-- jar rest server registration -->
    <jaxrs:server id="sampleServer" address="/">    
        <!-- registering beans -->
        <jaxrs:serviceBeans>
            <ref bean="ServicemgrRoaModuleImpl"></ref>
            <ref bean="ServicePackageModuleImpl"></ref>
        </jaxrs:serviceBeans>
        <!-- registering providers -->
        <jaxrs:providers>
            <bean class="org.codehaus.jackson.jaxrs.JacksonJsonProvider" />
        </jaxrs:providers>
    </jaxrs:server>
    
    <bean id="datasource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
        <property name="driverClass" value="com.mysql.jdbc.Driver" />
        <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/mybatistest" />
        <property name="user" value="root" />
        <property name="password" value="Test_12345" />
    </bean>
    
    <bean id="sessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
        <property name="dataSource" ref="datasource" />
        <property name="mapperLocations" value="classpath*:mybatis/mappers/*.xml" />
    </bean>
    
    <bean id="session" class="org.mybatis.spring.SqlSessionTemplate">
        <constructor-arg index="0" ref="sessionFactory" />
    </bean>

    <bean class="org.openo.gso.servicemgr.activator.Activator"></bean>
    
    <bean id="Activator" class="org.openo.gso.servicemgr.activator.Activator" init-method="start" destroy-method="stop">
    </bean>
    
    <bean id="ServicemgrRoaModuleImpl" class="org.openo.gso.servicemgr.roa.impl.ServicemgrRoaModuleImpl">
        <property name="ServiceGateway" ref="ServiceGateway"></property>
    </bean>    
    
    <bean id="ServiceGateway" class="org.openo.gso.servicemgr.service.impl.ServiceGatewayImpl">
        <property name="serviceModelDao" ref="serviceModelDao"></property>
        <property name="subServiceDao" ref="subServiceDao"></property>
        <property name="servicePackageDao" ref="servicePackageDao"></property>
        <property name="catalogProxy" ref="catalogProxy"></property>
        <property name="wsoProxy" ref="wsoProxy"></property>
    </bean>
    
    <bean id="ServicePackageModuleImpl" class="org.openo.gso.servicemgr.roa.impl.ServicePackageModuleImpl">
        <property name="packageMgr" ref="packageMgr"></property>
    </bean>
    
    <bean id="packageMgr" class="org.openo.gso.servicemgr.service.impl.PackageManagerImpl">
        <property name="servicePackageDao" ref="servicePackageDao"></property>
        <property name="catalogProxy" ref="catalogProxy"></property>
    </bean>

    <bean id="serviceModelDao" class="org.openo.gso.servicemgr.dao.impl.ServiceModelDaoImpl">
        <property name="session" ref="session" />
    </bean>
    
    <bean id="servicePackageDao" class="org.openo.gso.servicemgr.dao.impl.ServicePackageDaoImpl">
        <property name="session" ref="session" />
    </bean>

    <bean id="subServiceDao" class="org.openo.gso.servicemgr.dao.impl.SubServiceDaoImpl">
        <property name="session" ref="session" />
    </bean>
    
    <bean id="catalogProxy" class="org.openo.gso.servicemgr.restproxy.impl.CatalogProxyImpl">
    </bean>
    
    <bean id="wsoProxy" class="org.openo.gso.servicemgr.restproxy.impl.WsoProxyImpl">
    </bean>
</beans>