01: /**
02: * EasyBeans
03: * Copyright (C) 2006 Bull S.A.S.
04: * Contact: easybeans@ow2.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2.1 of the License, or any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public
17: * License along with this library; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19: * USA
20: *
21: * --------------------------------------------------------------------------
22: * $Id: EZBManagementIdentifier.java 1970 2007-10-16 11:49:25Z benoitf $
23: * --------------------------------------------------------------------------
24: */package org.ow2.easybeans.api.jmx;
25:
26: /**
27: * JMX Identifier, used to create a JMX ObjectName from an Object.
28: * @author Guillaume Sauthier
29: * @param <ManagedType> Managed resource Type
30: */
31: public interface EZBManagementIdentifier<ManagedType> {
32:
33: /**
34: * @return Returns the JMX Domain name of the MBean.
35: */
36: String getDomain();
37:
38: /**
39: * May differ if JSR77 MBean or "normal" MBean.<br/>
40: * A JSR77 MBean has j2eeType=XX, but a "normal" MBean has type=YY.
41: * Will probably be implemented by an abstract class.
42: * @return Returns the type=type_name couple.
43: */
44: String getTypeProperty();
45:
46: /**
47: * @return Returns the 'type' property name : <code>j2eeType</code>
48: * for JSR 77 and <code>type</code> for others.
49: */
50: String getTypeName();
51:
52: /**
53: * This method has to be implemented by each {@link EZBManagementIdentifier}.
54: * @return Returns the type value. (example : <code>J2EEServer</code>)
55: */
56: String getTypeValue();
57:
58: /**
59: * @param instance Managed instance from which the name will be extracted.
60: * @return Returns the ObjectName 'name' property value.
61: */
62: String getNamePropertyValue(final ManagedType instance);
63:
64: /**
65: * @param instance Managed instance from which the additionnal
66: * properties will be extracted.
67: * @return Returns a comma separated(,) list of properties (name=value)
68: */
69: String getAdditionnalProperties(final ManagedType instance);
70:
71: /**
72: * Sets the domain for this identifier.
73: * @param domainName the JMX Domain name of the MBean.
74: */
75: void setDomain(final String domainName);
76:
77: /**
78: * Sets the Server name for this identifier.
79: * @param serverName the JMX Server name of this MBean.
80: */
81: void setServerName(final String serverName);
82:
83: }
|