01: /**
02: *
03: */package org.ow2.easybeans.server.management;
04:
05: import org.ow2.easybeans.jsr77.JSR77ManagementIdentifier;
06: import org.ow2.easybeans.server.Embedded;
07:
08: /**
09: * Generates an ObjectName for the {@link Embedded} component.
10: * @author Guillaume Sauthier
11: */
12: public class EmbeddedIdentifier extends
13: JSR77ManagementIdentifier<Embedded> {
14:
15: /**
16: * JMX MBean Type.
17: */
18: private static final String TYPE = "J2EEServer";
19:
20: /**
21: * {@inheritDoc}
22: */
23: public String getAdditionnalProperties(final Embedded instance) {
24: return null;
25: }
26:
27: /**
28: * {@inheritDoc}
29: */
30: public String getNamePropertyValue(final Embedded instance) {
31: // If ServerName is already set, return this value
32: if (getServerName() != null) {
33: return getServerName();
34: }
35: return "EasyBeans_" + instance.getID();
36: }
37:
38: /**
39: * {@inheritDoc}
40: */
41: public String getTypeValue() {
42: return TYPE;
43: }
44:
45: }
|