KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > management > loading > MLetMBean


1 /*
2  * @(#)MLetMBean.java 4.19 04/04/20
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.management.loading;
9
10 import java.net.URL JavaDoc;
11 import java.io.InputStream JavaDoc;
12 import java.io.IOException JavaDoc;
13 import java.util.Set JavaDoc;
14 import java.util.Enumeration JavaDoc;
15
16 import javax.management.*;
17
18
19
20 /**
21  * Exposes the remote management interface of the MLet
22  * MBean.
23  *
24  * @since 1.5
25  */

26 public interface MLetMBean {
27
28     
29     /**
30      * Loads a text file containing MLET tags that define the MBeans
31      * to be added to the agent. The location of the text file is
32      * specified by a URL. The text file is read using the UTF-8
33      * encoding. The MBeans specified in the MLET file will be
34      * instantiated and registered by the MBeanServer.
35      *
36      * @param url The URL of the text file to be loaded as String object.
37      *
38      * @return A set containing one entry per MLET tag in the m-let
39      * text file loaded. Each entry specifies either the
40      * ObjectInstance for the created MBean, or a throwable object
41      * (that is, an error or an exception) if the MBean could not be
42      * created.
43      *
44      * @exception ServiceNotFoundException One of the following errors
45      * has occurred: The m-let text file does not contain an MLET tag,
46      * the m-let text file is not found, a mandatory attribute of the
47      * MLET tag is not specified, the value of url is malformed.
48      */

49     public Set JavaDoc getMBeansFromURL(String JavaDoc url) throws ServiceNotFoundException ;
50
51     /**
52      * Loads a text file containing MLET tags that define the MBeans
53      * to be added to the agent. The location of the text file is
54      * specified by a URL. The text file is read using the UTF-8
55      * encoding. The MBeans specified in the MLET file will be
56      * instantiated and registered by the MBeanServer.
57      *
58      * @param url The URL of the text file to be loaded as URL object.
59      *
60      * @return A set containing one entry per MLET tag in the m-let
61      * text file loaded. Each entry specifies either the
62      * ObjectInstance for the created MBean, or a throwable object
63      * (that is, an error or an exception) if the MBean could not be
64      * created.
65      *
66      * @exception ServiceNotFoundException One of the following errors
67      * has occurred: The m-let text file does not contain an MLET tag,
68      * the m-let text file is not found, a mandatory attribute of the
69      * MLET tag is not specified, the value of url is null.
70      */

71     public Set JavaDoc getMBeansFromURL(URL JavaDoc url) throws ServiceNotFoundException ;
72
73     /**
74      * Appends the specified URL to the list of URLs to search for classes and
75      * resources.
76      *
77      * @param url the URL to add.
78      */

79     public void addURL(URL JavaDoc url) ;
80
81     /**
82      * Appends the specified URL to the list of URLs to search for classes and
83      * resources.
84      *
85      * @param url the URL to add.
86      *
87      * @exception ServiceNotFoundException The specified URL is malformed.
88      */

89     public void addURL(String JavaDoc url) throws ServiceNotFoundException;
90
91     /**
92      * Returns the search path of URLs for loading classes and resources.
93      * This includes the original list of URLs specified to the constructor,
94      * along with any URLs subsequently appended by the addURL() method.
95      *
96      * @return the list of URLs.
97      */

98     public URL JavaDoc[] getURLs();
99     
100     /** Finds the resource with the given name.
101      * A resource is some data (images, audio, text, etc) that can be accessed by class code in a way that is
102      * independent of the location of the code.
103      * The name of a resource is a "/"-separated path name that identifies the resource.
104      *
105      * @param name The resource name
106      *
107      * @return An URL for reading the resource, or null if the resource could not be found or the caller doesn't have adequate privileges to get the
108      * resource.
109      */

110     public URL JavaDoc getResource(String JavaDoc name);
111
112     /** Returns an input stream for reading the specified resource. The search order is described in the documentation for
113      * getResource(String).
114      *
115      * @param name The resource name
116      *
117      * @return An input stream for reading the resource, or null if the resource could not be found
118      *
119      */

120     public InputStream JavaDoc getResourceAsStream(String JavaDoc name);
121
122     /**
123      * Finds all the resources with the given name. A resource is some
124      * data (images, audio, text, etc) that can be accessed by class
125      * code in a way that is independent of the location of the code.
126      * The name of a resource is a "/"-separated path name that
127      * identifies the resource.
128      *
129      * @param name The resource name.
130      *
131      * @return An enumeration of URL to the resource. If no resources
132      * could be found, the enumeration will be empty. Resources that
133      * cannot be accessed will not be in the enumeration.
134      *
135      * @exception IOException if an I/O exception occurs when
136      * searching for resources.
137      */

138     public Enumeration JavaDoc getResources(String JavaDoc name) throws IOException JavaDoc;
139
140     /**
141      * Gets the current directory used by the library loader for
142      * storing native libraries before they are loaded into memory.
143      *
144      * @return The current directory used by the library loader.
145      *
146      * @see #setLibraryDirectory
147      */

148     public String JavaDoc getLibraryDirectory();
149     
150     /**
151      * Sets the directory used by the library loader for storing
152      * native libraries before they are loaded into memory.
153      *
154      * @param libdir The directory used by the library loader.
155      *
156      * @see #getLibraryDirectory
157      */

158     public void setLibraryDirectory(String JavaDoc libdir);
159
160  }
161
Popular Tags