2 * Copyright (C) 2015 - EfficiOS Inc., Alexandre Montplaisir <alexmonthy@efficios.com>
4 * This library is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License, version 2.1 only,
6 * as published by the Free Software Foundation.
8 * This library is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this library; if not, write to the Free Software Foundation,
15 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 package org.lttng.ust.agent.context;
21 import java.util.concurrent.CopyOnWriteArraySet;
24 * The singleton manager of {@link IContextInfoRetriever} objects.
26 * @author Alexandre Montplaisir
28 public final class ContextInfoManager {
30 private static final ContextInfoManager INSTANCE = new ContextInfoManager();
32 private final Set<IContextInfoRetriever> cirs = new CopyOnWriteArraySet<IContextInfoRetriever>();
34 /** Singleton class, constructor should not be accessed directly */
35 private ContextInfoManager() {
39 * Get the singleton instance.
41 * @return The singleton instance
42 * @deprecated The context-retrieving facilities are not yet implemented.
45 public static ContextInfoManager getInstance() {
50 * Register a new context info retriever.
52 * This method has no effect if the exact same retriever is already
56 * The context info retriever to register
58 public void addContextInfoRetriever(IContextInfoRetriever cir) {
63 * Unregister a previously added context info retriever.
65 * This method has no effect if the retriever was not already registered.
68 * The context info retriever to unregister
70 public void removeContextInfoRetriever(IContextInfoRetriever cir) {
75 * Return a read-only view (does not support
76 * {@link java.util.Iterator#remove}) of the currently registered context
79 * @return The current context info retrievers
81 public Iterable<IContextInfoRetriever> getContextInfoRetrievers() {