Skip to content

Commit 767f54c

Browse files
committed
Make nonoss build work under Spring
1 parent 2b67fc8 commit 767f54c

4 files changed

Lines changed: 50 additions & 7 deletions

File tree

client/tomcatconf/nonossComponentContext.xml.in

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,35 @@
1+
<!--
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing,
13+
software distributed under the License is distributed on an
14+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
KIND, either express or implied. See the License for the
16+
specific language governing permissions and limitations
17+
under the License.
18+
-->
19+
20+
<beans xmlns="http://www.springframework.org/schema/beans"
21+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
22+
xmlns:context="http://www.springframework.org/schema/context"
23+
xmlns:tx="http://www.springframework.org/schema/tx"
24+
xmlns:aop="http://www.springframework.org/schema/aop"
25+
xsi:schemaLocation="http://www.springframework.org/schema/beans
26+
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
27+
http://www.springframework.org/schema/tx
28+
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
29+
http://www.springframework.org/schema/aop
30+
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
31+
http://www.springframework.org/schema/context
32+
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
133

234

335
<!--
@@ -263,8 +295,9 @@
263295
<bean id="configurationDaoImpl" class="com.cloud.configuration.dao.ConfigurationDaoImpl">
264296
<property name="configParams">
265297
<map>
266-
<entry key="premium" value="1" />
298+
<entry key="premium" value="true" />
267299
</map>
268300
</property>
269301
</bean>
270-
302+
303+
</beans>

plugins/hypervisors/vmware/src/com/cloud/ha/VmwareFencer.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
import javax.ejb.Local;
2222
import javax.naming.ConfigurationException;
2323

24-
import org.springframework.stereotype.Component;
25-
2624
import com.cloud.host.HostVO;
2725
import com.cloud.vm.VMInstanceVO;
2826

@@ -41,14 +39,17 @@ public VmwareFencer() {
4139

4240
@Override
4341
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
44-
_name = name;
4542
return true;
4643
}
4744

4845
@Override
4946
public String getName() {
5047
return _name;
5148
}
49+
50+
public void setName(String name) {
51+
_name = name;
52+
}
5253

5354
@Override
5455
public boolean start() {

server/src/com/cloud/configuration/dao/ConfigurationDaoImpl.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.util.List;
2323
import java.util.Map;
2424

25+
import javax.annotation.PostConstruct;
2526
import javax.ejb.Local;
2627
import javax.naming.ConfigurationException;
2728

@@ -62,6 +63,15 @@ public boolean isPremium() {
6263
return _premium;
6364
}
6465

66+
@PostConstruct
67+
void initComponent() {
68+
try {
69+
configure(this.getClass().getSimpleName(), this.getConfigParams());
70+
} catch (ConfigurationException e) {
71+
s_logger.warn("Self configuration failed", e);
72+
}
73+
}
74+
6575
@Override
6676
public void invalidateCache() {
6777
_configs = null;

server/src/com/cloud/server/ManagementServerImpl.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,11 +446,10 @@ private void startDaos() {
446446
Map<String, GenericDaoBase> daos = ComponentContext.getApplicationContext().getBeansOfType(
447447
GenericDaoBase.class);
448448

449-
Map<String, Object> params = new HashMap<String, Object>();
450449
for (GenericDaoBase dao : daos.values()) {
451450
try {
452451
s_logger.info("Starting dao " + ComponentContext.getTargetClass(dao).getName());
453-
dao.configure(dao.getClass().getSimpleName(), params);
452+
dao.configure(dao.getClass().getSimpleName(), dao.getConfigParams());
454453
} catch (Exception e) {
455454
s_logger.error("Problems with running checker:" + ComponentContext.getTargetClass(dao).getName(), e);
456455
System.exit(1);

0 commit comments

Comments
 (0)