Skip to content

Commit 296c203

Browse files
committed
Merge javelin into master
2 parents 77e3aad + 7b75f0d commit 296c203

1,892 files changed

Lines changed: 78073 additions & 38222 deletions

File tree

Some content is hidden

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

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ tools/cli/build/
6262
awsapi/modules/*
6363
!.gitignore
6464
.classpath
65-
.project
6665
.settings.xml
6766
.settings/
6867
db.properties.override
@@ -73,4 +72,5 @@ docs/tmp
7372
docs/publish
7473
docs/runbook/tmp
7574
docs/runbook/publish
75+
.project
7676
Gemfile.lock

agent/src/com/cloud/agent/AgentShell.java

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,7 @@
5353
import com.cloud.utils.PropertiesUtil;
5454
import com.cloud.utils.backoff.BackoffAlgorithm;
5555
import com.cloud.utils.backoff.impl.ConstantTimeBackoff;
56-
import com.cloud.utils.component.Adapters;
57-
import com.cloud.utils.component.ComponentLocator;
5856
import com.cloud.utils.exception.CloudRuntimeException;
59-
import com.cloud.utils.net.MacAddress;
6057
import com.cloud.utils.script.Script;
6158

6259
public class AgentShell implements IAgentShell {
@@ -146,6 +143,7 @@ public String getGuid() {
146143
return _guid;
147144
}
148145

146+
@Override
149147
public Map<String, Object> getCmdLineProperties() {
150148
return _cmdLineProperties;
151149
}
@@ -378,8 +376,6 @@ protected boolean parseCommand(final String[] args)
378376

379377
public void init(String[] args) throws ConfigurationException {
380378

381-
final ComponentLocator locator = ComponentLocator.getLocator("agent");
382-
383379
final Class<?> c = this.getClass();
384380
_version = c.getPackage().getImplementationVersion();
385381
if (_version == null) {
@@ -396,12 +392,9 @@ public void init(String[] args) throws ConfigurationException {
396392
s_logger.debug("Found property: " + property);
397393
}
398394

399-
_storage = locator.getManager(StorageComponent.class);
400-
if (_storage == null) {
401-
s_logger.info("Defaulting to using properties file for storage");
402-
_storage = new PropertiesStorage();
403-
_storage.configure("Storage", new HashMap<String, Object>());
404-
}
395+
s_logger.info("Defaulting to using properties file for storage");
396+
_storage = new PropertiesStorage();
397+
_storage.configure("Storage", new HashMap<String, Object>());
405398

406399
// merge with properties from command line to let resource access
407400
// command line parameters
@@ -410,22 +403,9 @@ public void init(String[] args) throws ConfigurationException {
410403
_properties.put(cmdLineProp.getKey(), cmdLineProp.getValue());
411404
}
412405

413-
final Adapters adapters = locator.getAdapters(BackoffAlgorithm.class);
414-
final Enumeration en = adapters.enumeration();
415-
while (en.hasMoreElements()) {
416-
_backoff = (BackoffAlgorithm) en.nextElement();
417-
break;
418-
}
419-
if (en.hasMoreElements()) {
420-
s_logger.info("More than one backoff algorithm specified. Using the first one ");
421-
}
422-
423-
if (_backoff == null) {
424-
s_logger.info("Defaulting to the constant time backoff algorithm");
425-
_backoff = new ConstantTimeBackoff();
426-
_backoff.configure("ConstantTimeBackoff",
427-
new HashMap<String, Object>());
428-
}
406+
s_logger.info("Defaulting to the constant time backoff algorithm");
407+
_backoff = new ConstantTimeBackoff();
408+
_backoff.configure("ConstantTimeBackoff", new HashMap<String, Object>());
429409
}
430410

431411
private void launchAgent() throws ConfigurationException {
@@ -469,6 +449,7 @@ private void launchConsoleProxy() throws ConfigurationException {
469449
openPortWithIptables(port);
470450

471451
_consoleProxyMain = new Thread(new Runnable() {
452+
@Override
472453
public void run() {
473454
try {
474455
Class<?> consoleProxyClazz = Class.forName("com.cloud.consoleproxy.ConsoleProxy");
@@ -522,7 +503,7 @@ private void launchAgentFromClassInfo(String resourceClassNames)
522503
} catch (final SecurityException e) {
523504
throw new ConfigurationException(
524505
"Security excetion when loading resource: " + name
525-
+ " due to: " + e.toString());
506+
+ " due to: " + e.toString());
526507
} catch (final NoSuchMethodException e) {
527508
throw new ConfigurationException(
528509
"Method not found excetion when loading resource: "
@@ -534,7 +515,7 @@ private void launchAgentFromClassInfo(String resourceClassNames)
534515
} catch (final InstantiationException e) {
535516
throw new ConfigurationException(
536517
"Instantiation excetion when loading resource: " + name
537-
+ " due to: " + e.toString());
518+
+ " due to: " + e.toString());
538519
} catch (final IllegalAccessException e) {
539520
throw new ConfigurationException(
540521
"Illegal access exception when loading resource: "

0 commit comments

Comments
 (0)