X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=runtime%2Forg.argeo.slc.core%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fcore%2Fruntime%2FDefaultAgent.java;h=4af24ae97fbe480d40ee4ac8afd48d2236ff6d08;hb=c9e5dbbdf73c815754d2a597d660953eef512426;hp=73f5cfd342a5d2394fbb063b37c8b076574993fb;hpb=cffd700ca670610a1f81e021f82542dc6bf5c810;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/runtime/DefaultAgent.java b/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/runtime/DefaultAgent.java index 73f5cfd34..4af24ae97 100644 --- a/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/runtime/DefaultAgent.java +++ b/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/runtime/DefaultAgent.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Mathieu Baudier + * Copyright (C) 2007-2012 Argeo GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.argeo.slc.core.runtime; import java.net.InetAddress; @@ -24,6 +23,8 @@ import java.util.List; import java.util.Map; import java.util.UUID; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.argeo.slc.SlcException; import org.argeo.slc.core.execution.ProcessThread; import org.argeo.slc.execution.ExecutionModuleDescriptor; @@ -38,6 +39,8 @@ import org.argeo.slc.runtime.SlcAgentDescriptor; /** Implements the base methods of an SLC agent. */ @SuppressWarnings("deprecation") public class DefaultAgent implements SlcAgent, ExecutionProcessNotifier { + private final static Log log = LogFactory.getLog(DefaultAgent.class); + private SlcAgentDescriptor agentDescriptor; private ExecutionModulesManager modulesManager; @@ -50,12 +53,13 @@ public class DefaultAgent implements SlcAgent, ExecutionProcessNotifier { */ /** Initialization */ public void init() { + agentDescriptor = new SlcAgentDescriptor(); + agentDescriptor.setUuid(initAgentUuid()); try { - agentDescriptor = new SlcAgentDescriptor(); - agentDescriptor.setUuid(initAgentUuid()); agentDescriptor.setHost(InetAddress.getLocalHost().getHostName()); } catch (UnknownHostException e) { - throw new SlcException("Unable to create agent descriptor.", e); + log.error("Cannot resolve localhost host name: " + e.getMessage()); + agentDescriptor.setHost("localhost"); } processesThreadGroup = new ThreadGroup("SLC Processes of Agent #" + agentDescriptor.getUuid());