Skip to content

Commit 3c6df7c

Browse files
rafaelweingartneryadvr
authored andcommitted
CLOUDSTACK-10196: Remove ejb-api 3.0 dependency (#2348)
Fixed QuotaAlertManagerImplTest, which was injecting mock objects manually.
1 parent 973a9c1 commit 3c6df7c

File tree

61 files changed

+447
-679
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+447
-679
lines changed

agent/src/com/cloud/agent/dao/impl/PropertiesStorage.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
import java.util.Map;
2424
import java.util.Properties;
2525

26-
import javax.ejb.Local;
27-
2826
import org.apache.commons.io.IOUtils;
2927
import org.apache.log4j.Logger;
3028

@@ -37,7 +35,6 @@
3735
* @config {@table || Param Name | Description | Values | Default || || path |
3836
* path to the properties _file | String | db/db.properties || * }
3937
**/
40-
@Local(value = {StorageComponent.class})
4138
public class PropertiesStorage implements StorageComponent {
4239
private static final Logger s_logger = Logger.getLogger(PropertiesStorage.class);
4340
Properties _properties = new Properties();

agent/src/com/cloud/agent/dhcp/FakeDhcpSnooper.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,13 @@
2424
import java.util.concurrent.ConcurrentHashMap;
2525
import java.util.concurrent.ConcurrentLinkedQueue;
2626

27-
import javax.ejb.Local;
2827
import javax.naming.ConfigurationException;
2928

3029
import org.apache.log4j.Logger;
3130

3231
import com.cloud.utils.Pair;
3332
import com.cloud.utils.net.NetUtils;
3433

35-
@Local(value = {DhcpSnooper.class})
3634
public class FakeDhcpSnooper implements DhcpSnooper {
3735
private static final Logger s_logger = Logger.getLogger(FakeDhcpSnooper.class);
3836
private Queue<String> _ipAddresses = new ConcurrentLinkedQueue<String>();

agent/src/com/cloud/agent/resource/DummyResource.java

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

25-
import javax.ejb.Local;
26-
2725
import com.cloud.agent.IAgentControl;
2826
import com.cloud.agent.api.Answer;
2927
import com.cloud.agent.api.CheckNetworkAnswer;
@@ -43,7 +41,6 @@
4341
import com.cloud.storage.Storage.StoragePoolType;
4442
import com.cloud.utils.StringUtils;
4543

46-
@Local(value = {ServerResource.class})
4744
public class DummyResource implements ServerResource {
4845
String _name;
4946
Host.Type _type;

api/src/org/apache/cloudstack/config/ApiServiceConfiguration.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,9 @@
1616
// under the License.
1717
package org.apache.cloudstack.config;
1818

19-
import javax.ejb.Local;
20-
2119
import org.apache.cloudstack.framework.config.ConfigKey;
2220
import org.apache.cloudstack.framework.config.Configurable;
2321

24-
@Local(value = {ApiServiceConfiguration.class})
2522
public class ApiServiceConfiguration implements Configurable {
2623
public static final ConfigKey<String> ManagementHostIPAdr = new ConfigKey<String>("Advanced", String.class, "host", "localhost", "The ip address of management server", true);
2724
public static final ConfigKey<String> ApiServletPath = new ConfigKey<String>("Advanced", String.class, "endpointe.url", "http://localhost:8080/client/api",

core/src/com/cloud/storage/JavaStorageLayer.java

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,8 @@
2626
import java.util.Map;
2727
import java.util.UUID;
2828

29-
import javax.ejb.Local;
3029
import javax.naming.ConfigurationException;
3130

32-
@Local(value = StorageLayer.class)
3331
public class JavaStorageLayer implements StorageLayer {
3432

3533
String _name;
@@ -150,8 +148,9 @@ public List<String> listMountPointsByMsHost(String path, long msHostId) {
150148
return mountPaths;
151149
}
152150
for (File file : files) {
153-
if (file.getName().startsWith(String.valueOf(msHostId) + "."))
151+
if (file.getName().startsWith(String.valueOf(msHostId) + ".")) {
154152
mountPaths.add(file.getAbsolutePath());
153+
}
155154
}
156155
return mountPaths;
157156
}
@@ -208,8 +207,9 @@ public boolean mkdirs(String path) {
208207
dir = new File(dirPath);
209208
if (!dir.exists()) {
210209
success = dir.mkdir();
211-
if (_makeWorldWriteable)
210+
if (_makeWorldWriteable) {
212211
success = success && setWorldReadableAndWriteable(dir);
212+
}
213213
}
214214
}
215215

@@ -284,32 +284,24 @@ public long getUsedSpace(String path) {
284284

285285
@Override
286286
public void setName(String name) {
287-
// TODO Auto-generated method stub
288-
289287
}
290288

291289
@Override
292290
public void setConfigParams(Map<String, Object> params) {
293-
// TODO Auto-generated method stub
294-
295291
}
296292

297293
@Override
298294
public Map<String, Object> getConfigParams() {
299-
// TODO Auto-generated method stub
300295
return null;
301296
}
302297

303298
@Override
304299
public int getRunLevel() {
305-
// TODO Auto-generated method stub
306300
return 0;
307301
}
308302

309303
@Override
310304
public void setRunLevel(int level) {
311-
// TODO Auto-generated method stub
312-
313305
}
314306

315307
}

engine/schema/src/com/cloud/dc/dao/DomainVlanMapDaoImpl.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818

1919
import java.util.List;
2020

21-
import javax.ejb.Local;
22-
2321
import org.springframework.stereotype.Component;
2422

2523
import com.cloud.dc.DomainVlanMapVO;
@@ -28,7 +26,6 @@
2826
import com.cloud.utils.db.SearchCriteria;
2927

3028
@Component
31-
@Local(value={DomainVlanMapDao.class})
3229
public class DomainVlanMapDaoImpl extends GenericDaoBase<DomainVlanMapVO, Long> implements DomainVlanMapDao {
3330
protected SearchBuilder<DomainVlanMapVO> DomainSearch;
3431
protected SearchBuilder<DomainVlanMapVO> VlanSearch;

engine/schema/src/com/cloud/host/dao/HostDaoImpl.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import java.util.TimeZone;
2828

2929
import javax.annotation.PostConstruct;
30-
import javax.ejb.Local;
3130
import javax.inject.Inject;
3231
import javax.persistence.TableGenerator;
3332

@@ -71,7 +70,6 @@
7170
import com.cloud.utils.exception.CloudRuntimeException;
7271

7372
@Component
74-
@Local(value = {HostDao.class})
7573
@DB
7674
@TableGenerator(name = "host_req_sq", table = "op_host", pkColumnName = "id", valueColumnName = "sequence", allocationSize = 1)
7775
public class HostDaoImpl extends GenericDaoBase<HostVO, Long> implements HostDao { //FIXME: , ExternalIdDao {

engine/schema/src/com/cloud/network/dao/FirewallRulesDcidrsDaoImpl.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,10 @@
2525
import com.cloud.utils.db.TransactionStatus;
2626
import org.springframework.stereotype.Component;
2727

28-
import javax.ejb.Local;
2928
import java.util.ArrayList;
3029
import java.util.List;
3130

3231
@Component
33-
@Local(value = FirewallRulesDcidrsDao.class)
3432
public class FirewallRulesDcidrsDaoImpl extends GenericDaoBase<FirewallRulesDestCidrsVO, Long> implements FirewallRulesDcidrsDao {
3533

3634
protected final SearchBuilder<FirewallRulesDestCidrsVO> cidrsSearch;

engine/schema/src/org/apache/cloudstack/acl/dao/RoleDaoImpl.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@
2424
import org.apache.cloudstack.acl.RoleVO;
2525
import org.springframework.stereotype.Component;
2626

27-
import javax.ejb.Local;
2827
import java.util.List;
2928

3029
@Component
31-
@Local(value = {RoleDao.class})
3230
public class RoleDaoImpl extends GenericDaoBase<RoleVO, Long> implements RoleDao {
3331
private final SearchBuilder<RoleVO> RoleByNameSearch;
3432
private final SearchBuilder<RoleVO> RoleByTypeSearch;

engine/schema/src/org/apache/cloudstack/acl/dao/RolePermissionsDaoImpl.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,13 @@
3434
import org.apache.log4j.Logger;
3535
import org.springframework.stereotype.Component;
3636

37-
import javax.ejb.Local;
3837
import java.util.ArrayList;
3938
import java.util.Collections;
4039
import java.util.HashSet;
4140
import java.util.List;
4241
import java.util.Set;
4342

4443
@Component
45-
@Local(value = {RolePermissionsDao.class})
4644
public class RolePermissionsDaoImpl extends GenericDaoBase<RolePermissionVO, Long> implements RolePermissionsDao {
4745
protected static final Logger LOGGER = Logger.getLogger(RolePermissionsDaoImpl.class);
4846

0 commit comments

Comments
 (0)