mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Merge branch '4.9'
This commit is contained in:
commit
41c71576c0
@ -81,6 +81,17 @@
|
|||||||
<artifactId>cloud-framework-events</artifactId>
|
<artifactId>cloud-framework-events</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.cloudstack</groupId>
|
||||||
|
<artifactId>cloud-utils</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<artifactId>xml-apis</artifactId>
|
||||||
|
<groupId>xml-apis</groupId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.cloudstack</groupId>
|
<groupId>org.apache.cloudstack</groupId>
|
||||||
<artifactId>cloud-framework-spring-lifecycle</artifactId>
|
<artifactId>cloud-framework-spring-lifecycle</artifactId>
|
||||||
|
|||||||
@ -28,8 +28,8 @@ import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
|||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import org.apache.cloudstack.context.CallContext;
|
import org.apache.cloudstack.context.CallContext;
|
||||||
import org.apache.cloudstack.framework.messagebus.MessageBus;
|
import org.apache.cloudstack.framework.events.EventBus;
|
||||||
import org.apache.cloudstack.framework.messagebus.MessageBusBase;
|
import org.apache.cloudstack.framework.events.EventBusException;
|
||||||
import org.aopalliance.intercept.MethodInterceptor;
|
import org.aopalliance.intercept.MethodInterceptor;
|
||||||
import org.aopalliance.intercept.MethodInvocation;
|
import org.aopalliance.intercept.MethodInvocation;
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ import com.cloud.utils.component.ComponentMethodInterceptor;
|
|||||||
public class EventUtils {
|
public class EventUtils {
|
||||||
private static final Logger s_logger = Logger.getLogger(EventUtils.class);
|
private static final Logger s_logger = Logger.getLogger(EventUtils.class);
|
||||||
|
|
||||||
protected static MessageBus s_messageBus = null;
|
protected static EventBus s_eventBus = null;
|
||||||
|
|
||||||
public EventUtils() {
|
public EventUtils() {
|
||||||
}
|
}
|
||||||
@ -58,7 +58,7 @@ public class EventUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
s_messageBus = ComponentContext.getComponent(MessageBusBase.class);
|
s_eventBus = ComponentContext.getComponent(EventBus.class);
|
||||||
} catch (NoSuchBeanDefinitionException nbe) {
|
} catch (NoSuchBeanDefinitionException nbe) {
|
||||||
return; // no provider is configured to provide events bus, so just return
|
return; // no provider is configured to provide events bus, so just return
|
||||||
}
|
}
|
||||||
@ -72,9 +72,10 @@ public class EventUtils {
|
|||||||
eventDescription.put("details", details);
|
eventDescription.put("details", details);
|
||||||
event.setDescription(eventDescription);
|
event.setDescription(eventDescription);
|
||||||
try {
|
try {
|
||||||
s_messageBus.publish(EventTypes.getEntityForEvent(eventType), eventType, null, event);
|
s_eventBus.publish(event);
|
||||||
} catch (Exception e) {
|
} catch (EventBusException evx) {
|
||||||
s_logger.warn("Failed to publish action event on the the event bus.");
|
String errMsg = "Failed to publish contrail event.";
|
||||||
|
s_logger.warn(errMsg, evx);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user