01: /*
02: * Copyright (C) The MX4J Contributors.
03: * All rights reserved.
04: *
05: * This software is distributed under the terms of the MX4J License version 1.0.
06: * See the terms of the MX4J License in the documentation provided with this software.
07: */
08:
09: package javax.management.loading;
10:
11: import java.net.URL;
12: import java.util.Map;
13:
14: /**
15: * This class is supposed to represent an MLET tag in a MLet file; a big
16: * mistake in JMX 1.2 specification introduced this class in a poorly designed
17: * {@link MLet#check} method, but left this class package private, so that it is totally
18: * useless. Furthermore, this class is so implementation dependent that should have never
19: * seen the light in the public API. But must be present for spec compliance.
20: *
21: * @version $Revision: 1.3 $
22: */
23: class MLetContent {
24: private Map attributes;
25: private URL mletFileURL;
26: private URL codebaseURL;
27:
28: public MLetContent(URL mletFileURL, Map attributes) {
29: this .mletFileURL = mletFileURL;
30: this .attributes = attributes;
31:
32: codebaseURL = (URL) attributes.remove("codebaseURL");
33: }
34:
35: public Map getAttributes() {
36: return attributes;
37: }
38:
39: public URL getDocumentBase() {
40: return mletFileURL;
41: }
42:
43: public URL getCodeBase() {
44: return codebaseURL;
45: }
46:
47: public String getJarFiles() {
48: return (String) getParameter("archive");
49: }
50:
51: public String getCode() {
52: return (String) getParameter("code");
53: }
54:
55: public String getSerializedObject() {
56: return (String) getParameter("object");
57: }
58:
59: public String getName() {
60: return (String) getParameter("name");
61: }
62:
63: public String getVersion() {
64: return (String) getParameter("version");
65: }
66:
67: public Object getParameter(String s) {
68: return attributes.get(s.toLowerCase());
69: }
70: }
|