01: /*
02: * Copyright (C) The DNA Group. All rights reserved.
03: *
04: * This software is published under the terms of the DNA
05: * Software License version 1.1, a copy of which has been included
06: * with this distribution in the LICENSE.txt file.
07: */
08: package org.codehaus.dna.impl;
09:
10: import org.codehaus.dna.Active;
11: import org.codehaus.dna.Composable;
12: import org.codehaus.dna.Configurable;
13: import org.codehaus.dna.Configuration;
14: import org.codehaus.dna.ConfigurationException;
15: import org.codehaus.dna.LogEnabled;
16: import org.codehaus.dna.Logger;
17: import org.codehaus.dna.MissingResourceException;
18: import org.codehaus.dna.ResourceLocator;
19:
20: class MockComponent implements LogEnabled, Composable, Configurable,
21: Active {
22: private Logger m_logger;
23: private ResourceLocator m_services;
24: private Configuration m_configuration;
25: private boolean m_initialized;
26: private boolean m_disposed;
27:
28: public void enableLogging(Logger logger) {
29: m_logger = logger;
30: }
31:
32: public void compose(ResourceLocator locator)
33: throws MissingResourceException {
34: m_services = locator;
35: }
36:
37: public void configure(Configuration configuration)
38: throws ConfigurationException {
39: m_configuration = configuration;
40: }
41:
42: public void initialize() throws Exception {
43: m_initialized = true;
44: }
45:
46: public void dispose() throws Exception {
47: m_disposed = true;
48: }
49:
50: Logger getLogger() {
51: return m_logger;
52: }
53:
54: ResourceLocator getServices() {
55: return m_services;
56: }
57:
58: Configuration getConfiguration() {
59: return m_configuration;
60: }
61:
62: boolean isInitialized() {
63: return m_initialized;
64: }
65:
66: boolean isDisposed() {
67: return m_disposed;
68: }
69: }
|