Convert netty-threadgroup-config to OSGi DS
[controller.git] / opendaylight / config / netty-threadgroup-config / src / main / java / org / opendaylight / controller / config / yang / netty / threadgroup / GlobalWorkerGroup.java
1 /*
2  * Copyright (c) 2021 PANTHEON.tech, s.r.o. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.controller.config.yang.netty.threadgroup;
9
10 import io.netty.channel.EventLoopGroup;
11 import org.osgi.service.component.annotations.Activate;
12 import org.osgi.service.component.annotations.Component;
13 import org.osgi.service.component.annotations.Deactivate;
14 import org.osgi.service.metatype.annotations.Designate;
15
16 @Component(immediate = true, service = EventLoopGroup.class, property = "type=global-worker-group")
17 @Designate(ocd = Configuration.class)
18 public final class GlobalWorkerGroup extends AbstractGlobalGroup {
19     @Activate
20     public GlobalWorkerGroup(final Configuration configuration) {
21         super(configuration.workerThreadCount());
22     }
23
24     @Deactivate
25     void deactivate() {
26         close();
27     }
28 }