1 25 26 package org.objectweb.jonas.jmx; 27 28 import java.util.Set ; 29 import java.util.Properties ; 30 import javax.naming.Context ; 31 import javax.management.AttributeList ; 32 import javax.management.ObjectName ; 33 import javax.management.MBeanInfo ; 34 35 39 public class JonasManagementRepr { 40 41 45 private static ManagementRepr repr = null; 49 50 54 public static boolean reprNull() { 55 if (repr == null) { 56 return true; 57 } else { 58 return false; 59 } 60 } 61 65 public static boolean isRegistered(ObjectName on) { 66 return repr.isRegistered(on); 67 } 68 69 74 public static Object getAttribute(ObjectName on, String attribute) 75 throws ManagementException 76 { 77 return repr.getAttribute(on, attribute); 78 } 79 80 85 public static AttributeList getAttributes(ObjectName on, String [] attributes) 86 throws ManagementException 87 { 88 return repr.getAttributes(on, attributes); 89 } 90 91 96 public static void setAttribute(ObjectName on, String attribute, Object value) 97 throws ManagementException 98 { 99 repr.setAttribute(on, attribute, value); 100 } 101 102 105 public static Object invoke(ObjectName on, String operation, Object [] param, String [] signature) 106 throws ManagementException 107 { 108 return repr.invoke(on, operation, param, signature); 109 } 110 111 114 public static java.util.Set queryNames(ObjectName on) throws ManagementException 115 { 116 return repr.queryNames(on); 117 } 118 119 123 public static MBeanInfo getMBeanInfo(ObjectName name) throws ManagementException { 124 return (MBeanInfo )repr.getMBeanInfo(name); 125 } 126 127 130 public static Context getContext() throws javax.naming.NamingException { 131 return repr.getContext(); 132 } 133 137 public static String getCurrentRMIConnectorName() { 138 return repr.getCurrentRMIConnectorName(); 139 } 140 143 public static void setCurrentRMIConnectorName(String name) throws Exception { 144 repr.setCurrentRMIConnectorName(name); 145 } 146 149 public static void resetCurrentRMIConnectorName() { 150 repr.resetCurrentRMIConnectorName(); 151 } 152 155 public static Set getRMIConnectorsNames() throws javax.naming.NamingException { 156 return repr.getRMIConnectorsNames(); 157 } 158 161 public static String getJonasNamingServiceURL() { 162 return repr.getJonasNamingServiceURL(); 163 } 164 167 public static void setJonasNamingServiceURL(String url) throws javax.naming.NamingException { 168 repr.setJonasNamingServiceURL(url); 169 } 170 171 175 public static void setNamingEnvCtx(Properties env) throws javax.naming.NamingException { 176 repr.setNamingEnvCtx(env); 177 } 178 179 182 public static ManagementRepr getRepr() { 183 return repr; 184 } 185 186 189 public static void setRepr(ManagementRepr repr) { 190 JonasManagementRepr.repr = repr; 191 } 192 } 193 | Popular Tags |