KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jmanage > core > management > ServerConnection


1 /**
2  * Copyright 2004-2005 jManage.org
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.jmanage.core.management;
17
18 import java.util.Set JavaDoc;
19 import java.util.List JavaDoc;
20 import java.io.IOException JavaDoc;
21
22 /**
23  * This interface is the abstraction between different MBeanServer
24  * implementations and jmanage application. jManage application talks to
25  * different MBeanServers via this connection.
26  * <p>
27  * We may be able to leverage this abstraction to talk to applications
28  * which support some other management protocol (like SNMP) than JMX.
29  *
30  * date: Aug 12, 2004
31  * @author Rakesh Kalra
32  */

33 public interface ServerConnection {
34
35     /**
36      * Queries the management objects based on the given object name, containing
37      * the search criteria.
38      *
39      * @param objectName
40      * @return
41      */

42     public Set JavaDoc queryNames(ObjectName objectName);
43
44     /**
45      * Invokes the given "operationName" on the object identified by
46      * "objectName".
47      *
48      * @param objectName
49      * @param operationName
50      * @param params
51      * @param signature
52      * @return
53      */

54     public Object JavaDoc invoke(ObjectName objectName,
55                          String JavaDoc operationName,
56                          Object JavaDoc[] params,
57                          String JavaDoc[] signature);
58
59     /**
60      * Returns the information about the given objectName.
61      *
62      * @param objectName
63      * @return
64      */

65     public ObjectInfo getObjectInfo(ObjectName objectName);
66
67     /**
68      * Gets the value for a single attribute.
69      *
70      * @param objectName
71      * @param attributeName
72      * @return attribute value
73      */

74     public Object JavaDoc getAttribute(ObjectName objectName, String JavaDoc attributeName);
75
76     /**
77      * Returns a list of ObjectAttribute objects containing attribute names
78      * and values for the given attributeNames
79      *
80      * @param objectName
81      * @param attributeNames
82      * @return
83      */

84     public List JavaDoc getAttributes(ObjectName objectName, String JavaDoc[] attributeNames);
85
86     /**
87      * Saves the attribute values.
88      *
89      * @param objectName
90      * @param attributeList list of ObjectAttribute objects
91      */

92     public List JavaDoc setAttributes(ObjectName objectName, List JavaDoc attributeList);
93
94     public void addNotificationListener(ObjectName objectName,
95                                         ObjectNotificationListener listener,
96                                         ObjectNotificationFilter filter,
97                                         Object JavaDoc handback);
98
99     public void removeNotificationListener(ObjectName objectName,
100                                            ObjectNotificationListener listener,
101                                            ObjectNotificationFilter filter,
102                                            Object JavaDoc handback);
103
104     public void createMBean(String JavaDoc className,
105                             ObjectName name,
106                             Object JavaDoc[] params,
107                             String JavaDoc[] signature);
108
109     public void unregisterMBean(ObjectName objectName);
110
111     /**
112      *
113      * @param objectName
114      * @return an object of type javax.management.ObjectName
115      */

116     public Object JavaDoc buildObjectName(String JavaDoc objectName);
117
118     /**
119      * checks if this connection is open
120      * @return true if this connection is open
121      */

122     public boolean isOpen();
123
124     /**
125      * Closes the connection to the server
126      */

127     public void close() throws IOException JavaDoc;
128 }
129
Popular Tags