activemq-cpp-3.8.2
LogManager.h
Go to the documentation of this file.
1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17 #ifndef _DECAF_UTIL_LOGGING_LOGMANAGER_H_
18 #define _DECAF_UTIL_LOGGING_LOGMANAGER_H_
19 
20 #include <map>
21 #include <list>
22 #include <string>
23 #include <vector>
24 
25 #include <decaf/lang/Pointer.h>
26 #include <decaf/util/Properties.h>
28 #include <decaf/util/Config.h>
29 
30 #include <decaf/io/IOException.h>
33 
34 namespace decaf{
35 namespace lang{
36  class Runtime;
37 }
38 namespace io{
39  class InputStream;
40 }
41 namespace util{
42 namespace logging{
43 
44  class Logger;
45  class LogManagerInternals;
46  class PropertyChangeListener;
47 
49 
148  private:
149 
150  // Change listener on this class's Properties
151  std::list<PropertyChangeListener*> listeners;
152 
153  // Properties of the Log Manager
154  util::Properties properties;
155 
156  // Data structure for LogManager Internal data.
157  LogManagerInternals* internal;
158 
159  public:
160 
161  virtual ~LogManager();
162 
175  bool addLogger( Logger* logger );
176 
183  Logger* getLogger( const std::string& name );
184 
194  int getLoggerNames( const std::vector<std::string>& names );
195 
201  void setProperties( const util::Properties& properties );
202 
209  return properties;
210  }
211 
220  std::string getProperty( const std::string& name );
221 
229  void addPropertyChangeListener( PropertyChangeListener* listener );
230 
239  void removePropertyChangeListener( PropertyChangeListener* listener );
240 
255  void readConfiguration();
256 
271  void readConfiguration( decaf::io::InputStream* stream );
272 
280  void reset();
281 
282  public: // Static Singleton Methods.
283 
288  static LogManager& getLogManager();
289 
290  private:
291 
295  static void initialize();
296 
300  static void shutdown();
301 
302  protected:
303 
307  LogManager();
308 
313  LogManager( const LogManager& manager );
314 
319  void operator=( const LogManager& manager );
320 
321  private:
322 
323  friend class decaf::lang::Runtime;
324 
325  };
326 
327 }}}
328 
329 #endif /*_DECAF_UTIL_LOGGING_LOGMANAGER_H_*/
A Logger object is used to log messages for a specific system or application component.
Definition: Logger.h:86
A base class that must be implemented by all classes wishing to provide a class that reads in a strea...
Definition: InputStream.h:39
Definition: Runtime.h:26
There is a single global LogManager object that is used to maintain a set of shared state about Logge...
Definition: LogManager.h:147
#define DECAF_API
Definition: Config.h:29
const util::Properties & getProperties() const
Gets a reference to the Logging Properties used by this logger.
Definition: LogManager.h:208
Java-like properties class for mapping string names to string values.
Definition: Properties.h:53
Decaf&#39;s implementation of a Smart Pointer that is a template on a Type and is Thread Safe if the defa...
Definition: Pointer.h:53
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: AprPool.h:25