Committed by
Gerrit Code Review
Fix startup dependency between features onos-app-config and onos-app-sdnip:
* Expose NetworkConfigReader as a service - NetworkConfigService * Add reference within SdnIp to NetworkConfigService This fixes bug ONOS-735 Change-Id: I85cdd0ce0a4f6293e8a5633bddd140a23ecddc10
Showing
4 changed files
with
40 additions
and
1 deletions
... | @@ -28,6 +28,7 @@ import org.apache.felix.scr.annotations.Component; | ... | @@ -28,6 +28,7 @@ import org.apache.felix.scr.annotations.Component; |
28 | import org.apache.felix.scr.annotations.Deactivate; | 28 | import org.apache.felix.scr.annotations.Deactivate; |
29 | import org.apache.felix.scr.annotations.Reference; | 29 | import org.apache.felix.scr.annotations.Reference; |
30 | import org.apache.felix.scr.annotations.ReferenceCardinality; | 30 | import org.apache.felix.scr.annotations.ReferenceCardinality; |
31 | +import org.apache.felix.scr.annotations.Service; | ||
31 | import org.onlab.packet.IpAddress; | 32 | import org.onlab.packet.IpAddress; |
32 | import org.onlab.packet.IpPrefix; | 33 | import org.onlab.packet.IpPrefix; |
33 | import org.onlab.packet.MacAddress; | 34 | import org.onlab.packet.MacAddress; |
... | @@ -47,7 +48,8 @@ import com.fasterxml.jackson.databind.ObjectMapper; | ... | @@ -47,7 +48,8 @@ import com.fasterxml.jackson.databind.ObjectMapper; |
47 | * from a file. | 48 | * from a file. |
48 | */ | 49 | */ |
49 | @Component(immediate = true) | 50 | @Component(immediate = true) |
50 | -public class NetworkConfigReader { | 51 | +@Service |
52 | +public class NetworkConfigReader implements NetworkConfigService { | ||
51 | 53 | ||
52 | private final Logger log = getLogger(getClass()); | 54 | private final Logger log = getLogger(getClass()); |
53 | 55 | ... | ... |
1 | +/* | ||
2 | + * Copyright 2015 Open Networking Laboratory | ||
3 | + * | ||
4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | + * you may not use this file except in compliance with the License. | ||
6 | + * You may obtain a copy of the License at | ||
7 | + * | ||
8 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | + * | ||
10 | + * Unless required by applicable law or agreed to in writing, software | ||
11 | + * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | + * See the License for the specific language governing permissions and | ||
14 | + * limitations under the License. | ||
15 | + */ | ||
16 | +package org.onosproject.config; | ||
17 | + | ||
18 | +/** | ||
19 | + * Service interface exported by the Network Configuration. | ||
20 | + */ | ||
21 | +public interface NetworkConfigService { | ||
22 | +} |
... | @@ -96,6 +96,12 @@ | ... | @@ -96,6 +96,12 @@ |
96 | </dependency> | 96 | </dependency> |
97 | 97 | ||
98 | <dependency> | 98 | <dependency> |
99 | + <groupId>org.onosproject</groupId> | ||
100 | + <artifactId>onos-app-config</artifactId> | ||
101 | + <version>${project.version}</version> | ||
102 | + </dependency> | ||
103 | + | ||
104 | + <dependency> | ||
99 | <groupId>org.apache.karaf.shell</groupId> | 105 | <groupId>org.apache.karaf.shell</groupId> |
100 | <artifactId>org.apache.karaf.shell.console</artifactId> | 106 | <artifactId>org.apache.karaf.shell.console</artifactId> |
101 | </dependency> | 107 | </dependency> | ... | ... |
... | @@ -32,6 +32,7 @@ import org.onosproject.cluster.ControllerNode; | ... | @@ -32,6 +32,7 @@ import org.onosproject.cluster.ControllerNode; |
32 | import org.onosproject.cluster.LeadershipEvent; | 32 | import org.onosproject.cluster.LeadershipEvent; |
33 | import org.onosproject.cluster.LeadershipEventListener; | 33 | import org.onosproject.cluster.LeadershipEventListener; |
34 | import org.onosproject.cluster.LeadershipService; | 34 | import org.onosproject.cluster.LeadershipService; |
35 | +import org.onosproject.config.NetworkConfigService; | ||
35 | import org.onosproject.core.ApplicationId; | 36 | import org.onosproject.core.ApplicationId; |
36 | import org.onosproject.core.CoreService; | 37 | import org.onosproject.core.CoreService; |
37 | import org.onosproject.net.host.HostService; | 38 | import org.onosproject.net.host.HostService; |
... | @@ -68,6 +69,14 @@ public class SdnIp implements SdnIpService { | ... | @@ -68,6 +69,14 @@ public class SdnIp implements SdnIpService { |
68 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | 69 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
69 | protected LeadershipService leadershipService; | 70 | protected LeadershipService leadershipService; |
70 | 71 | ||
72 | + // | ||
73 | + // NOTE: Unused reference - needed to guarentee that the | ||
74 | + // NetworkConfigReader component is activated and the network configuration | ||
75 | + // is read. | ||
76 | + // | ||
77 | + @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | ||
78 | + protected NetworkConfigService networkConfigService; | ||
79 | + | ||
71 | private static final int DEFAULT_BGP_PORT = 2000; | 80 | private static final int DEFAULT_BGP_PORT = 2000; |
72 | private int bgpPort; | 81 | private int bgpPort; |
73 | 82 | ... | ... |
-
Please register or login to post a comment