01: /*****************************************************************************
02: * Copyright (C) NanoContainer Organization. All rights reserved. *
03: * ------------------------------------------------------------------------- *
04: * The software in this package is published under the terms of the BSD *
05: * style license a copy of which has been included with this distribution in *
06: * the LICENSE.txt file. *
07: * *
08: * Original code by Joerg Schaible *
09: *****************************************************************************/package org.picocontainer.gems.jmx;
10:
11: /**
12: * An abstract ObjectNameFactory that offers functionality to handle the domain part of the object name.
13: * @author Jörg Schaible
14: */
15: public abstract class AbstractObjectNameFactory implements
16: ObjectNameFactory {
17:
18: private final String domain;
19:
20: /**
21: * Construct an AbstractObjectNameFactory.
22: * @param domain The name of the domain, use <code>null</code> for the default domain.
23: */
24: protected AbstractObjectNameFactory(final String domain) {
25: this .domain = domain;
26: }
27:
28: /**
29: * @return Return the domain part of the {@link javax.management.ObjectName}.
30: */
31: protected String getDomain() {
32: return domain != null ? domain : "";
33: }
34: }
|