blob: 125ceab3dd385013a58ce053495def61d2b80780 [file] [log] [blame]
Ray Milkey584f54b2018-10-08 14:45:20 -07001/*
2 * Copyright 2018-present Open Networking Foundation
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
17package org.onosproject.store.atomix;
18
19import org.onosproject.component.ComponentService;
20import org.osgi.service.component.annotations.Activate;
21import org.osgi.service.component.annotations.Component;
22import org.osgi.service.component.annotations.Reference;
23import org.osgi.service.component.annotations.ReferenceCardinality;
24import org.slf4j.Logger;
25
26import static org.slf4j.LoggerFactory.getLogger;
27
28@Component(immediate = true, service = ClusterActivator.class)
29public class ClusterActivator {
30 private final Logger log = getLogger(getClass());
31
32 @Reference(cardinality = ReferenceCardinality.MANDATORY)
33 private ComponentService componentService;
34
35 @Activate
36 public void activate() {
37 log.info("Started");
38 }
39
40 /**
41 * Resources needed by the cluster are now available and the Atomix
42 * cluster can be formed.
43 */
44 public void activateCluster() {
45 componentService.activate(null, "org.onosproject.store.atomix.impl.AtomixManager");
46 }
47}