Skip to content

Package: KapuaBrokerApplicationPlugin

KapuaBrokerApplicationPlugin

nameinstructionbranchcomplexitylinemethod
KapuaBrokerApplicationPlugin()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
installPlugin(Broker)
M: 18 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
static {...}
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2016, 2022 Eurotech and/or its affiliates and others
3: *
4: * This program and the accompanying materials are made
5: * available under the terms of the Eclipse Public License 2.0
6: * which is available at https://www.eclipse.org/legal/epl-2.0/
7: *
8: * SPDX-License-Identifier: EPL-2.0
9: *
10: * Contributors:
11: * Eurotech - initial API and implementation
12: *******************************************************************************/
13: package org.eclipse.kapua.broker.core;
14:
15: import org.apache.activemq.broker.Broker;
16: import org.apache.activemq.broker.BrokerPlugin;
17: import org.eclipse.kapua.broker.core.plugin.KapuaApplicationBrokerFilter;
18: import org.slf4j.Logger;
19: import org.slf4j.LoggerFactory;
20:
21: /**
22: * Install {@link KapuaApplicationBrokerFilter} into activeMQ filter chain plugin.<BR>
23: * <p>
24: * Is called by activeMQ broker by configuring plugin tag inside broker tag into activemq.xml.<BR>
25: * <BR>
26: * <BR>
27: * <p>
28: *
29: * <pre>
30: * <plugins>
31: * <bean xmlns="http://www.springframework.org/schema/beans" id="applicationFilter" class="org.eclipse.kapua.broker.core.KapuaApplicationBrokerFilter"/>
32: * </plugins>
33: * </pre>
34: *
35: * @since 1.0
36: */
37: public class KapuaBrokerApplicationPlugin implements BrokerPlugin {
38:
39: private static final Logger logger = LoggerFactory.getLogger(KapuaBrokerApplicationPlugin.class);
40:
41: public Broker installPlugin(Broker broker) throws Exception {
42: logger.info("Installing Kapua application broker plugin...");
43: try {
44: return new KapuaApplicationBrokerFilter(broker);
45: } catch (Exception e) {
46: logger.error("Error in plugin installation.", e);
47: throw new SecurityException(e);
48: }
49: }
50:
51: }