mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Make nonoss build work under Spring
This commit is contained in:
parent
2b67fc8441
commit
767f54cc9a
@ -1,3 +1,35 @@
|
|||||||
|
<!--
|
||||||
|
Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
or more contributor license agreements. See the NOTICE file
|
||||||
|
distributed with this work for additional information
|
||||||
|
regarding copyright ownership. The ASF licenses this file
|
||||||
|
to you 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:context="http://www.springframework.org/schema/context"
|
||||||
|
xmlns:tx="http://www.springframework.org/schema/tx"
|
||||||
|
xmlns:aop="http://www.springframework.org/schema/aop"
|
||||||
|
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||||
|
http://www.springframework.org/schema/beans/spring-beans-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/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">
|
||||||
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
@ -263,8 +295,9 @@
|
|||||||
<bean id="configurationDaoImpl" class="com.cloud.configuration.dao.ConfigurationDaoImpl">
|
<bean id="configurationDaoImpl" class="com.cloud.configuration.dao.ConfigurationDaoImpl">
|
||||||
<property name="configParams">
|
<property name="configParams">
|
||||||
<map>
|
<map>
|
||||||
<entry key="premium" value="1" />
|
<entry key="premium" value="true" />
|
||||||
</map>
|
</map>
|
||||||
</property>
|
</property>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
</beans>
|
||||||
|
|||||||
@ -21,8 +21,6 @@ import java.util.Map;
|
|||||||
import javax.ejb.Local;
|
import javax.ejb.Local;
|
||||||
import javax.naming.ConfigurationException;
|
import javax.naming.ConfigurationException;
|
||||||
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import com.cloud.host.HostVO;
|
import com.cloud.host.HostVO;
|
||||||
import com.cloud.vm.VMInstanceVO;
|
import com.cloud.vm.VMInstanceVO;
|
||||||
|
|
||||||
@ -41,7 +39,6 @@ public class VmwareFencer implements FenceBuilder {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
|
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
|
||||||
_name = name;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -50,6 +47,10 @@ public class VmwareFencer implements FenceBuilder {
|
|||||||
return _name;
|
return _name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
_name = name;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean start() {
|
public boolean start() {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -22,6 +22,7 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.annotation.PostConstruct;
|
||||||
import javax.ejb.Local;
|
import javax.ejb.Local;
|
||||||
import javax.naming.ConfigurationException;
|
import javax.naming.ConfigurationException;
|
||||||
|
|
||||||
@ -62,6 +63,15 @@ public class ConfigurationDaoImpl extends GenericDaoBase<ConfigurationVO, String
|
|||||||
return _premium;
|
return _premium;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostConstruct
|
||||||
|
void initComponent() {
|
||||||
|
try {
|
||||||
|
configure(this.getClass().getSimpleName(), this.getConfigParams());
|
||||||
|
} catch (ConfigurationException e) {
|
||||||
|
s_logger.warn("Self configuration failed", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void invalidateCache() {
|
public void invalidateCache() {
|
||||||
_configs = null;
|
_configs = null;
|
||||||
|
|||||||
@ -446,11 +446,10 @@ public class ManagementServerImpl implements ManagementServer {
|
|||||||
Map<String, GenericDaoBase> daos = ComponentContext.getApplicationContext().getBeansOfType(
|
Map<String, GenericDaoBase> daos = ComponentContext.getApplicationContext().getBeansOfType(
|
||||||
GenericDaoBase.class);
|
GenericDaoBase.class);
|
||||||
|
|
||||||
Map<String, Object> params = new HashMap<String, Object>();
|
|
||||||
for (GenericDaoBase dao : daos.values()) {
|
for (GenericDaoBase dao : daos.values()) {
|
||||||
try {
|
try {
|
||||||
s_logger.info("Starting dao " + ComponentContext.getTargetClass(dao).getName());
|
s_logger.info("Starting dao " + ComponentContext.getTargetClass(dao).getName());
|
||||||
dao.configure(dao.getClass().getSimpleName(), params);
|
dao.configure(dao.getClass().getSimpleName(), dao.getConfigParams());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
s_logger.error("Problems with running checker:" + ComponentContext.getTargetClass(dao).getName(), e);
|
s_logger.error("Problems with running checker:" + ComponentContext.getTargetClass(dao).getName(), e);
|
||||||
System.exit(1);
|
System.exit(1);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user