This commit is contained in:
Alex Huang 2013-01-17 06:50:19 -08:00
commit b751b69c55
85 changed files with 315 additions and 413 deletions

View File

@ -1,31 +0,0 @@
// 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.
package org.apache.cloudstack.api;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import com.cloud.utils.component.PluggableService;
@Target(FIELD)
@Retention(RUNTIME)
public @interface PlugService {
Class<? extends PluggableService> pluggableService() default PluggableService.class;
}

View File

@ -16,6 +16,10 @@
// under the License.
package org.apache.cloudstack.api.command.admin.router;
import java.util.List;
import javax.inject.Inject;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;
@ -23,7 +27,6 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.PlugService;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.VirtualRouterProviderResponse;
import com.cloud.network.VirtualRouterProvider;
@ -41,8 +44,8 @@ public class ConfigureVirtualRouterElementCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(ConfigureVirtualRouterElementCmd.class.getName());
private static final String s_name = "configurevirtualrouterelementresponse";
@PlugService
private VirtualRouterElementService _service;
@Inject
private List<VirtualRouterElementService> _service;
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////
@ -114,7 +117,7 @@ public class ConfigureVirtualRouterElementCmd extends BaseAsyncCmd {
@Override
public void execute() throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException{
UserContext.current().setEventDetails("Virtual router element: " + id);
VirtualRouterProvider result = _service.configure(this);
VirtualRouterProvider result = _service.get(0).configure(this);
if (result != null){
VirtualRouterProviderResponse routerResponse = _responseGenerator.createVirtualRouterProviderResponse(result);
routerResponse.setResponseName(getCommandName());

View File

@ -16,6 +16,10 @@
// under the License.
package org.apache.cloudstack.api.command.admin.router;
import java.util.List;
import javax.inject.Inject;
import org.apache.cloudstack.api.*;
import org.apache.cloudstack.api.response.ProviderResponse;
import org.apache.log4j.Logger;
@ -35,8 +39,8 @@ public class CreateVirtualRouterElementCmd extends BaseAsyncCreateCmd {
public static final Logger s_logger = Logger.getLogger(CreateVirtualRouterElementCmd.class.getName());
private static final String s_name = "createvirtualrouterelementresponse";
@PlugService
private VirtualRouterElementService _service;
@Inject
private List<VirtualRouterElementService> _service;
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////
@ -76,7 +80,7 @@ public class CreateVirtualRouterElementCmd extends BaseAsyncCreateCmd {
@Override
public void execute(){
UserContext.current().setEventDetails("Virtual router element Id: "+getEntityId());
VirtualRouterProvider result = _service.getCreatedElement(getEntityId());
VirtualRouterProvider result = _service.get(0).getCreatedElement(getEntityId());
if (result != null) {
VirtualRouterProviderResponse response = _responseGenerator.createVirtualRouterProviderResponse(result);
response.setResponseName(getCommandName());
@ -88,7 +92,7 @@ public class CreateVirtualRouterElementCmd extends BaseAsyncCreateCmd {
@Override
public void create() throws ResourceAllocationException {
VirtualRouterProvider result = _service.addElement(getNspId(), VirtualRouterProviderType.VirtualRouter);
VirtualRouterProvider result = _service.get(0).addElement(getNspId(), VirtualRouterProviderType.VirtualRouter);
if (result != null) {
setEntityId(result.getId());
setEntityUuid(result.getUuid());

View File

@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.admin.router;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
import org.apache.cloudstack.api.command.user.network.ListNetworkOfferingsCmd;
import org.apache.cloudstack.api.response.ProviderResponse;
import org.apache.log4j.Logger;
@ -27,7 +29,6 @@ import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListCmd;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.PlugService;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.VirtualRouterProviderResponse;
@ -43,8 +44,9 @@ public class ListVirtualRouterElementsCmd extends BaseListCmd {
public static final Logger s_logger = Logger.getLogger(ListNetworkOfferingsCmd.class.getName());
private static final String _name = "listvirtualrouterelementsresponse";
@PlugService
private VirtualRouterElementService _service;
// TODO, VirtualRouterElementServer is not singleton in system!
@Inject
private List<VirtualRouterElementService> _service;
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////
@ -95,7 +97,7 @@ public class ListVirtualRouterElementsCmd extends BaseListCmd {
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException {
List<? extends VirtualRouterProvider> providers = _service.searchForVirtualRouterElement(this);
List<? extends VirtualRouterProvider> providers = _service.get(0).searchForVirtualRouterElement(this);
ListResponse<VirtualRouterProviderResponse> response = new ListResponse<VirtualRouterProviderResponse>();
List<VirtualRouterProviderResponse> providerResponses = new ArrayList<VirtualRouterProviderResponse>();
for (VirtualRouterProvider provider : providers) {

View File

@ -40,9 +40,6 @@
<!--
Network Elements
-->
<bean id="VirtualRouter" class="com.cloud.network.element.VirtualRouterElement">
<property name="name" value="VirtualRouter"/>
</bean>
<bean id="Ovs" class="com.cloud.network.element.OvsElement">
<property name="name" value="Ovs"/>
</bean>
@ -55,6 +52,9 @@
<bean id="SecurityGroupProvider" class="com.cloud.network.element.SecurityGroupElement">
<property name="name" value="SecurityGroupProvider"/>
</bean>
<bean id="VirtualRouter" class="com.cloud.network.element.VirtualRouterElement">
<property name="name" value="VirtualRouter"/>
</bean>
<bean id="VpcVirtualRouter" class="com.cloud.network.element.VpcVirtualRouterElement">
<property name="name" value="VpcVirtualRouter"/>
</bean>
@ -65,12 +65,173 @@
<!--
Adapters
-->
<bean id="StaticRoleBasedAPIAccessChecker" class="org.apache.cloudstack.acl.StaticRoleBasedAPIAccessChecker"/>
<bean id="FirstFitRouting" class="com.cloud.agent.manager.allocator.impl.FirstFitRoutingAllocator">
<property name="name" value="FirstFitRouting"/>
</bean>
<!--
Gurus
Storage pool allocators
-->
<bean id="LocalStoragePoolAllocator" class="com.cloud.storage.allocator.LocalStoragePoolAllocator">
<property name="name" value="LocalStorage"/>
</bean>
<bean id="FirstFitStoragePoolAllocator" class="com.cloud.storage.allocator.FirstFitStoragePoolAllocator">
<property name="name" value="Storage"/>
</bean>
<bean id="UserConcentratedAllocator" class="com.cloud.agent.manager.allocator.impl.UserConcentratedAllocator">
<property name="name" value="User First"/>
</bean>
<bean id="ConsoleProxyAllocator" class="com.cloud.consoleproxy.ConsoleProxyBalanceAllocator">
<property name="name" value="Balance"/>
</bean>
<bean id="StaticRoleBasedAPIAccessChecker" class="org.apache.cloudstack.acl.StaticRoleBasedAPIAccessChecker"/>
<bean id="ExteralIpAddressAllocator" class="com.cloud.network.ExteralIpAddressAllocator">
<property name="name" value="Basic"/>
</bean>
<!--
Authenticators
-->
<bean id="MD5UserAuthenticator" class="com.cloud.server.auth.MD5UserAuthenticator">
<property name="name" value="MD5"/>
</bean>
<bean id="LDAPUserAuthenticator" class="com.cloud.server.auth.LDAPUserAuthenticator">
<property name="name" value="LDAP"/>
</bean>
<!--
Investigators
-->
<bean id="CheckOnAgentInvestigator" class="com.cloud.ha.CheckOnAgentInvestigator">
<property name="name" value="SimpleInvestigator"/>
</bean>
<bean id="XenServerInvestigator" class="com.cloud.ha.XenServerInvestigator">
<property name="name" value="XenServerInvestigator"/>
</bean>
<bean id="UserVmDomRInvestigator" class="com.cloud.ha.UserVmDomRInvestigator">
<property name="name" value="PingInvestigator"/>
</bean>
<bean id="ManagementIPSystemVMInvestigator" class="com.cloud.ha.ManagementIPSystemVMInvestigator">
<property name="name" value="ManagementIPSysVMInvestigator"/>
</bean>
<!--
Fencers
-->
<bean id="XenServerFencer" class="com.cloud.ha.XenServerFencer">
<property name="name" value="XenServerFenceBuilder"/>
</bean>
<bean id="KVMFencer" class="com.cloud.ha.KVMFencer">
<property name="name" value="KVMFenceBuilder"/>
</bean>
<bean id="OvmFencer" class="com.cloud.ovm.hypervisor.OvmFencer">
<property name="name" value="OvmFenceBuilder"/>
</bean>
<bean id="XcpServerDiscoverer" class="com.cloud.hypervisor.xen.discoverer.XcpServerDiscoverer">
<property name="name" value="XCP Agent"/>
</bean>
<bean id="SecondaryStorageDiscoverer" class="com.cloud.storage.secondary.SecondaryStorageDiscoverer">
<property name="name" value="SecondaryStorage"/>
</bean>
<bean id="KvmServerDiscoverer" class="com.cloud.hypervisor.kvm.discoverer.KvmServerDiscoverer">
<property name="name" value="KVM Agent"/>
</bean>
<bean id="BareMetalDiscoverer" class="com.cloud.baremetal.BareMetalDiscoverer">
<property name="name" value="Bare Metal Agent"/>
</bean>
<bean id="HypervServerDiscoverer" class="com.cloud.hypervisor.hyperv.HypervServerDiscoverer">
<property name="name" value="SCVMMServer"/>
</bean>
<bean id="OvmDiscoverer" class="com.cloud.ovm.hypervisor.OvmDiscoverer">
<property name="name" value="Ovm Discover"/>
</bean>
<bean id="FirstFitPlanner" class="com.cloud.deploy.FirstFitPlanner">
<property name="name" value="First Fit"/>
</bean>
<bean id="UserDispersingPlanner" class="com.cloud.deploy.UserDispersingPlanner">
<property name="name" value="UserDispersing"/>
</bean>
<bean id="UserConcentratedPodPlanner" class="com.cloud.deploy.UserConcentratedPodPlanner">
<property name="name" value="UserConcentratedPod"/>
</bean>
<bean id="BareMetalPlanner" class="com.cloud.deploy.BareMetalPlanner">
<property name="name" value="BareMetal Fit"/>
</bean>
<!--
Network Gurus
-->
<bean id="StorageNetworkGuru" class="com.cloud.network.guru.StorageNetworkGuru">
<property name="name" value="StorageNetworkGuru"/>
</bean>
<bean id="ExternalGuestNetworkGuru" class="com.cloud.network.guru.ExternalGuestNetworkGuru">
<property name="name" value="ExternalGuestNetworkGuru"/>
</bean>
<bean id="PublicNetworkGuru" class="com.cloud.network.guru.PublicNetworkGuru">
<property name="name" value="PublicNetworkGuru"/>
</bean>
<bean id="PodBasedNetworkGuru" class="com.cloud.network.guru.PodBasedNetworkGuru">
<property name="name" value="PodBasedNetworkGuru"/>
</bean>
<bean id="ControlNetworkGuru" class="com.cloud.network.guru.ControlNetworkGuru">
<property name="name" value="ControlNetworkGuru"/>
</bean>
<bean id="DirectNetworkGuru" class="com.cloud.network.guru.DirectNetworkGuru">
<property name="name" value="DirectNetworkGuru"/>
</bean>
<bean id="DirectPodBasedNetworkGuru" class="com.cloud.network.guru.DirectPodBasedNetworkGuru">
<property name="name" value="DirectPodBasedNetworkGuru"/>
</bean>
<bean id="OvsGuestNetworkGuru" class="com.cloud.network.guru.OvsGuestNetworkGuru">
<property name="name" value="OvsGuestNetworkGuru"/>
</bean>
<bean id="PrivateNetworkGuru" class="com.cloud.network.guru.PrivateNetworkGuru">
<property name="name" value="PrivateNetworkGuru"/>
</bean>
<bean id="NiciraNvpGuestNetworkGuru" class="com.cloud.network.guru.NiciraNvpGuestNetworkGuru">
<property name="name" value="NiciraNvpGuestNetworkGuru"/>
</bean>
<!--
Hypervisor Gurus
-->
<bean id="XenServerGuru" class="com.cloud.hypervisor.XenServerGuru">
<property name="name" value="XenServerGuru"/>
</bean>
<bean id="KVMGuru" class="com.cloud.hypervisor.KVMGuru">
<property name="name" value="KVMGuru"/>
</bean>
<bean id="BareMetalGuru" class="com.cloud.baremetal.BareMetalGuru">
<property name="name" value="BareMetalGuru"/>
</bean>
<bean id="HypervGuru" class="com.cloud.hypervisor.guru.HypervGuru">
<property name="name" value="HypervGuru"/>
</bean>
<bean id="OvmGuru" class="com.cloud.ovm.hypervisor.OvmGuru">
<property name="name" value="OvmGuru"/>
</bean>
</beans>

View File

@ -30,6 +30,7 @@ import javax.persistence.Table;
import javax.persistence.TableGenerator;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import org.apache.cloudstack.api.Identity;
import com.cloud.storage.Storage.StoragePoolType;
@ -132,7 +133,8 @@ public class VolumeVO implements Volume {
@Column(name = "uuid")
String uuid;
@Column(name="reservation")
@Transient
// @Column(name="reservation")
String reservationId;
// Real Constructor

View File

@ -90,6 +90,8 @@
</execution>
</executions>
</plugin>
<!-- DatabaseCreator driver here -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
@ -152,6 +154,8 @@
</arguments>
</configuration>
</plugin>
<!-- Database schema deployer and db prefill seeder -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sql-maven-plugin</artifactId>
@ -173,136 +177,6 @@
<skip>${maven.test.skip}</skip>
<forceMojoExecution>true</forceMojoExecution>
</configuration>
<executions>
<execution>
<id>create-other-schema</id>
<phase>process-test-resources</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<srcFiles>
<srcFile>${basedir}/target/db/create-schema-view.sql</srcFile>
<srcFile>${basedir}/target/db/templates.sql</srcFile>
<srcFile>${basedir}/target/db/cloudbridge_schema.sql</srcFile>
<srcFile>${basedir}/target/db/cloudbridge_multipart.sql</srcFile>
<srcFile>${basedir}/target/db/cloudbridge_index.sql</srcFile>
<srcFile>${basedir}/target/db/cloudbridge_multipart_alter.sql</srcFile>
<srcFile>${basedir}/target/db/cloudbridge_bucketpolicy.sql</srcFile>
<srcFile>${basedir}/target/db/cloudbridge_policy_alter.sql</srcFile>
<srcFile>${basedir}/target/db/cloudbridge_offering.sql</srcFile>
<srcFile>${basedir}/target/db/cloudbridge_offering_alter.sql</srcFile>
</srcFiles>
</configuration>
</execution>
<execution>
<id>prefill-schema</id>
<phase>process-test-resources</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<sqlCommand>INSERT INTO `cloud`.`domain` (id, name,
parent, path, owner) VALUES (1, 'ROOT', NULL, '/',
2)</sqlCommand>
</configuration>
</execution>
<execution>
<id>prefill-configuration</id>
<phase>process-test-resources</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<sqlCommand>INSERT INTO `cloud`.`configuration`
(category, instance, component, name, value) VALUES
('Hidden', 'DEFAULT', 'management-server', 'init',
'false')</sqlCommand>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>cleandb</id>
<activation>
<property>
<name>cleandb</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>${project.parent.basedir}/utils/conf/db.properties</file>
<file>${project.parent.basedir}/utils/conf/db.properties.override</file>
</files>
<quiet>true</quiet>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<filter token="VERSION" value="${project.version}" />
<copy todir="${basedir}/target/db" filtering="true">
<fileset dir="${project.basedir}/../setup/db/" />
</copy>
<copy todir="${basedir}/target/db" filtering="true">
<fileset
dir="${project.basedir}/../awsapi-setup/db/mysql/">
<include name="**/*.sql" />
</fileset>
</copy>
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sql-maven-plugin</artifactId>
<version>1.5</version>
<dependencies>
<!-- specify the dependent jdbc driver here -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${cs.mysql.version}</version>
</dependency>
</dependencies>
<configuration>
<driver>org.gjt.mm.mysql.Driver</driver>
<url>jdbc:mysql://${db.cloud.host}:${db.cloud.port}/cloud</url>
<username>${db.cloud.username}</username>
<password>${db.cloud.password}</password>
<!--all executions are ignored if -Dmaven.test.skip=true -->
<skip>${maven.test.skip}</skip>
<forceMojoExecution>true</forceMojoExecution>
</configuration>
<executions>
<execution>
<id>drop-database</id>

View File

@ -43,7 +43,6 @@ import com.cloud.utils.component.PluggableService;
// This is the default API access checker that grab's the user's account
// based on the account type, access is granted
@Component
@Local(value=APIChecker.class)
public class StaticRoleBasedAPIAccessChecker extends AdapterBase implements APIChecker {

View File

@ -16,13 +16,14 @@
// under the License.
package org.apache.cloudstack.api.command.user.discovery;
import javax.inject.Inject;
import com.cloud.user.UserContext;
import org.apache.cloudstack.acl.RoleType;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.PlugService;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.discovery.ApiDiscoveryService;
@ -36,7 +37,7 @@ public class ListApisCmd extends BaseCmd {
public static final Logger s_logger = Logger.getLogger(ListApisCmd.class.getName());
private static final String s_name = "listapisresponse";
@PlugService
@Inject
ApiDiscoveryService _apiDiscoveryService;
@Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="API name")

View File

@ -23,14 +23,12 @@ import java.util.Map;
import javax.ejb.Local;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.utils.Pair;
import com.cloud.vm.VirtualMachine;
import com.cloud.vm.VirtualMachineProfile;
@Component
@Local(value=DeploymentPlanner.class)
public class UserConcentratedPodPlanner extends FirstFitPlanner implements DeploymentPlanner {

View File

@ -27,7 +27,6 @@ import javax.ejb.Local;
import javax.naming.ConfigurationException;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import com.cloud.configuration.Config;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
@ -36,7 +35,6 @@ import com.cloud.utils.Pair;
import com.cloud.vm.VirtualMachine;
import com.cloud.vm.VirtualMachineProfile;
@Component
@Local(value=DeploymentPlanner.class)
public class UserDispersingPlanner extends FirstFitPlanner implements DeploymentPlanner {

View File

@ -30,7 +30,6 @@ import javax.naming.ConfigurationException;
import org.apache.log4j.Logger;
import org.apache.xmlrpc.XmlRpcException;
import org.springframework.stereotype.Component;
import com.cloud.configuration.Config;
import com.cloud.agent.api.StartupCommand;
@ -54,7 +53,6 @@ import com.cloud.utils.db.SearchCriteria2;
import com.cloud.utils.exception.CloudRuntimeException;
import com.cloud.utils.ssh.SSHCmdHelper;
@Component
@Local(value = Discoverer.class)
public class OvmDiscoverer extends DiscovererBase implements Discoverer,
ResourceStateAdapter {

View File

@ -24,7 +24,6 @@ import javax.inject.Inject;
import javax.naming.ConfigurationException;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import com.cloud.agent.AgentManager;
import com.cloud.agent.api.FenceAnswer;
@ -34,31 +33,22 @@ import com.cloud.exception.OperationTimedoutException;
import com.cloud.ha.FenceBuilder;
import com.cloud.host.HostVO;
import com.cloud.host.Status;
import com.cloud.host.dao.HostDao;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.utils.component.AdapterBase;
import com.cloud.vm.VMInstanceVO;
import com.cloud.resource.ResourceManager;
@Component
@Local(value=FenceBuilder.class)
public class OvmFencer implements FenceBuilder {
public class OvmFencer extends AdapterBase implements FenceBuilder {
private static final Logger s_logger = Logger.getLogger(OvmFencer.class);
String _name;
@Inject AgentManager _agentMgr;
@Inject ResourceManager _resourceMgr;
@Override
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
_name = name;
return true;
}
@Override
public String getName() {
// TODO Auto-generated method stub
return _name;
}
@Override
public boolean start() {
// TODO Auto-generated method stub

View File

@ -19,8 +19,6 @@ package com.cloud.ovm.hypervisor;
import javax.ejb.Local;
import javax.inject.Inject;
import org.springframework.stereotype.Component;
import com.cloud.agent.api.to.VirtualMachineTO;
import com.cloud.hypervisor.HypervisorGuru;
import com.cloud.hypervisor.HypervisorGuruBase;
@ -30,7 +28,6 @@ import com.cloud.storage.dao.GuestOSDao;
import com.cloud.vm.VirtualMachine;
import com.cloud.vm.VirtualMachineProfile;
@Component
@Local(value=HypervisorGuru.class)
public class OvmGuru extends HypervisorGuruBase implements HypervisorGuru {
@Inject GuestOSDao _guestOsDao;

View File

@ -17,13 +17,14 @@
package com.cloud.api.commands;
import javax.inject.Inject;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.PlugService;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.SuccessResponse;
import com.cloud.api.response.CiscoNexusVSMResponse;
@ -40,7 +41,7 @@ public class DeleteCiscoNexusVSMCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(DeleteCiscoNexusVSMCmd.class.getName());
private static final String s_name = "deletecisconexusvsmresponse";
@PlugService CiscoNexusVSMElementService _ciscoNexusVSMService;
@Inject CiscoNexusVSMElementService _ciscoNexusVSMService;
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////

View File

@ -17,13 +17,14 @@
package com.cloud.api.commands;
import javax.inject.Inject;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.PlugService;
import org.apache.cloudstack.api.ServerApiException;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientCapacityException;
@ -40,7 +41,7 @@ public class DisableCiscoNexusVSMCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(DisableCiscoNexusVSMCmd.class.getName());
private static final String s_name = "disablecisconexusvsmresponse";
@PlugService CiscoNexusVSMElementService _ciscoNexusVSMService;
@Inject CiscoNexusVSMElementService _ciscoNexusVSMService;
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////

View File

@ -17,6 +17,8 @@
package com.cloud.api.commands;
import javax.inject.Inject;
import org.apache.cloudstack.api.*;
import org.apache.log4j.Logger;
@ -36,7 +38,7 @@ public class EnableCiscoNexusVSMCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(EnableCiscoNexusVSMCmd.class.getName());
private static final String s_name = "enablecisconexusvsmresponse";
@PlugService CiscoNexusVSMElementService _ciscoNexusVSMService;
@Inject CiscoNexusVSMElementService _ciscoNexusVSMService;
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////

View File

@ -24,7 +24,6 @@ import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListCmd;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.PlugService;
import org.apache.cloudstack.api.ServerApiException;
import com.cloud.api.response.CiscoNexusVSMResponse;
import org.apache.cloudstack.api.response.ListResponse;
@ -39,6 +38,8 @@ import com.cloud.user.Account;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
@APICommand(name = "listCiscoNexusVSMs", responseObject=CiscoNexusVSMResponse.class, description="Retrieves a Cisco Nexus 1000v Virtual Switch Manager device associated with a Cluster")
public class ListCiscoNexusVSMsCmd extends BaseListCmd {
@ -51,7 +52,7 @@ public class ListCiscoNexusVSMsCmd extends BaseListCmd {
*/
public static final Logger s_logger = Logger.getLogger(ListCiscoNexusVSMsCmd.class.getName());
private static final String s_name = "listcisconexusvsmscmdresponse";
@PlugService CiscoNexusVSMElementService _ciscoNexusVSMService;
@Inject CiscoNexusVSMElementService _ciscoNexusVSMService;
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////

View File

@ -24,7 +24,6 @@ import javax.inject.Inject;
import javax.naming.ConfigurationException;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import com.cloud.agent.AgentManager;
import com.cloud.agent.api.Answer;
@ -37,11 +36,11 @@ import com.cloud.host.Status;
import com.cloud.host.dao.HostDao;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.resource.ResourceManager;
import com.cloud.utils.component.AdapterBase;
import com.cloud.vm.VMInstanceVO;
@Component
@Local(value=FenceBuilder.class)
public class XenServerFencer implements FenceBuilder {
public class XenServerFencer extends AdapterBase implements FenceBuilder {
private static final Logger s_logger = Logger.getLogger(XenServerFencer.class);
String _name;

View File

@ -19,19 +19,14 @@ package com.cloud.hypervisor;
import javax.ejb.Local;
import javax.inject.Inject;
import org.springframework.stereotype.Component;
import com.cloud.agent.api.to.VirtualMachineTO;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.storage.GuestOSVO;
import com.cloud.storage.Storage;
import com.cloud.storage.dao.GuestOSDao;
import com.cloud.template.VirtualMachineTemplate;
import com.cloud.template.VirtualMachineTemplate.BootloaderType;
import com.cloud.vm.VirtualMachine;
import com.cloud.vm.VirtualMachineProfile;
@Component
@Local(value=HypervisorGuru.class)
public class XenServerGuru extends HypervisorGuruBase implements HypervisorGuru {
@Inject GuestOSDao _guestOsDao;

View File

@ -33,7 +33,6 @@ import javax.persistence.EntityExistsException;
import org.apache.log4j.Logger;
import org.apache.xmlrpc.XmlRpcException;
import org.springframework.stereotype.Component;
import com.cloud.agent.AgentManager;
import com.cloud.agent.Listener;
@ -99,7 +98,6 @@ import com.xensource.xenapi.Session;
import com.xensource.xenapi.Types.SessionAuthenticationFailed;
import com.xensource.xenapi.Types.XenAPIException;
@Component
@Local(value=Discoverer.class)
public class XcpServerDiscoverer extends DiscovererBase implements Discoverer, Listener, ResourceStateAdapter {
private static final Logger s_logger = Logger.getLogger(XcpServerDiscoverer.class);

View File

@ -17,6 +17,8 @@
package com.cloud.api.commands;
import javax.inject.Inject;
import org.apache.cloudstack.api.response.ZoneResponse;
import org.apache.log4j.Logger;
@ -24,7 +26,6 @@ import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.PlugService;
import org.apache.cloudstack.api.ServerApiException;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.host.Host;
@ -76,7 +77,7 @@ public class AddExternalLoadBalancerCmd extends BaseCmd {
return password;
}
@PlugService
@Inject
F5ExternalLoadBalancerElementService _f5DeviceManagerService;
/////////////////////////////////////////////////////

View File

@ -17,6 +17,8 @@
package com.cloud.api.commands;
import javax.inject.Inject;
import org.apache.cloudstack.api.*;
import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
import org.apache.log4j.Logger;
@ -39,7 +41,7 @@ public class AddF5LoadBalancerCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(AddF5LoadBalancerCmd.class.getName());
private static final String s_name = "addf5bigiploadbalancerresponse";
@PlugService F5ExternalLoadBalancerElementService _f5DeviceManagerService;
@Inject F5ExternalLoadBalancerElementService _f5DeviceManagerService;
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////

View File

@ -17,6 +17,8 @@
package com.cloud.api.commands;
import javax.inject.Inject;
import org.apache.cloudstack.api.*;
import org.apache.log4j.Logger;
@ -38,7 +40,7 @@ public class ConfigureF5LoadBalancerCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(ConfigureF5LoadBalancerCmd.class.getName());
private static final String s_name = "configuref5Rloadbalancerresponse";
@PlugService F5ExternalLoadBalancerElementService _f5DeviceManagerService;
@Inject F5ExternalLoadBalancerElementService _f5DeviceManagerService;
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////

View File

@ -17,6 +17,8 @@
package com.cloud.api.commands;
import javax.inject.Inject;
import org.apache.cloudstack.api.*;
import org.apache.cloudstack.api.response.HostResponse;
import org.apache.log4j.Logger;
@ -53,7 +55,7 @@ public class DeleteExternalLoadBalancerCmd extends BaseCmd {
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
@PlugService
@Inject
F5ExternalLoadBalancerElementService _f5DeviceManagerService;
@Override

View File

@ -17,6 +17,8 @@
package com.cloud.api.commands;
import javax.inject.Inject;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.BaseAsyncCmd;
@ -25,7 +27,6 @@ import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.PlugService;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.SuccessResponse;
import com.cloud.api.response.F5LoadBalancerResponse;
@ -43,7 +44,7 @@ import com.cloud.utils.exception.CloudRuntimeException;
public class DeleteF5LoadBalancerCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(DeleteF5LoadBalancerCmd.class.getName());
private static final String s_name = "deletef5loadbalancerresponse";
@PlugService F5ExternalLoadBalancerElementService _f5DeviceManagerService;
@Inject F5ExternalLoadBalancerElementService _f5DeviceManagerService;
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////

View File

@ -20,6 +20,8 @@ package com.cloud.api.commands;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
import org.apache.cloudstack.api.*;
import org.apache.log4j.Logger;
@ -57,7 +59,7 @@ public class ListExternalLoadBalancersCmd extends BaseListCmd {
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
@PlugService
@Inject
F5ExternalLoadBalancerElementService _f5DeviceManagerService;
@Override

View File

@ -20,6 +20,8 @@ package com.cloud.api.commands;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;
@ -27,7 +29,6 @@ import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.BaseListCmd;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.PlugService;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.NetworkResponse;
@ -46,7 +47,7 @@ public class ListF5LoadBalancerNetworksCmd extends BaseListCmd {
public static final Logger s_logger = Logger.getLogger(ListF5LoadBalancerNetworksCmd.class.getName());
private static final String s_name = "listf5loadbalancernetworksresponse";
@PlugService F5ExternalLoadBalancerElementService _f5DeviceManagerService;
@Inject F5ExternalLoadBalancerElementService _f5DeviceManagerService;
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////

View File

@ -20,6 +20,8 @@ package com.cloud.api.commands;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
import org.apache.cloudstack.api.*;
import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
import org.apache.log4j.Logger;
@ -40,7 +42,7 @@ import com.cloud.utils.exception.CloudRuntimeException;
public class ListF5LoadBalancersCmd extends BaseListCmd {
public static final Logger s_logger = Logger.getLogger(ListF5LoadBalancersCmd.class.getName());
private static final String s_name = "listf5loadbalancerresponse";
@PlugService F5ExternalLoadBalancerElementService _f5DeviceManagerService;
@Inject F5ExternalLoadBalancerElementService _f5DeviceManagerService;
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////

View File

@ -16,6 +16,8 @@
// under the License.
package com.cloud.api.commands;
import javax.inject.Inject;
import org.apache.cloudstack.api.response.ZoneResponse;
import org.apache.log4j.Logger;
@ -23,7 +25,6 @@ import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.PlugService;
import org.apache.cloudstack.api.ServerApiException;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.host.Host;
@ -79,7 +80,7 @@ public class AddExternalFirewallCmd extends BaseCmd {
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
@PlugService JuniperSRXFirewallElementService _srxElementService;
@Inject JuniperSRXFirewallElementService _srxElementService;
@Override
public String getCommandName() {

View File

@ -16,6 +16,8 @@
// under the License.
package com.cloud.api.commands;
import javax.inject.Inject;
import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
import org.apache.log4j.Logger;
@ -24,7 +26,6 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.PlugService;
import org.apache.cloudstack.api.ServerApiException;
import com.cloud.api.response.SrxFirewallResponse;
import com.cloud.event.EventTypes;
@ -42,7 +43,7 @@ import com.cloud.utils.exception.CloudRuntimeException;
public class AddSrxFirewallCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(AddSrxFirewallCmd.class.getName());
private static final String s_name = "addsrxfirewallresponse";
@PlugService JuniperSRXFirewallElementService _srxFwService;
@Inject JuniperSRXFirewallElementService _srxFwService;
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////

View File

@ -16,6 +16,8 @@
// under the License.
package com.cloud.api.commands;
import javax.inject.Inject;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;
@ -23,7 +25,6 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.PlugService;
import org.apache.cloudstack.api.ServerApiException;
import com.cloud.api.response.SrxFirewallResponse;
import com.cloud.event.EventTypes;
@ -42,7 +43,7 @@ public class ConfigureSrxFirewallCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(ConfigureSrxFirewallCmd.class.getName());
private static final String s_name = "configuresrxfirewallresponse";
@PlugService JuniperSRXFirewallElementService _srxFwService;
@Inject JuniperSRXFirewallElementService _srxFwService;
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////

View File

@ -16,6 +16,8 @@
// under the License.
package com.cloud.api.commands;
import javax.inject.Inject;
import org.apache.cloudstack.api.response.HostResponse;
import org.apache.log4j.Logger;
@ -23,7 +25,6 @@ import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.PlugService;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.SuccessResponse;
import com.cloud.exception.InvalidParameterValueException;
@ -55,7 +56,7 @@ public class DeleteExternalFirewallCmd extends BaseCmd {
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
@PlugService JuniperSRXFirewallElementService _srxElementService;
@Inject JuniperSRXFirewallElementService _srxElementService;
@Override
public String getCommandName() {

View File

@ -16,6 +16,8 @@
// under the License.
package com.cloud.api.commands;
import javax.inject.Inject;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;
@ -23,7 +25,6 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.PlugService;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.SuccessResponse;
import com.cloud.api.response.SrxFirewallResponse;
@ -41,7 +42,7 @@ import com.cloud.utils.exception.CloudRuntimeException;
public class DeleteSrxFirewallCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(DeleteSrxFirewallCmd.class.getName());
private static final String s_name = "deletesrxfirewallresponse";
@PlugService JuniperSRXFirewallElementService _srxElementService;
@Inject JuniperSRXFirewallElementService _srxElementService;
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////

View File

@ -19,6 +19,8 @@ package com.cloud.api.commands;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
import org.apache.cloudstack.api.command.user.offering.ListServiceOfferingsCmd;
import org.apache.cloudstack.api.response.ZoneResponse;
import org.apache.log4j.Logger;
@ -27,7 +29,6 @@ import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListCmd;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.PlugService;
import org.apache.cloudstack.api.response.ListResponse;
import com.cloud.host.Host;
import com.cloud.network.element.JuniperSRXFirewallElementService;
@ -58,7 +59,7 @@ public class ListExternalFirewallsCmd extends BaseListCmd {
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
@PlugService JuniperSRXFirewallElementService _srxElementService;
@Inject JuniperSRXFirewallElementService _srxElementService;
@Override
public String getCommandName() {

View File

@ -19,6 +19,8 @@ package com.cloud.api.commands;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
import org.apache.cloudstack.api.*;
import org.apache.log4j.Logger;
@ -40,7 +42,7 @@ public class ListSrxFirewallNetworksCmd extends BaseListCmd {
public static final Logger s_logger = Logger.getLogger(ListSrxFirewallNetworksCmd.class.getName());
private static final String s_name = "listsrxfirewallnetworksresponse";
@PlugService JuniperSRXFirewallElementService _srxFwService;
@Inject JuniperSRXFirewallElementService _srxFwService;
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////

View File

@ -19,6 +19,8 @@ package com.cloud.api.commands;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
import org.apache.cloudstack.api.*;
import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
import org.apache.log4j.Logger;
@ -40,7 +42,7 @@ public class ListSrxFirewallsCmd extends BaseListCmd {
public static final Logger s_logger = Logger.getLogger(ListSrxFirewallsCmd.class.getName());
private static final String s_name = "listsrxfirewallresponse";
@PlugService JuniperSRXFirewallElementService _srxFwService;
@Inject JuniperSRXFirewallElementService _srxFwService;
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////

View File

@ -15,6 +15,8 @@
package com.cloud.api.commands;
import javax.inject.Inject;
import org.apache.cloudstack.api.*;
import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
import org.apache.log4j.Logger;
@ -36,7 +38,7 @@ public class AddNetscalerLoadBalancerCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(AddNetscalerLoadBalancerCmd.class.getName());
private static final String s_name = "addnetscalerloadbalancerresponse";
@PlugService NetscalerLoadBalancerElementService _netsclarLbService;
@Inject NetscalerLoadBalancerElementService _netsclarLbService;
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////

View File

@ -16,6 +16,8 @@ package com.cloud.api.commands;
import java.util.List;
import javax.inject.Inject;
import org.apache.cloudstack.api.*;
import org.apache.cloudstack.api.response.PodResponse;
import org.apache.log4j.Logger;
@ -38,7 +40,7 @@ public class ConfigureNetscalerLoadBalancerCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(ConfigureNetscalerLoadBalancerCmd.class.getName());
private static final String s_name = "configurenetscalerloadbalancerresponse";
@PlugService NetscalerLoadBalancerElementService _netsclarLbService;
@Inject NetscalerLoadBalancerElementService _netsclarLbService;
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////

View File

@ -15,6 +15,8 @@
package com.cloud.api.commands;
import javax.inject.Inject;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;
@ -22,7 +24,6 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.PlugService;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.SuccessResponse;
import com.cloud.api.response.NetscalerLoadBalancerResponse;
@ -41,7 +42,7 @@ public class DeleteNetscalerLoadBalancerCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(DeleteNetscalerLoadBalancerCmd.class.getName());
private static final String s_name = "deletenetscalerloadbalancerresponse";
@PlugService NetscalerLoadBalancerElementService _netsclarLbService;
@Inject NetscalerLoadBalancerElementService _netsclarLbService;
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////

View File

@ -17,6 +17,8 @@ package com.cloud.api.commands;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;
@ -24,7 +26,6 @@ import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.BaseListCmd;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.PlugService;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.NetworkResponse;
@ -43,7 +44,7 @@ public class ListNetscalerLoadBalancerNetworksCmd extends BaseListCmd {
public static final Logger s_logger = Logger.getLogger(ListNetscalerLoadBalancerNetworksCmd.class.getName());
private static final String s_name = "listnetscalerloadbalancernetworksresponse";
@PlugService NetscalerLoadBalancerElementService _netsclarLbService;
@Inject NetscalerLoadBalancerElementService _netsclarLbService;
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////

View File

@ -17,6 +17,8 @@ package com.cloud.api.commands;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
import org.apache.log4j.Logger;
@ -25,7 +27,6 @@ import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.BaseListCmd;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.PlugService;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ListResponse;
import com.cloud.api.response.NetscalerLoadBalancerResponse;
@ -43,7 +44,7 @@ public class ListNetscalerLoadBalancersCmd extends BaseListCmd {
public static final Logger s_logger = Logger.getLogger(ListNetscalerLoadBalancersCmd.class.getName());
private static final String s_name = "listnetscalerloadbalancerresponse";
@PlugService NetscalerLoadBalancerElementService _netsclarLbService;
@Inject NetscalerLoadBalancerElementService _netsclarLbService;
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////

View File

@ -16,6 +16,8 @@
// under the License.
package com.cloud.api.commands;
import javax.inject.Inject;
import org.apache.cloudstack.api.*;
import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
import org.apache.log4j.Logger;
@ -37,7 +39,7 @@ import com.cloud.utils.exception.CloudRuntimeException;
public class AddNiciraNvpDeviceCmd extends BaseAsyncCmd {
private static final Logger s_logger = Logger.getLogger(AddNiciraNvpDeviceCmd.class.getName());
private static final String s_name = "addniciranvpdeviceresponse";
@PlugService NiciraNvpElementService _niciraNvpElementService;
@Inject NiciraNvpElementService _niciraNvpElementService;
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////

View File

@ -16,6 +16,8 @@
// under the License.
package com.cloud.api.commands;
import javax.inject.Inject;
import com.cloud.api.response.NiciraNvpDeviceResponse;
import org.apache.log4j.Logger;
@ -24,7 +26,6 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.PlugService;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.SuccessResponse;
import com.cloud.event.EventTypes;
@ -41,7 +42,7 @@ import com.cloud.utils.exception.CloudRuntimeException;
public class DeleteNiciraNvpDeviceCmd extends BaseAsyncCmd {
private static final Logger s_logger = Logger.getLogger(DeleteNiciraNvpDeviceCmd.class.getName());
private static final String s_name = "deleteniciranvpdeviceresponse";
@PlugService NiciraNvpElementService _niciraNvpElementService;
@Inject NiciraNvpElementService _niciraNvpElementService;
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////

View File

@ -19,6 +19,8 @@ package com.cloud.api.commands;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
import com.cloud.api.response.NiciraNvpDeviceResponse;
import org.apache.log4j.Logger;
@ -27,7 +29,6 @@ import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.BaseListCmd;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.PlugService;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.NetworkResponse;
@ -45,7 +46,7 @@ public class ListNiciraNvpDeviceNetworksCmd extends BaseListCmd {
public static final Logger s_logger = Logger.getLogger(ListNiciraNvpDeviceNetworksCmd.class.getName());
private static final String s_name = "listniciranvpdevicenetworks";
@PlugService NiciraNvpElementService _niciraNvpElementService;
@Inject NiciraNvpElementService _niciraNvpElementService;
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////

View File

@ -19,11 +19,12 @@ package com.cloud.api.commands;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.BaseListCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.PlugService;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
import org.apache.log4j.Logger;
@ -44,7 +45,7 @@ import com.cloud.utils.exception.CloudRuntimeException;
public class ListNiciraNvpDevicesCmd extends BaseListCmd {
private static final Logger s_logger = Logger.getLogger(ListNiciraNvpDevicesCmd.class.getName());
private static final String s_name = "listniciranvpdeviceresponse";
@PlugService NiciraNvpElementService _niciraNvpElementService;
@Inject NiciraNvpElementService _niciraNvpElementService;
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////

View File

@ -24,7 +24,6 @@ import javax.ejb.Local;
import javax.inject.Inject;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import com.cloud.agent.AgentManager;
import com.cloud.agent.api.CreateLogicalSwitchAnswer;
@ -54,7 +53,6 @@ import com.cloud.network.PhysicalNetwork;
import com.cloud.network.PhysicalNetwork.IsolationMethod;
import com.cloud.network.PhysicalNetworkVO;
import com.cloud.network.dao.NetworkDao;
import com.cloud.network.dao.NetworkServiceMapDao;
import com.cloud.network.dao.NiciraNvpDao;
import com.cloud.network.dao.PhysicalNetworkDao;
import com.cloud.offering.NetworkOffering;
@ -67,7 +65,6 @@ import com.cloud.vm.ReservationContext;
import com.cloud.vm.VirtualMachine;
import com.cloud.vm.VirtualMachineProfile;
@Component
@Local(value=NetworkGuru.class)
public class NiciraNvpGuestNetworkGuru extends GuestNetworkGuru {
private static final Logger s_logger = Logger.getLogger(NiciraNvpGuestNetworkGuru.class);

View File

@ -16,13 +16,10 @@
// under the License.
package com.cloud.network.guru;
import java.util.List;
import javax.ejb.Local;
import javax.inject.Inject;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import com.cloud.dc.DataCenter;
import com.cloud.dc.DataCenter.NetworkType;
@ -31,7 +28,6 @@ import com.cloud.deploy.DeploymentPlan;
import com.cloud.event.EventTypes;
import com.cloud.event.EventUtils;
import com.cloud.event.EventVO;
import com.cloud.exception.InsufficientAddressCapacityException;
import com.cloud.exception.InsufficientVirtualNetworkCapcityException;
import com.cloud.network.Network;
import com.cloud.network.NetworkManager;
@ -40,18 +36,13 @@ import com.cloud.network.ovs.OvsTunnelManager;
import com.cloud.offering.NetworkOffering;
import com.cloud.user.Account;
import com.cloud.user.UserContext;
import com.cloud.vm.Nic.ReservationStrategy;
import com.cloud.vm.NicProfile;
import com.cloud.vm.ReservationContext;
import com.cloud.vm.VirtualMachine;
import com.cloud.vm.VirtualMachineProfile;
import com.cloud.network.Networks.BroadcastDomainType;
import com.cloud.network.Network.GuestType;
import com.cloud.network.Network.State;
import com.cloud.network.PhysicalNetwork;
import com.cloud.network.PhysicalNetwork.IsolationMethod;
@Component
@Local(value=NetworkGuru.class)
public class OvsGuestNetworkGuru extends GuestNetworkGuru {
private static final Logger s_logger = Logger.getLogger(OvsGuestNetworkGuru.class);

View File

@ -34,15 +34,12 @@ import javax.naming.directory.SearchResult;
import org.apache.cloudstack.api.ApiConstants.LDAPParams;
import org.apache.log4j.Logger;
import org.bouncycastle.util.encoders.Base64;
import org.springframework.stereotype.Component;
import com.cloud.configuration.dao.ConfigurationDao;
import com.cloud.user.UserAccount;
import com.cloud.user.dao.UserAccountDao;
import com.cloud.utils.exception.CloudRuntimeException;
@Component
@Local(value={UserAuthenticator.class})
public class LDAPUserAuthenticator extends DefaultUserAuthenticator {
public static final Logger s_logger = Logger.getLogger(LDAPUserAuthenticator.class);

View File

@ -25,9 +25,6 @@ import javax.inject.Inject;
import javax.naming.ConfigurationException;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import com.cloud.server.ManagementServer;
import com.cloud.user.UserAccount;
import com.cloud.user.dao.UserAccountDao;
@ -38,7 +35,6 @@ import com.cloud.utils.exception.CloudRuntimeException;
* comparing it against the local database.
*
*/
@Component
@Local(value={UserAuthenticator.class})
public class MD5UserAuthenticator extends DefaultUserAuthenticator {
public static final Logger s_logger = Logger.getLogger(MD5UserAuthenticator.class);

View File

@ -50,6 +50,7 @@ import com.cloud.storage.dao.GuestOSCategoryDao;
import com.cloud.storage.dao.GuestOSDao;
import com.cloud.user.Account;
import com.cloud.utils.NumbersUtil;
import com.cloud.utils.component.AdapterBase;
import com.cloud.vm.VirtualMachine;
import com.cloud.vm.VirtualMachineProfile;
import com.cloud.vm.dao.ConsoleProxyDao;
@ -63,9 +64,8 @@ import com.cloud.vm.dao.VMInstanceDao;
*/
@Component
@Local(value={HostAllocator.class})
public class FirstFitAllocator implements HostAllocator {
public class FirstFitAllocator extends AdapterBase implements HostAllocator {
private static final Logger s_logger = Logger.getLogger(FirstFitAllocator.class);
private String _name;
@Inject HostDao _hostDao = null;
@Inject HostDetailsDao _hostDetailsDao = null;
@Inject UserVmDao _vmDao = null;
@ -392,7 +392,6 @@ public class FirstFitAllocator implements HostAllocator {
@Override
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
_name = name;
if (_configDao != null) {
Map<String, String> configs = _configDao.getConfiguration(params);
String opFactor = configs.get("cpu.overprovisioning.factor");
@ -408,11 +407,6 @@ public class FirstFitAllocator implements HostAllocator {
return true;
}
@Override
public String getName() {
return _name;
}
@Override
public boolean start() {
return true;

View File

@ -20,7 +20,6 @@ import java.util.ArrayList;
import java.util.List;
import javax.ejb.Local;
import org.apache.log4j.NDC;
import org.springframework.stereotype.Component;
import com.cloud.agent.manager.allocator.HostAllocator;
import com.cloud.deploy.DeploymentPlan;
@ -30,7 +29,6 @@ import com.cloud.host.Host.Type;
import com.cloud.vm.VirtualMachine;
import com.cloud.vm.VirtualMachineProfile;
@Component
@Local(value={HostAllocator.class})
public class FirstFitRoutingAllocator extends FirstFitAllocator {
@Override

View File

@ -28,7 +28,6 @@ import javax.inject.Inject;
import javax.naming.ConfigurationException;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import com.cloud.agent.manager.allocator.PodAllocator;
import com.cloud.capacity.CapacityVO;
@ -50,6 +49,7 @@ import com.cloud.template.VirtualMachineTemplate;
import com.cloud.utils.DateUtil;
import com.cloud.utils.NumbersUtil;
import com.cloud.utils.Pair;
import com.cloud.utils.component.AdapterBase;
import com.cloud.utils.db.SearchCriteria;
import com.cloud.vm.UserVmVO;
import com.cloud.vm.VMInstanceVO;
@ -59,13 +59,10 @@ import com.cloud.vm.VirtualMachineProfile;
import com.cloud.vm.dao.UserVmDao;
import com.cloud.vm.dao.VMInstanceDao;
@Component
@Local(value = PodAllocator.class)
public class UserConcentratedAllocator implements PodAllocator {
public class UserConcentratedAllocator extends AdapterBase implements PodAllocator {
private final static Logger s_logger = Logger.getLogger(UserConcentratedAllocator.class);
String _name;
@Inject
UserVmDao _vmDao;
@Inject
@ -293,11 +290,6 @@ public class UserConcentratedAllocator implements PodAllocator {
*/
}
@Override
public String getName() {
return _name;
}
@Override
public boolean start() {
return true;
@ -310,8 +302,6 @@ public class UserConcentratedAllocator implements PodAllocator {
@Override
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
_name = name;
Map<String, String> configs = _configDao.getConfiguration("management-server", params);
String stoppedValue = configs.get("vm.resource.release.interval");
// String destroyedValue = configs.get("capacity.skipcounting.destroyed.hours");

View File

@ -44,7 +44,6 @@ import org.apache.cloudstack.api.BaseListCmd;
import org.apache.cloudstack.api.EntityReference;
import org.apache.cloudstack.api.InternalIdentity;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.PlugService;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.Validate;
import org.apache.cloudstack.api.command.user.event.ListEventsCmd;
@ -348,11 +347,6 @@ public class ApiDispatcher {
new Class<?>[] {BaseCmd.class});
for (Field field : fields) {
PlugService plugServiceAnnotation = field.getAnnotation(PlugService.class);
if(plugServiceAnnotation != null){
plugService(field, cmd);
}
Parameter parameterAnnotation = field.getAnnotation(Parameter.class);
if ((parameterAnnotation == null) || !parameterAnnotation.expose()) {
continue;

View File

@ -63,6 +63,7 @@ import com.cloud.user.dao.AccountDao;
import com.cloud.utils.DateUtil;
import com.cloud.utils.NumbersUtil;
import com.cloud.utils.PropertiesUtil;
import com.cloud.utils.component.ComponentContext;
import com.cloud.utils.concurrency.NamedThreadFactory;
import com.cloud.utils.db.DB;
import com.cloud.utils.db.GlobalLock;
@ -409,6 +410,8 @@ public class AsyncJobManagerImpl implements AsyncJobManager, ClusterManagerListe
Class<?> cmdClass = Class.forName(job.getCmd());
cmdObj = (BaseAsyncCmd)cmdClass.newInstance();
cmdObj = ComponentContext.inject(cmdObj);
cmdObj.configure();
cmdObj.setJob(job);
Type mapType = new TypeToken<Map<String, String>>() {}.getType();

View File

@ -28,7 +28,6 @@ import javax.inject.Inject;
import javax.naming.ConfigurationException;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import com.cloud.agent.api.StartupCommand;
import com.cloud.agent.api.StartupRoutingCommand;
@ -58,7 +57,6 @@ import com.cloud.vm.VMInstanceVO;
import com.cloud.vm.VirtualMachine.State;
import com.cloud.vm.dao.VMInstanceDao;
@Component
@Local(value=Discoverer.class)
public class BareMetalDiscoverer extends DiscovererBase implements Discoverer, ResourceStateAdapter {
private static final Logger s_logger = Logger.getLogger(BareMetalDiscoverer.class);

View File

@ -19,10 +19,7 @@ package com.cloud.baremetal;
import javax.ejb.Local;
import javax.inject.Inject;
import org.springframework.stereotype.Component;
import com.cloud.agent.api.to.VirtualMachineTO;
import com.cloud.hypervisor.Hypervisor;
import com.cloud.hypervisor.HypervisorGuru;
import com.cloud.hypervisor.HypervisorGuruBase;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
@ -31,7 +28,6 @@ import com.cloud.storage.dao.GuestOSDao;
import com.cloud.vm.VirtualMachine;
import com.cloud.vm.VirtualMachineProfile;
@Component
@Local(value=HypervisorGuru.class)
public class BareMetalGuru extends HypervisorGuruBase implements HypervisorGuru {
@Inject GuestOSDao _guestOsDao;

View File

@ -25,17 +25,14 @@ import java.util.Random;
import javax.ejb.Local;
import javax.naming.ConfigurationException;
import org.springframework.stereotype.Component;
import com.cloud.utils.component.AdapterBase;
import com.cloud.vm.ConsoleProxyVO;
import edu.emory.mathcs.backport.java.util.Collections;
@Component
@Local(value={ConsoleProxyAllocator.class})
public class ConsoleProxyBalanceAllocator implements ConsoleProxyAllocator {
public class ConsoleProxyBalanceAllocator extends AdapterBase implements ConsoleProxyAllocator {
private String _name;
private final Random _rand = new Random(System.currentTimeMillis());
@Override
@ -77,15 +74,9 @@ public class ConsoleProxyBalanceAllocator implements ConsoleProxyAllocator {
@Override
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
_name = name;
return true;
}
@Override
public String getName() {
return _name;
}
@Override
public boolean start() {
return true;

View File

@ -24,7 +24,6 @@ import javax.inject.Inject;
import javax.naming.ConfigurationException;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import com.cloud.capacity.CapacityManager;
import com.cloud.configuration.Config;
@ -44,12 +43,12 @@ import com.cloud.offering.ServiceOffering;
import com.cloud.org.Cluster;
import com.cloud.resource.ResourceManager;
import com.cloud.utils.NumbersUtil;
import com.cloud.utils.component.AdapterBase;
import com.cloud.vm.VirtualMachine;
import com.cloud.vm.VirtualMachineProfile;
@Component
@Local(value=DeploymentPlanner.class)
public class BareMetalPlanner implements DeploymentPlanner {
public class BareMetalPlanner extends AdapterBase implements DeploymentPlanner {
private static final Logger s_logger = Logger.getLogger(BareMetalPlanner.class);
@Inject protected DataCenterDao _dcDao;
@Inject protected HostPodDao _podDao;
@ -58,7 +57,6 @@ public class BareMetalPlanner implements DeploymentPlanner {
@Inject protected ConfigurationDao _configDao;
@Inject protected CapacityManager _capacityMgr;
@Inject protected ResourceManager _resourceMgr;
String _name;
@Override
public DeployDestination plan(VirtualMachineProfile<? extends VirtualMachine> vmProfile, DeploymentPlan plan, ExcludeList avoid) throws InsufficientServerCapacityException {
@ -144,15 +142,9 @@ public class BareMetalPlanner implements DeploymentPlanner {
@Override
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
_name = name;
return true;
}
@Override
public String getName() {
return _name;
}
@Override
public boolean start() {
return true;

View File

@ -28,7 +28,6 @@ import javax.inject.Inject;
import javax.naming.ConfigurationException;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import com.cloud.agent.manager.allocator.HostAllocator;
import com.cloud.api.ApiDBUtils;
@ -80,7 +79,6 @@ import com.cloud.vm.VirtualMachineProfile;
import com.cloud.vm.dao.UserVmDao;
import com.cloud.vm.dao.VMInstanceDao;
@Component
@Local(value=DeploymentPlanner.class)
public class FirstFitPlanner extends PlannerBase implements DeploymentPlanner {
private static final Logger s_logger = Logger.getLogger(FirstFitPlanner.class);

View File

@ -37,14 +37,14 @@ import com.cloud.host.HostVO;
import com.cloud.host.Status;
import com.cloud.host.dao.HostDao;
import com.cloud.resource.ResourceManager;
import com.cloud.utils.component.AdapterBase;
import com.cloud.utils.db.SearchCriteria2;
import com.cloud.utils.db.SearchCriteria.Op;
import com.cloud.utils.db.SearchCriteriaService;
public abstract class AbstractInvestigatorImpl implements Investigator {
public abstract class AbstractInvestigatorImpl extends AdapterBase implements Investigator {
private static final Logger s_logger = Logger.getLogger(AbstractInvestigatorImpl.class);
private String _name = null;
@Inject private HostDao _hostDao = null;
@Inject private AgentManager _agentMgr = null;
@Inject private ResourceManager _resourceMgr = null;
@ -52,16 +52,10 @@ public abstract class AbstractInvestigatorImpl implements Investigator {
@Override
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
_name = name;
return true;
}
@Override
public String getName() {
return _name;
}
@Override
public boolean start() {
return true;

View File

@ -20,7 +20,6 @@ import javax.ejb.Local;
import javax.inject.Inject;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import com.cloud.agent.AgentManager;
import com.cloud.agent.api.CheckVirtualMachineAnswer;
@ -33,7 +32,6 @@ import com.cloud.utils.component.AdapterBase;
import com.cloud.vm.VMInstanceVO;
import com.cloud.vm.VirtualMachine.State;
@Component
@Local(value=Investigator.class)
public class CheckOnAgentInvestigator extends AdapterBase implements Investigator {
private final static Logger s_logger = Logger.getLogger(CheckOnAgentInvestigator.class);

View File

@ -25,7 +25,6 @@ import javax.inject.Inject;
import javax.naming.ConfigurationException;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import com.cloud.agent.AgentManager;
import com.cloud.agent.api.FenceAnswer;
@ -37,13 +36,12 @@ import com.cloud.host.Status;
import com.cloud.host.dao.HostDao;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.resource.ResourceManager;
import com.cloud.utils.component.AdapterBase;
import com.cloud.vm.VMInstanceVO;
@Component
@Local(value=FenceBuilder.class)
public class KVMFencer implements FenceBuilder {
public class KVMFencer extends AdapterBase implements FenceBuilder {
private static final Logger s_logger = Logger.getLogger(KVMFencer.class);
String _name;
@Inject HostDao _hostDao;
@Inject AgentManager _agentMgr;
@ -52,15 +50,9 @@ public class KVMFencer implements FenceBuilder {
public boolean configure(String name, Map<String, Object> params)
throws ConfigurationException {
// TODO Auto-generated method stub
_name = name;
return true;
}
@Override
public String getName() {
return _name;
}
@Override
public boolean start() {
// TODO Auto-generated method stub

View File

@ -24,7 +24,6 @@ import javax.inject.Inject;
import javax.naming.ConfigurationException;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import com.cloud.host.HostVO;
import com.cloud.host.Status;
@ -35,7 +34,6 @@ import com.cloud.vm.Nic;
import com.cloud.vm.VMInstanceVO;
import com.cloud.vm.VirtualMachine;
@Component
@Local(value={Investigator.class})
public class ManagementIPSystemVMInvestigator extends AbstractInvestigatorImpl {
private static final Logger s_logger = Logger.getLogger(ManagementIPSystemVMInvestigator.class);

View File

@ -25,7 +25,6 @@ import javax.inject.Inject;
import javax.naming.ConfigurationException;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import com.cloud.agent.AgentManager;
import com.cloud.agent.api.Answer;
@ -43,7 +42,6 @@ import com.cloud.vm.VMInstanceVO;
import com.cloud.vm.VirtualMachine;
import com.cloud.vm.dao.UserVmDao;
@Component
@Local(value={Investigator.class})
public class UserVmDomRInvestigator extends AbstractInvestigatorImpl {
private static final Logger s_logger = Logger.getLogger(UserVmDomRInvestigator.class);

View File

@ -22,7 +22,6 @@ import javax.ejb.Local;
import javax.inject.Inject;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import com.cloud.agent.api.Answer;
import com.cloud.agent.api.CheckOnHostAnswer;
@ -36,7 +35,6 @@ import com.cloud.resource.ResourceManager;
import com.cloud.utils.component.AdapterBase;
import com.cloud.vm.VMInstanceVO;
@Component
@Local(value=Investigator.class)
public class XenServerInvestigator extends AdapterBase implements Investigator {
private final static Logger s_logger = Logger.getLogger(XenServerInvestigator.class);

View File

@ -19,8 +19,6 @@ package com.cloud.hypervisor;
import javax.ejb.Local;
import javax.inject.Inject;
import org.springframework.stereotype.Component;
import com.cloud.agent.api.to.VirtualMachineTO;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.storage.GuestOSVO;
@ -28,7 +26,6 @@ import com.cloud.storage.dao.GuestOSDao;
import com.cloud.vm.VirtualMachine;
import com.cloud.vm.VirtualMachineProfile;
@Component
@Local(value=HypervisorGuru.class)
public class KVMGuru extends HypervisorGuruBase implements HypervisorGuru {
@Inject GuestOSDao _guestOsDao;

View File

@ -21,7 +21,6 @@ import javax.inject.Inject;
import com.cloud.agent.api.Command;
import com.cloud.agent.api.to.VirtualMachineTO;
import com.cloud.host.dao.HostDetailsDao;
import com.cloud.host.dao.HostDao;
import com.cloud.hypervisor.HypervisorGuru;
import com.cloud.hypervisor.HypervisorGuruBase;

View File

@ -29,7 +29,6 @@ import javax.inject.Inject;
import javax.naming.ConfigurationException;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import com.cloud.agent.api.Command;
import com.cloud.agent.api.StartupVMMAgentCommand;
@ -55,7 +54,6 @@ import com.cloud.utils.nio.NioClient;
import com.cloud.utils.nio.Task;
import com.cloud.utils.nio.Task.Type;
@Component
@Local(value=Discoverer.class)
public class HypervServerDiscoverer extends DiscovererBase implements Discoverer, HandlerFactory{
private static final Logger s_logger = Logger.getLogger(HypervServerDiscoverer.class);

View File

@ -28,7 +28,6 @@ import javax.inject.Inject;
import javax.naming.ConfigurationException;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import com.cloud.agent.AgentManager;
import com.cloud.agent.Listener;
@ -63,7 +62,6 @@ import com.cloud.resource.ServerResource;
import com.cloud.resource.UnableDeleteHostException;
import com.cloud.utils.ssh.SSHCmdHelper;
@Component
@Local(value=Discoverer.class)
public class KvmServerDiscoverer extends DiscovererBase implements Discoverer,
Listener, ResourceStateAdapter {

View File

@ -29,16 +29,15 @@ import javax.inject.Inject;
import javax.naming.ConfigurationException;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import com.cloud.configuration.dao.ConfigurationDao;
import com.cloud.dc.dao.VlanDao;
import com.cloud.network.dao.IPAddressDao;
import com.cloud.utils.component.AdapterBase;
import com.cloud.utils.exception.CloudRuntimeException;
@Component
@Local(value=IpAddrAllocator.class)
public class ExteralIpAddressAllocator implements IpAddrAllocator{
public class ExteralIpAddressAllocator extends AdapterBase implements IpAddrAllocator{
private static final Logger s_logger = Logger.getLogger(ExteralIpAddressAllocator.class);
String _name;
@Inject ConfigurationDao _configDao = null;

View File

@ -23,7 +23,6 @@ import javax.inject.Inject;
import javax.naming.ConfigurationException;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import com.cloud.configuration.Config;
import com.cloud.configuration.dao.ConfigurationDao;
@ -55,7 +54,6 @@ import com.cloud.vm.ReservationContext;
import com.cloud.vm.VirtualMachine;
import com.cloud.vm.VirtualMachineProfile;
@Component
@Local(value={NetworkGuru.class})
public class ControlNetworkGuru extends PodBasedNetworkGuru implements NetworkGuru {
private static final Logger s_logger = Logger.getLogger(ControlNetworkGuru.class);

View File

@ -20,7 +20,6 @@ import javax.ejb.Local;
import javax.inject.Inject;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import com.cloud.dc.DataCenter;
import com.cloud.dc.DataCenter.NetworkType;
@ -56,7 +55,6 @@ import com.cloud.vm.ReservationContext;
import com.cloud.vm.VirtualMachine;
import com.cloud.vm.VirtualMachineProfile;
@Component
@Local(value = { NetworkGuru.class })
public class DirectNetworkGuru extends AdapterBase implements NetworkGuru {
private static final Logger s_logger = Logger.getLogger(DirectNetworkGuru.class);

View File

@ -22,7 +22,6 @@ import javax.ejb.Local;
import javax.inject.Inject;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import com.cloud.configuration.ZoneConfig;
import com.cloud.dc.DataCenter;
@ -57,7 +56,6 @@ import com.cloud.vm.ReservationContext;
import com.cloud.vm.VirtualMachine;
import com.cloud.vm.VirtualMachineProfile;
@Component
@Local(value = NetworkGuru.class)
public class DirectPodBasedNetworkGuru extends DirectNetworkGuru {
private static final Logger s_logger = Logger.getLogger(DirectPodBasedNetworkGuru.class);

View File

@ -22,10 +22,8 @@ import javax.ejb.Local;
import javax.inject.Inject;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import com.cloud.configuration.Config;
import com.cloud.configuration.dao.ConfigurationDao;
import com.cloud.dc.DataCenter;
import com.cloud.dc.DataCenter.NetworkType;
import com.cloud.dc.dao.DataCenterDao;
@ -44,9 +42,7 @@ import com.cloud.network.NetworkVO;
import com.cloud.network.Networks.BroadcastDomainType;
import com.cloud.network.PhysicalNetwork;
import com.cloud.network.PhysicalNetwork.IsolationMethod;
import com.cloud.network.PhysicalNetworkVO;
import com.cloud.network.dao.NetworkDao;
import com.cloud.network.dao.PhysicalNetworkDao;
import com.cloud.network.rules.PortForwardingRuleVO;
import com.cloud.network.rules.dao.PortForwardingRulesDao;
import com.cloud.offering.NetworkOffering;
@ -63,7 +59,6 @@ import com.cloud.vm.ReservationContext;
import com.cloud.vm.VirtualMachine;
import com.cloud.vm.VirtualMachineProfile;
@Component
@Local(value = NetworkGuru.class)
public class ExternalGuestNetworkGuru extends GuestNetworkGuru {
private static final Logger s_logger = Logger.getLogger(ExternalGuestNetworkGuru.class);

View File

@ -22,7 +22,6 @@ import javax.ejb.Local;
import javax.inject.Inject;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import com.cloud.dc.Pod;
import com.cloud.dc.dao.DataCenterDao;
@ -50,7 +49,6 @@ import com.cloud.vm.ReservationContext;
import com.cloud.vm.VirtualMachine;
import com.cloud.vm.VirtualMachineProfile;
@Component
@Local(value={NetworkGuru.class})
public class PodBasedNetworkGuru extends AdapterBase implements NetworkGuru {
private static final Logger s_logger = Logger.getLogger(PodBasedNetworkGuru.class);

View File

@ -20,7 +20,6 @@ import javax.ejb.Local;
import javax.inject.Inject;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import com.cloud.configuration.ConfigurationManager;
import com.cloud.dc.DataCenter;
@ -55,7 +54,6 @@ import com.cloud.vm.ReservationContext;
import com.cloud.vm.VirtualMachine;
import com.cloud.vm.VirtualMachineProfile;
@Component
@Local(value = NetworkGuru.class)
public class PrivateNetworkGuru extends AdapterBase implements NetworkGuru {
private static final Logger s_logger = Logger.getLogger(PrivateNetworkGuru.class);

View File

@ -20,7 +20,6 @@ import javax.ejb.Local;
import javax.inject.Inject;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import com.cloud.dc.DataCenter;
import com.cloud.dc.Vlan.VlanType;
@ -56,7 +55,6 @@ import com.cloud.vm.ReservationContext;
import com.cloud.vm.VirtualMachine;
import com.cloud.vm.VirtualMachineProfile;
@Component
@Local(value = { NetworkGuru.class })
public class PublicNetworkGuru extends AdapterBase implements NetworkGuru {
private static final Logger s_logger = Logger.getLogger(PublicNetworkGuru.class);

View File

@ -20,13 +20,11 @@ import javax.ejb.Local;
import javax.inject.Inject;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import com.cloud.dc.Pod;
import com.cloud.dc.StorageNetworkIpAddressVO;
import com.cloud.deploy.DeployDestination;
import com.cloud.deploy.DeploymentPlan;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientAddressCapacityException;
import com.cloud.exception.InsufficientVirtualNetworkCapcityException;
import com.cloud.network.Network;
@ -40,8 +38,6 @@ import com.cloud.network.StorageNetworkManager;
import com.cloud.network.dao.NetworkDao;
import com.cloud.offering.NetworkOffering;
import com.cloud.user.Account;
import com.cloud.utils.component.AdapterBase;
import com.cloud.utils.net.Ip4Address;
import com.cloud.utils.net.NetUtils;
import com.cloud.vm.NicProfile;
import com.cloud.vm.ReservationContext;
@ -49,7 +45,6 @@ import com.cloud.vm.VirtualMachine;
import com.cloud.vm.VirtualMachineProfile;
import com.cloud.vm.Nic.ReservationStrategy;
@Component
@Local(value = NetworkGuru.class)
public class StorageNetworkGuru extends PodBasedNetworkGuru implements NetworkGuru {
private static final Logger s_logger = Logger.getLogger(StorageNetworkGuru.class);

View File

@ -35,10 +35,10 @@ import com.cloud.host.HostVO;
import com.cloud.host.dao.HostDao;
import com.cloud.network.NetworkManager;
import com.cloud.utils.component.AdapterBase;
import com.cloud.utils.net.UrlUtil;
public abstract class DiscovererBase implements Discoverer {
protected String _name;
public abstract class DiscovererBase extends AdapterBase implements Discoverer {
protected Map<String, String> _params;
private static final Logger s_logger = Logger.getLogger(DiscovererBase.class);
@Inject protected ClusterDao _clusterDao;
@ -49,7 +49,6 @@ public abstract class DiscovererBase implements Discoverer {
@Override
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
_params = _configDao.getConfiguration(params);
_name = name;
return true;
}
@ -68,11 +67,6 @@ public abstract class DiscovererBase implements Discoverer {
_params.putAll(params);
}
@Override
public String getName() {
return _name;
}
@Override
public boolean start() {
return true;

View File

@ -23,13 +23,15 @@ import javax.naming.ConfigurationException;
import org.springframework.stereotype.Component;
import com.cloud.utils.component.AdapterBase;
/**
* Use this UserAuthenticator if users are already authenticated outside
*
*/
@Component
@Local(value={UserAuthenticator.class})
public abstract class DefaultUserAuthenticator implements UserAuthenticator {
public abstract class DefaultUserAuthenticator extends AdapterBase implements UserAuthenticator {
private String _name = null;
@Override

View File

@ -28,7 +28,6 @@ import javax.inject.Inject;
import javax.naming.ConfigurationException;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import com.cloud.deploy.DeploymentPlan;
import com.cloud.deploy.DeploymentPlanner.ExcludeList;
@ -45,7 +44,6 @@ import com.cloud.vm.DiskProfile;
import com.cloud.vm.VirtualMachine;
import com.cloud.vm.VirtualMachineProfile;
@Component
@Local(value=StoragePoolAllocator.class)
public class FirstFitStoragePoolAllocator extends AbstractStoragePoolAllocator {
private static final Logger s_logger = Logger.getLogger(FirstFitStoragePoolAllocator.class);

View File

@ -26,7 +26,6 @@ import javax.inject.Inject;
import javax.naming.ConfigurationException;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import com.cloud.capacity.CapacityVO;
import com.cloud.capacity.dao.CapacityDao;
@ -62,7 +61,6 @@ import com.cloud.vm.dao.VMInstanceDao;
// Rush to make LocalStoragePoolAllocator use static allocation status, we should revisit the overall
// allocation process to make it more reliable in next release. The code put in here is pretty ugly
//
@Component
@Local(value = StoragePoolAllocator.class)
public class LocalStoragePoolAllocator extends FirstFitStoragePoolAllocator {
private static final Logger s_logger = Logger.getLogger(LocalStoragePoolAllocator.class);

View File

@ -31,7 +31,6 @@ import javax.inject.Inject;
import javax.naming.ConfigurationException;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import com.cloud.agent.AgentManager;
import com.cloud.configuration.dao.ConfigurationDao;
@ -58,7 +57,6 @@ import com.cloud.utils.script.Script;
* storage servers and make sure everything it can do is
* correct.
*/
@Component
@Local(value=Discoverer.class)
public class SecondaryStorageDiscoverer extends DiscovererBase implements Discoverer {
private static final Logger s_logger = Logger.getLogger(SecondaryStorageDiscoverer.class);

View File

@ -23,16 +23,18 @@ import javax.naming.ConfigurationException;
// Typical Adapter implementation.
public class AdapterBase implements Adapter {
String _name;
protected String _name;
@Override
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
_name = name;
return true;
}
@Override
public String getName() {
if(_name == null)
return this.getClass().getSimpleName();
return _name;
}