incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kelv...@apache.org
Subject [47/50] [abbrv] Merge javelin into master
Date Fri, 01 Feb 2013 23:27:31 GMT
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/296c2033/server/src/com/cloud/cluster/ClusterManagerImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/cluster/ClusterManagerImpl.java
index 465f384,df62eed..45d9dca
--- a/server/src/com/cloud/cluster/ClusterManagerImpl.java
+++ b/server/src/com/cloud/cluster/ClusterManagerImpl.java
@@@ -143,11 -143,11 +145,11 @@@ public class ClusterManagerImpl extend
      private boolean _agentLBEnabled = false;
      private double _connectedAgentsThreshold = 0.7;
      private static boolean _agentLbHappened = false;
 -
 +    
-     private List<ClusterServicePdu> _clusterPduOutgoingQueue = new ArrayList<ClusterServicePdu>();
-     private List<ClusterServicePdu> _clusterPduIncomingQueue = new ArrayList<ClusterServicePdu>();
-     private Map<Long, ClusterServiceRequestPdu> _outgoingPdusWaitingForAck = new HashMap<Long,
ClusterServiceRequestPdu>();
+     private final List<ClusterServicePdu> _clusterPduOutgoingQueue = new ArrayList<ClusterServicePdu>();
+     private final List<ClusterServicePdu> _clusterPduIncomingQueue = new ArrayList<ClusterServicePdu>();
+     private final Map<Long, ClusterServiceRequestPdu> _outgoingPdusWaitingForAck =
new HashMap<Long, ClusterServiceRequestPdu>();
 -
 +    
      public ClusterManagerImpl() {
          _clusterPeers = new HashMap<String, ClusterService>();
  
@@@ -157,8 -157,9 +159,9 @@@
          // recursive remote calls between nodes
          //
          _executor = Executors.newCachedThreadPool(new NamedThreadFactory("Cluster-Worker"));
+         setRunLevel(ComponentLifecycle.RUN_LEVEL_FRAMEWORK);
      }
 -
 +    
      private void registerRequestPdu(ClusterServiceRequestPdu pdu) {
          synchronized(_outgoingPdusWaitingForAck) {
              _outgoingPdusWaitingForAck.put(pdu.getSequenceId(), pdu);
@@@ -222,38 -223,40 +225,40 @@@
      }
  
      private void addIncomingClusterPdu(ClusterServicePdu pdu) {
 -        synchronized(_clusterPduIncomingQueue) {
 -            _clusterPduIncomingQueue.add(pdu);
 -            _clusterPduIncomingQueue.notifyAll();
 -        }
 +    	synchronized(_clusterPduIncomingQueue) {
 +    		_clusterPduIncomingQueue.add(pdu);
 +    		_clusterPduIncomingQueue.notifyAll();
 +    	}
      }
 -
 +    
      private ClusterServicePdu popIncomingClusterPdu(long timeoutMs) {
 -        synchronized(_clusterPduIncomingQueue) {
 -            try {
 -                _clusterPduIncomingQueue.wait(timeoutMs);
 -            } catch (InterruptedException e) {
 -            }
 -
 -            if(_clusterPduIncomingQueue.size() > 0) {
 -                ClusterServicePdu pdu = _clusterPduIncomingQueue.get(0);
 -                _clusterPduIncomingQueue.remove(0);
 -                return pdu;
 -            }
 -        }
 -        return null;
 +    	synchronized(_clusterPduIncomingQueue) {
 +    		try {
 +    			_clusterPduIncomingQueue.wait(timeoutMs);
 +			} catch (InterruptedException e) {
 +			}
 +			
 +			if(_clusterPduIncomingQueue.size() > 0) {
 +				ClusterServicePdu pdu = _clusterPduIncomingQueue.get(0);
 +				_clusterPduIncomingQueue.remove(0);
 +				return pdu;
 +			}
 +    	}
 +    	return null;
      }
 -
 +    
      private Runnable getClusterPduSendingTask() {
          return new Runnable() {
+             @Override
              public void run() {
                  onSendingClusterPdu();
              }
          };
      }
 -
 +    
      private Runnable getClusterPduNotificationTask() {
          return new Runnable() {
+             @Override
              public void run() {
                  onNotifyingClusterPdu();
              }
@@@ -313,37 -316,38 +318,38 @@@
              try {
                  final ClusterServicePdu pdu = popIncomingClusterPdu(1000);
                  if(pdu == null)
 -                    continue;
 +                	continue;
  
                  _executor.execute(new Runnable() {
+                     @Override
 -                    public void run() {
 -                        if(pdu.getPduType() == ClusterServicePdu.PDU_TYPE_RESPONSE) {
 -                            ClusterServiceRequestPdu requestPdu = popRequestPdu(pdu.getAckSequenceId());
 -                            if(requestPdu != null) {
 -                                requestPdu.setResponseResult(pdu.getJsonPackage());
 -                                synchronized(requestPdu) {
 -                                    requestPdu.notifyAll();
 -                                }
 -                            } else {
 -                                s_logger.warn("Original request has already been cancelled.
pdu: " + _gson.toJson(pdu));
 -                            }
 -                        } else {
 -                            String result = dispatchClusterServicePdu(pdu);
 -                            if(result == null)
 -                                result = "";
 -
 -                            if(pdu.getPduType() == ClusterServicePdu.PDU_TYPE_REQUEST) {
 -                                ClusterServicePdu responsePdu = new ClusterServicePdu();
 -                                responsePdu.setPduType(ClusterServicePdu.PDU_TYPE_RESPONSE);
 -                                responsePdu.setSourcePeer(pdu.getDestPeer());
 -                                responsePdu.setDestPeer(pdu.getSourcePeer());
 -                                responsePdu.setAckSequenceId(pdu.getSequenceId());
 -                                responsePdu.setJsonPackage(result);
 -
 -                                addOutgoingClusterPdu(responsePdu);
 -                            }
 -                        }
 -                    }
 +                	public void run() {
 +		                if(pdu.getPduType() == ClusterServicePdu.PDU_TYPE_RESPONSE) {
 +		                    ClusterServiceRequestPdu requestPdu = popRequestPdu(pdu.getAckSequenceId());
 +		                    if(requestPdu != null) {
 +		                        requestPdu.setResponseResult(pdu.getJsonPackage());
 +		                        synchronized(requestPdu) {
 +		                            requestPdu.notifyAll();
 +		                        }
 +		                    } else {
 +		                        s_logger.warn("Original request has already been cancelled. pdu:
" + _gson.toJson(pdu));
 +		                    }
 +		                } else {
 +		                    String result = dispatchClusterServicePdu(pdu);
 +		                    if(result == null)
 +		                        result = "";
 +		                    
 +		                    if(pdu.getPduType() == ClusterServicePdu.PDU_TYPE_REQUEST) {
 +			                    ClusterServicePdu responsePdu = new ClusterServicePdu();
 +			                    responsePdu.setPduType(ClusterServicePdu.PDU_TYPE_RESPONSE);
 +			                    responsePdu.setSourcePeer(pdu.getDestPeer());
 +			                    responsePdu.setDestPeer(pdu.getSourcePeer());
 +			                    responsePdu.setAckSequenceId(pdu.getSequenceId());
 +			                    responsePdu.setJsonPackage(result);
 +			                    
 +			                    addOutgoingClusterPdu(responsePdu);
 +		                    }
 +		                }
 +                	}
                  });
              } catch(Throwable e) {
                  s_logger.error("Unexcpeted exception: ", e);
@@@ -489,10 -463,11 +495,11 @@@
          return null;
      }
  
+     @Override
      public void OnReceiveClusterServicePdu(ClusterServicePdu pdu) {
 -        addIncomingClusterPdu(pdu);
 +    	addIncomingClusterPdu(pdu);
      }
 -
 +    
      @Override
      public Answer[] sendToAgent(Long hostId, Command[] cmds, boolean stopOnError) throws
AgentUnavailableException, OperationTimedoutException {
          Commands commands = new Commands(stopOnError ? OnError.Stop : OnError.Continue);
@@@ -1367,10 -1301,10 +1333,10 @@@
              throw new ConfigurationException("Unable to set current cluster service adapter");
          }
  
-         _agentLBEnabled = Boolean.valueOf(configDao.getValue(Config.AgentLbEnable.key()));
+         _agentLBEnabled = Boolean.valueOf(_configDao.getValue(Config.AgentLbEnable.key()));
 -
 +        
          String connectedAgentsThreshold = configs.get("agent.load.threshold");
 -
 +        
          if (connectedAgentsThreshold != null) {
              _connectedAgentsThreshold = Double.parseDouble(connectedAgentsThreshold);
          }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/296c2033/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/296c2033/server/src/com/cloud/host/dao/HostDaoImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/host/dao/HostDaoImpl.java
index c7c014d,5d56485..c03611d
--- a/server/src/com/cloud/host/dao/HostDaoImpl.java
+++ b/server/src/com/cloud/host/dao/HostDaoImpl.java
@@@ -68,61 -73,60 +73,65 @@@ public class HostDaoImpl extends Generi
      private static final Logger status_logger = Logger.getLogger(Status.class);
      private static final Logger state_logger = Logger.getLogger(ResourceState.class);
  
-     protected final SearchBuilder<HostVO> TypePodDcStatusSearch;
- 
-     protected final SearchBuilder<HostVO> IdStatusSearch;
-     protected final SearchBuilder<HostVO> TypeDcSearch;
-     protected final SearchBuilder<HostVO> TypeDcStatusSearch;
-     protected final SearchBuilder<HostVO> MsStatusSearch;
-     protected final SearchBuilder<HostVO> DcPrivateIpAddressSearch;
-     protected final SearchBuilder<HostVO> DcStorageIpAddressSearch;
- 
-     protected final SearchBuilder<HostVO> GuidSearch;
-     protected final SearchBuilder<HostVO> DcSearch;
-     protected final SearchBuilder<HostVO> PodSearch;
-     protected final SearchBuilder<HostVO> TypeSearch;
-     protected final SearchBuilder<HostVO> StatusSearch;
-     protected final SearchBuilder<HostVO> ResourceStateSearch;
-     protected final SearchBuilder<HostVO> NameLikeSearch;
-     protected final SearchBuilder<HostVO> NameSearch;
-     protected final SearchBuilder<HostVO> SequenceSearch;
-     protected final SearchBuilder<HostVO> DirectlyConnectedSearch;
-     protected final SearchBuilder<HostVO> UnmanagedDirectConnectSearch;
-     protected final SearchBuilder<HostVO> UnmanagedApplianceSearch;
-     protected final SearchBuilder<HostVO> MaintenanceCountSearch;
-     protected final SearchBuilder<HostVO> ClusterStatusSearch;
-     protected final SearchBuilder<HostVO> TypeNameZoneSearch;
-     protected final SearchBuilder<HostVO> AvailHypevisorInZone;
- 
-     protected final SearchBuilder<HostVO> DirectConnectSearch;
-     protected final SearchBuilder<HostVO> ManagedDirectConnectSearch;
-     protected final SearchBuilder<HostVO> ManagedRoutingServersSearch;
-     protected final SearchBuilder<HostVO> SecondaryStorageVMSearch;
-     
- 
-     protected final GenericSearchBuilder<HostVO, Long> HostsInStatusSearch;
-     protected final GenericSearchBuilder<HostVO, Long> CountRoutingByDc;
-     protected final SearchBuilder<HostTransferMapVO> HostTransferSearch;
+     protected SearchBuilder<HostVO> TypePodDcStatusSearch;
+ 
+     protected SearchBuilder<HostVO> IdStatusSearch;
+     protected SearchBuilder<HostVO> TypeDcSearch;
+     protected SearchBuilder<HostVO> TypeDcStatusSearch;
+     protected SearchBuilder<HostVO> TypeClusterStatusSearch;
+     protected SearchBuilder<HostVO> MsStatusSearch;
+     protected SearchBuilder<HostVO> DcPrivateIpAddressSearch;
+     protected SearchBuilder<HostVO> DcStorageIpAddressSearch;
+ 
+     protected SearchBuilder<HostVO> GuidSearch;
+     protected SearchBuilder<HostVO> DcSearch;
+     protected SearchBuilder<HostVO> PodSearch;
+     protected SearchBuilder<HostVO> TypeSearch;
+     protected SearchBuilder<HostVO> StatusSearch;
+     protected SearchBuilder<HostVO> ResourceStateSearch;
+     protected SearchBuilder<HostVO> NameLikeSearch;
+     protected SearchBuilder<HostVO> NameSearch;
+     protected SearchBuilder<HostVO> SequenceSearch;
+     protected SearchBuilder<HostVO> DirectlyConnectedSearch;
+     protected SearchBuilder<HostVO> UnmanagedDirectConnectSearch;
+     protected SearchBuilder<HostVO> UnmanagedApplianceSearch;
+     protected SearchBuilder<HostVO> MaintenanceCountSearch;
+     protected SearchBuilder<HostVO> ClusterStatusSearch;
+     protected SearchBuilder<HostVO> TypeNameZoneSearch;
+     protected SearchBuilder<HostVO> AvailHypevisorInZone;
+ 
+     protected SearchBuilder<HostVO> DirectConnectSearch;
+     protected SearchBuilder<HostVO> ManagedDirectConnectSearch;
+     protected SearchBuilder<HostVO> ManagedRoutingServersSearch;
+     protected SearchBuilder<HostVO> SecondaryStorageVMSearch;
+ 
+ 
+     protected GenericSearchBuilder<HostVO, Long> HostsInStatusSearch;
+     protected GenericSearchBuilder<HostVO, Long> CountRoutingByDc;
+     protected SearchBuilder<HostTransferMapVO> HostTransferSearch;
      protected SearchBuilder<ClusterVO> ClusterManagedSearch;
-     protected final SearchBuilder<HostVO> RoutingSearch;
- 
-     protected final SearchBuilder<HostVO> HostsForReconnectSearch;
-     protected final GenericSearchBuilder<HostVO, Long> ClustersOwnedByMSSearch;
-     protected final GenericSearchBuilder<ClusterVO, Long> AllClustersSearch;
-     protected final SearchBuilder<HostVO> HostsInClusterSearch;
- 
-     protected final Attribute _statusAttr;
-     protected final Attribute _resourceStateAttr;
-     protected final Attribute _msIdAttr;
-     protected final Attribute _pingTimeAttr;
- 
-     protected final HostDetailsDaoImpl _detailsDao = ComponentLocator.inject(HostDetailsDaoImpl.class);
-     protected final HostTagsDaoImpl _hostTagsDao = ComponentLocator.inject(HostTagsDaoImpl.class);
-     protected final HostTransferMapDaoImpl _hostTransferDao = ComponentLocator.inject(HostTransferMapDaoImpl.class);
-     protected final ClusterDaoImpl _clusterDao = ComponentLocator.inject(ClusterDaoImpl.class);
+     protected SearchBuilder<HostVO> RoutingSearch;
+ 
++    protected SearchBuilder<HostVO> HostsForReconnectSearch;
++    protected GenericSearchBuilder<HostVO, Long> ClustersOwnedByMSSearch;
++    protected GenericSearchBuilder<ClusterVO, Long> AllClustersSearch;
++    protected SearchBuilder<HostVO> HostsInClusterSearch;
++    
+     protected Attribute _statusAttr;
+     protected Attribute _resourceStateAttr;
+     protected Attribute _msIdAttr;
+     protected Attribute _pingTimeAttr;
 -
 +    
+     @Inject protected HostDetailsDao _detailsDao;
+     @Inject protected HostTagsDao _hostTagsDao;
+     @Inject protected HostTransferMapDao _hostTransferDao;
+     @Inject protected ClusterDao _clusterDao;
  
      public HostDaoImpl() {
+     }
+ 
+     @PostConstruct
+     public void init() {
  
          MaintenanceCountSearch = createSearchBuilder();
          MaintenanceCountSearch.and("cluster", MaintenanceCountSearch.entity().getClusterId(),
SearchCriteria.Op.EQ);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/296c2033/server/src/com/cloud/network/NetworkManagerImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/network/NetworkManagerImpl.java
index 6fe810e,68e100f..65b4b1a
--- a/server/src/com/cloud/network/NetworkManagerImpl.java
+++ b/server/src/com/cloud/network/NetworkManagerImpl.java
@@@ -16,6 -16,31 +16,32 @@@
  // under the License.
  package com.cloud.network;
  
+ import java.net.URI;
+ import java.util.ArrayList;
+ import java.util.Arrays;
+ import java.util.Collections;
+ import java.util.Comparator;
+ import java.util.Date;
+ import java.util.HashMap;
+ import java.util.HashSet;
+ import java.util.List;
+ import java.util.Map;
+ import java.util.Random;
+ import java.util.Set;
++import java.util.UUID;
+ import java.util.concurrent.Executors;
+ import java.util.concurrent.ScheduledExecutorService;
+ import java.util.concurrent.TimeUnit;
+ 
+ import javax.ejb.Local;
+ import javax.inject.Inject;
+ import javax.naming.ConfigurationException;
+ 
+ import org.apache.cloudstack.acl.ControlledEntity.ACLType;
+ import org.apache.cloudstack.acl.SecurityChecker.AccessType;
+ import org.apache.log4j.Logger;
+ import org.springframework.stereotype.Component;
+ 
  import com.cloud.agent.AgentManager;
  import com.cloud.agent.Listener;
  import com.cloud.agent.api.*;
@@@ -77,13 -122,10 +123,12 @@@ import com.cloud.offerings.dao.NetworkO
  import com.cloud.org.Grouping;
  import com.cloud.user.*;
  import com.cloud.user.dao.AccountDao;
 +import com.cloud.user.dao.UserDao;
 +import com.cloud.utils.Journal;
  import com.cloud.utils.NumbersUtil;
  import com.cloud.utils.Pair;
- import com.cloud.utils.component.Adapters;
- import com.cloud.utils.component.Inject;
- import com.cloud.utils.component.Manager;
+ import com.cloud.utils.component.AdapterBase;
+ import com.cloud.utils.component.ManagerBase;
  import com.cloud.utils.concurrency.NamedThreadFactory;
  import com.cloud.utils.db.*;
  import com.cloud.utils.db.JoinBuilder.JoinType;
@@@ -156,15 -185,16 +190,16 @@@ public class NetworkManagerImpl extend
      RemoteAccessVpnService _vpnMgr;
      @Inject
      PodVlanMapDao _podVlanMapDao;
-     @Inject(adapter = NetworkGuru.class)
-     Adapters<NetworkGuru> _networkGurus;
-     @Inject(adapter = NetworkElement.class)
-     Adapters<NetworkElement> _networkElements;
-     @Inject(adapter = IpDeployer.class)
-     Adapters<IpDeployer> _ipDeployers;
-     @Inject(adapter = DhcpServiceProvider.class)
-     Adapters<DhcpServiceProvider> _dhcpProviders;
+ 
+     @Inject 
+     List<NetworkGuru> _networkGurus;
+ 
+     @Inject  protected List<NetworkElement> _networkElements;
+ 
+     @Inject NetworkDomainDao _networkDomainDao;
+     @Inject List<IpDeployer> _ipDeployers;
+     @Inject List<DhcpServiceProvider> _dhcpProviders;
 -
 + 
      @Inject
      VMInstanceDao _vmDao;
      @Inject
@@@ -1550,13 -1572,13 +1577,13 @@@
      }
  
      @Override
 -    public NicProfile prepareNic(VirtualMachineProfile<? extends VMInstanceVO> vmProfile,
DeployDestination 
 +    public NicProfile prepareNic(VirtualMachineProfile<? extends VMInstanceVO> vmProfile,
DeployDestination
              dest, ReservationContext context, long nicId, NetworkVO network)
 -                    throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException,

 -                    ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException
{
 -
 +            throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException,
 +            ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException
{
 +        
          Integer networkRate = _networkModel.getNetworkRate(network.getId(), vmProfile.getId());
-         NetworkGuru guru = _networkGurus.get(network.getGuruName());
+         NetworkGuru guru = AdapterBase.getAdapterByName(_networkGurus, network.getGuruName());
          NicVO nic = _nicDao.findById(nicId);
  
          NicProfile profile = null;
@@@ -3478,8 -3478,8 +3505,8 @@@
              for (Nic nic : nics) {
                  NetworkVO network = _networksDao.findById(nic.getNetworkId());
                  Integer networkRate = _networkModel.getNetworkRate(network.getId(), vm.getId());
 -
 +    
-                 NetworkGuru guru = _networkGurus.get(network.getGuruName());
+                 NetworkGuru guru = AdapterBase.getAdapterByName(_networkGurus, network.getGuruName());
                  NicProfile profile = new NicProfile(nic, network, nic.getBroadcastUri(),
nic.getIsolationUri(), 
                          networkRate, _networkModel.isSecurityGroupSupportedInNetwork(network),
_networkModel.getNetworkTag(vm.getHypervisorType(), network));
                  guru.updateNicProfile(profile, network);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/296c2033/server/src/com/cloud/network/NetworkServiceImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/network/NetworkServiceImpl.java
index 5c70caa,6872c3f..8eeb16c
--- a/server/src/com/cloud/network/NetworkServiceImpl.java
+++ b/server/src/com/cloud/network/NetworkServiceImpl.java
@@@ -70,14 -109,16 +109,18 @@@ import com.cloud.tags.ResourceTagVO
  import com.cloud.tags.dao.ResourceTagDao;
  import com.cloud.user.*;
  import com.cloud.user.dao.AccountDao;
 +import com.cloud.user.dao.UserDao;
  import com.cloud.utils.AnnotationHelper;
 +import com.cloud.utils.Journal;
  import com.cloud.utils.NumbersUtil;
  import com.cloud.utils.Pair;
- import com.cloud.utils.component.Adapters;
- import com.cloud.utils.component.Inject;
  import com.cloud.utils.component.Manager;
+ import com.cloud.utils.component.ManagerBase;
+ import com.cloud.utils.db.DB;
+ import com.cloud.utils.db.Filter;
+ import com.cloud.utils.db.JoinBuilder;
+ import com.cloud.utils.db.SearchBuilder;
+ import com.cloud.utils.db.SearchCriteria;
  import com.cloud.utils.db.*;
  import com.cloud.utils.db.SearchCriteria.Op;
  import com.cloud.utils.exception.CloudRuntimeException;
@@@ -104,13 -132,13 +134,13 @@@ import java.util.*
  /**
   * NetworkServiceImpl implements NetworkService.
   */
+ @Component
  @Local(value = { NetworkService.class })
- public class NetworkServiceImpl implements  NetworkService, Manager {
+ public class NetworkServiceImpl extends ManagerBase implements  NetworkService {
      private static final Logger s_logger = Logger.getLogger(NetworkServiceImpl.class);
  
-     String _name;
 -    @Inject 
 -    DataCenterDao  _dcDao = null;
 +    @Inject
 +    DataCenterDao _dcDao = null;
      @Inject
      VlanDao _vlanDao = null;
      @Inject
@@@ -145,10 -172,9 +175,9 @@@
  
      @Inject
      UsageEventDao _usageEventDao;
 -
 +    
-     @Inject(adapter = NetworkGuru.class)
-     Adapters<NetworkGuru> _networkGurus;
+     @Inject List<NetworkGuru> _networkGurus;
 -
 +  
      @Inject
      NetworkDomainDao _networkDomainDao;
      @Inject

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/296c2033/server/src/com/cloud/network/dao/NetworkDaoImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/network/dao/NetworkDaoImpl.java
index f21854e,8fadf04..43c581f
--- a/server/src/com/cloud/network/dao/NetworkDaoImpl.java
+++ b/server/src/com/cloud/network/dao/NetworkDaoImpl.java
@@@ -59,33 -56,31 +56,36 @@@ import com.cloud.utils.net.NetUtils
  @Local(value = NetworkDao.class)
  @DB(txn = false)
  public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements NetworkDao
{
-     final SearchBuilder<NetworkVO> AllFieldsSearch;
-     final SearchBuilder<NetworkVO> AccountSearch;
-     final SearchBuilder<NetworkVO> RelatedConfigSearch;
-     final SearchBuilder<NetworkVO> AccountNetworkSearch;
-     final SearchBuilder<NetworkVO> ZoneBroadcastUriSearch;
-     final SearchBuilder<NetworkVO> ZoneSecurityGroupSearch;
-     final GenericSearchBuilder<NetworkVO, Integer> CountBy;
-     final SearchBuilder<NetworkVO> PhysicalNetworkSearch;
-     final SearchBuilder<NetworkVO> SecurityGroupSearch;
-     final GenericSearchBuilder<NetworkVO, Long> NetworksRegularUserCanCreateSearch;
-     private final GenericSearchBuilder<NetworkVO, Integer> NetworksCount;
-     final SearchBuilder<NetworkVO> SourceNATSearch;
-     final GenericSearchBuilder<NetworkVO, Long>  CountByZoneAndURI;
-     final GenericSearchBuilder<NetworkVO, Long> VpcNetworksCount;
-     final SearchBuilder<NetworkVO> OfferingAccountNetworkSearch;
-     final GenericSearchBuilder<NetworkVO, Long> GarbageCollectedSearch;
- 
-     ResourceTagsDaoImpl _tagsDao = ComponentLocator.inject(ResourceTagsDaoImpl.class);
-     NetworkAccountDaoImpl _accountsDao = ComponentLocator.inject(NetworkAccountDaoImpl.class);
-     NetworkDomainDaoImpl _domainsDao = ComponentLocator.inject(NetworkDomainDaoImpl.class);
-     NetworkOpDaoImpl _opDao = ComponentLocator.inject(NetworkOpDaoImpl.class);
-     NetworkServiceMapDaoImpl _ntwkSvcMap = ComponentLocator.inject(NetworkServiceMapDaoImpl.class);
-     NetworkOfferingDaoImpl _ntwkOffDao = ComponentLocator.inject(NetworkOfferingDaoImpl.class);
-     NetworkOpDaoImpl _ntwkOpDao = ComponentLocator.inject(NetworkOpDaoImpl.class);
- 
- 
-     final TableGenerator _tgMacAddress;
+     SearchBuilder<NetworkVO> AllFieldsSearch;
+     SearchBuilder<NetworkVO> AccountSearch;
+     SearchBuilder<NetworkVO> RelatedConfigSearch;
+     SearchBuilder<NetworkVO> AccountNetworkSearch;
+     SearchBuilder<NetworkVO> ZoneBroadcastUriSearch;
+     SearchBuilder<NetworkVO> ZoneSecurityGroupSearch;
+     GenericSearchBuilder<NetworkVO, Integer> CountBy;
+     SearchBuilder<NetworkVO> PhysicalNetworkSearch;
+     SearchBuilder<NetworkVO> SecurityGroupSearch;
+     GenericSearchBuilder<NetworkVO, Long> NetworksRegularUserCanCreateSearch;
+     GenericSearchBuilder<NetworkVO, Integer> NetworksCount;
+     SearchBuilder<NetworkVO> SourceNATSearch;
+     GenericSearchBuilder<NetworkVO, Long>  CountByZoneAndURI;
+     GenericSearchBuilder<NetworkVO, Long> VpcNetworksCount;
+     SearchBuilder<NetworkVO> OfferingAccountNetworkSearch;
+ 
++    GenericSearchBuilder<NetworkVO, Long> GarbageCollectedSearch;
++    
++    
++    
+     @Inject ResourceTagsDaoImpl _tagsDao;
+     @Inject NetworkAccountDaoImpl _accountsDao;
+     @Inject NetworkDomainDaoImpl _domainsDao;
+     @Inject NetworkOpDaoImpl _opDao;
+     @Inject NetworkServiceMapDaoImpl _ntwkSvcMap;
+     @Inject NetworkOfferingDaoImpl _ntwkOffDao;
 -
++    @Inject NetworkOpDaoImpl _ntwkOpDao;
+ 
+     TableGenerator _tgMacAddress;
++
      Random _rand = new Random(System.currentTimeMillis());
      long _prefix = 0x2;
  

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/296c2033/server/src/com/cloud/network/dao/NetworkOpDaoImpl.java
----------------------------------------------------------------------


Mime
View raw message