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.io.IOException;
12: import java.io.InputStream;
13: import java.net.URL;
14: import java.util.Enumeration;
15: import java.util.Set;
16: import javax.management.ServiceNotFoundException;
17:
18: /**
19: * Management interface for MLets
20: *
21: * @version $Revision: 1.6 $
22: */
23: public interface MLetMBean {
24: /**
25: * @throws ServiceNotFoundException If the specified string URL is malformed
26: * @see #addURL(URL)
27: */
28: public void addURL(String url) throws ServiceNotFoundException;
29:
30: /**
31: * @see java.net.URLClassLoader#addURL
32: */
33: public void addURL(URL url);
34:
35: /**
36: * @see java.net.URLClassLoader#getURLs
37: */
38: public URL[] getURLs();
39:
40: /**
41: * @see java.net.URLClassLoader#getResource
42: */
43: public URL getResource(String name);
44:
45: /**
46: * @see java.net.URLClassLoader#getResourceAsStream
47: */
48: public InputStream getResourceAsStream(String name);
49:
50: /**
51: * @see java.net.URLClassLoader#getResources
52: */
53: public Enumeration getResources(String name) throws IOException;
54:
55: /**
56: * Shortcut for {@link #getMBeansFromURL(URL)}
57: */
58: public Set getMBeansFromURL(String url)
59: throws ServiceNotFoundException;
60:
61: /**
62: * Registers, in the MBeanServer where this MLet is registered, the MBeans specified in the MLet
63: * file pointed by the given URL.
64: *
65: * @param url The URL of the MLet file to load
66: * @return A Set containing the ObjectInstances of the successfully registered MBeans,
67: * or Throwables that specifies why the MBean could not be registered.
68: * @throws ServiceNotFoundException If the given URL is invalid, or does not point to a valid MLet file
69: */
70: public Set getMBeansFromURL(URL url)
71: throws ServiceNotFoundException;
72:
73: /**
74: * Returns the directory used to store native libraries
75: *
76: * @see #setLibraryDirectory
77: */
78: public String getLibraryDirectory();
79:
80: /**
81: * Sets the directory used to store native libraries
82: *
83: * @see #getLibraryDirectory
84: */
85: public void setLibraryDirectory(String libdir);
86: }
|