EventBusServiceInterface - Service representing an event bus. The service acts as message router between event producers and event consumers.
ScheduledThredPoolServiceInterface - An extension of the simple pool of threads able to schedule work to be executed at some point in time.
ThreadFactoryServiceInterface - Service representing a ThreadFactory instance. It is directly useful in Java world,
where various library pieces need to create threads and you may want to inject a customized thread implementation.
ThreadPoolServiceInterface - Representing a simple pool of threads able to execute work.
Change-Id: I4bb9c3fb118f317816ee24c7edaa292f8780ae32
Signed-off-by: Milos Fabian <milfabia@cisco.com>
<module>yang-store-impl</module>
<module>yang-test</module>
<module>logback-config</module>
+ <module>threadpool-config-api</module>
</modules>
<profiles>
--- /dev/null
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>config-subsystem</artifactId>
+ <version>0.2.2-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>threadpool-config-api</artifactId>
+ <name>${project.artifactId}</name>
+ <packaging>bundle</packaging>
+ <prerequisites>
+ <maven>3.0.4</maven>
+ </prerequisites>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>config-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <configuration>
+ <instructions>
+ <Import-Package>
+ org.opendaylight.controller.config.api.*,
+ com.google.common.eventbus,
+ </Import-Package>
+ <Export-Package>
+ org.opendaylight.controller.config.threadpool,
+ org.opendaylight.controller.config.yang.threadpool
+ </Export-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.controller.config.threadpool;
+
+import java.util.concurrent.ScheduledExecutorService;
+
+/**
+ * Interface representing scheduled {@link ThreadPool}.
+ */
+public interface ScheduledThreadPool extends ThreadPool {
+
+ @Override
+ public ScheduledExecutorService getExecutor();
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.controller.config.threadpool;
+
+import java.util.concurrent.ExecutorService;
+
+/**
+ * Interface representing thread pool.
+ */
+public interface ThreadPool {
+
+ public ExecutorService getExecutor();
+
+ public int getMaxThreadCount();
+}
\ No newline at end of file
--- /dev/null
+// vi: set smarttab et sw=4 tabstop=4:
+module threadpool {
+ yang-version 1;
+ namespace "urn:opendaylight:params:xml:ns:yang:controller:threadpool";
+ prefix "th";
+
+ import config { prefix config; revision-date 2013-04-05; }
+
+ organization "Cisco Systems, Inc.";
+
+ contact "Robert Varga <rovarga@cisco.com>";
+
+ description
+ "This module contains the base YANG definitions for
+ thread-related services.
+
+ Copyright (c)2013 Cisco Systems, Inc. All rights reserved.;
+
+ This program and the accompanying materials are made available
+ under the terms of the Eclipse Public License v1.0 which
+ accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html";
+
+ revision "2013-04-09" {
+ description
+ "Added eventbus service.";
+ }
+
+ revision "2013-04-05" {
+ description
+ "Updated with YANG extension for Java class specification.";
+ }
+
+ revision "2013-04-03" {
+ description
+ "Initial revision by Anton Tkacik, Tomas Olvecky and
+ Robert Varga.";
+ }
+
+ identity eventbus {
+ description
+ "Service representing an event bus. The service acts as message
+ router between event producers and event consumers";
+
+ base "config:service-type";
+ config:java-class "com.google.common.eventbus.EventBus";
+ }
+
+ identity threadfactory {
+ description
+ "Service representing a ThreadFactory instance. It is directly
+ useful in Java world, where various library pieces need to create
+ threads and you may want to inject a customized thread
+ implementation.";
+
+ base "config:service-type";
+ config:java-class "java.util.concurrent.ThreadFactory";
+ }
+
+ identity threadpool {
+ description
+ "A simple pool of threads able to execute work.";
+
+ base "config:service-type";
+ config:java-class "org.opendaylight.controller.config.threadpool.ThreadPool";
+ }
+
+ identity scheduled-threadpool {
+ description
+ "An extension of the simple pool of threads able to schedule
+ work to be executed at some point in time.";
+
+ base "threadpool";
+ config:java-class "org.opendaylight.controller.config.threadpool.ScheduledThreadPool";
+ }
+
+}