fixing injection of beans with a relationship

Conflicts:
	server/src/org/apache/cloudstack/network/topology/AdvancedNetworkTopology.java
	server/src/org/apache/cloudstack/network/topology/BasicNetworkTopology.java
This commit is contained in:
wrodrigues 2014-07-16 15:01:59 +02:00 committed by wilderrodrigues
parent 8f313ca5d3
commit d15329679b
3 changed files with 12 additions and 49 deletions

View File

@ -22,13 +22,11 @@ import java.util.List;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import com.cloud.dc.DataCenter;
import com.cloud.deploy.DeployDestination;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.network.Network;
import com.cloud.network.lb.LoadBalancingRule;
import com.cloud.network.router.VirtualRouter;
import com.cloud.network.rules.RuleApplier;
import com.cloud.network.rules.RuleApplierWrapper;
import com.cloud.network.rules.UserdataPwdRules;
@ -36,50 +34,8 @@ import com.cloud.vm.DomainRouterVO;
import com.cloud.vm.NicProfile;
import com.cloud.vm.VirtualMachineProfile;
public class AdvancedNetworkTopology implements NetworkTopology {
@Override
public StringBuilder createGuestBootLoadArgs(final NicProfile guestNic, final String defaultDns1, final String defaultDns2, final DomainRouterVO router) {
return null;
}
@Override
public String retrieveGuestDhcpRange(final NicProfile guestNic, final Network guestNetwork, final DataCenter dc) {
return null;
}
@Override
public NicProfile retrieveControlNic(final VirtualMachineProfile profile) {
return null;
}
@Override
public boolean configDhcpForSubnet(final Network network, final NicProfile nic, final VirtualMachineProfile profile, final DeployDestination dest,
final List<DomainRouterVO> routers) throws ResourceUnavailableException {
return false;
}
@Override
public boolean applyDhcpEntry(final Network network, final NicProfile nic, final VirtualMachineProfile profile, final DeployDestination dest,
final List<DomainRouterVO> routers) throws ResourceUnavailableException {
return false;
}
@Override
public boolean applyRules(final Network network, final List<? extends VirtualRouter> routers, final String typeString, final boolean isPodLevelException, final Long podId,
final boolean failWhenDisconnect, final RuleApplier applier) throws ResourceUnavailableException {
AdvancedNetworkVisitor visitor = new AdvancedNetworkVisitor(this);
applier.accept(visitor, null);
return false;
}
@Override
public boolean sendCommandsToRouter(final VirtualRouter router, final List<LoadBalancingRule> rules, final long id) {
// TODO Auto-generated method stub
return false;
}
@Component
public class AdvancedNetworkTopology extends BasicNetworkTopology {
private static final Logger s_logger = Logger.getLogger(AdvancedNetworkTopology.class);

View File

@ -25,6 +25,7 @@ import javax.inject.Inject;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import com.cloud.dc.DataCenter;
import com.cloud.dc.DataCenter.NetworkType;
@ -63,6 +64,7 @@ import com.cloud.vm.VirtualMachine.State;
import com.cloud.vm.VirtualMachineProfile;
import com.cloud.vm.dao.UserVmDao;
@Component
public class BasicNetworkTopology implements NetworkTopology {
private static final Logger s_logger = Logger.getLogger(BasicNetworkTopology.class);

View File

@ -21,6 +21,9 @@ import java.util.Hashtable;
import javax.inject.Inject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import com.cloud.dc.DataCenter;
import com.cloud.dc.DataCenter.NetworkType;
@ -28,10 +31,12 @@ public class NetworkTopologyContext {
private final Hashtable<NetworkType, NetworkTopology> _flyweight = new Hashtable<DataCenter.NetworkType, NetworkTopology>();;
@Inject
@Autowired
@Qualifier("basicNetworkTopology")
private BasicNetworkTopology _basicNetworkTopology;
@Inject
@Autowired
@Qualifier("advancedNetworkTopology")
private AdvancedNetworkTopology _advancedNetworkTopology;
public void init() {