KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > avalon > phoenix > interfaces > SystemManager


1 /*
2  * Copyright (C) The Apache Software Foundation. All rights reserved.
3  *
4  * This software is published under the terms of the Apache Software License
5  * version 1.1, a copy of which has been included with this distribution in
6  * the LICENSE.txt file.
7  */

8 package org.apache.avalon.phoenix.interfaces;
9
10 /**
11  * This component is responsible for managing the system.
12  * This includes managing the embeddor, deployer and kernel.
13  *
14  * @author <a HREF="mail@leosimons.com">Leo Simons</a>
15  * @author <a HREF="mailto:peter at apache.org">Peter Donald</a>
16  */

17 public interface SystemManager
18 {
19     String JavaDoc ROLE = SystemManager.class.getName();
20
21     /**
22      * Register an object for management.
23      * The object is exported through some management scheme
24      * (typically JMX) and the management is restricted
25      * to the interfaces passed in as a parameter to method.
26      *
27      * @param name the name to register object under
28      * @param object the object
29      * @param interfaces the interfaces to register the component under
30      * @throws ManagerException if an error occurs. An error could occur if the object doesn't
31      * implement the interfaces, the interfaces parameter contain non-instance
32      * classes, the name is already registered etc.
33      * @throws IllegalArgumentException if object or interfaces is null
34      */

35     void register( String JavaDoc name, Object JavaDoc object, Class JavaDoc[] interfaces )
36         throws ManagerException, IllegalArgumentException JavaDoc;
37
38     /**
39      * Register an object for management.
40      * The object is exported through some management scheme
41      * (typically JMX). Note that the particular management scheme
42      * will most likely use reflection to extract manageable information.
43      *
44      * @param name the name to register object under
45      * @param object the object
46      * @throws ManagerException if an error occurs such as name already registered.
47      * @throws IllegalArgumentException if object is null
48      */

49     void register( String JavaDoc name, Object JavaDoc object )
50         throws ManagerException, IllegalArgumentException JavaDoc;
51
52     /**
53      * Unregister named object.
54      *
55      * @param name the name of object to unregister
56      * @throws ManagerException if an error occurs such as when no such object registered.
57      */

58     void unregister( String JavaDoc name )
59         throws ManagerException;
60
61     /**
62      * Returns the subcontext of the specified name. If it does not exist it
63      * is created.
64      *
65      * @param name name of the object in the parent context that will own this one
66      * @param type of objects that will be managed in this context
67      * @throws ManagerException if context cannot be created or retrieved
68      * @return the subcontext with the specified name
69      */

70     SystemManager getSubContext( String JavaDoc name, String JavaDoc type )
71         throws ManagerException;
72 }
73
Popular Tags