亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? hierarchydynamicmbean.java

?? apache的log4j源碼
?? JAVA
字號:
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements.  See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License.  You may obtain a copy of the License at *  *      http://www.apache.org/licenses/LICENSE-2.0 *  * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */package org.apache.log4j.jmx;import java.lang.reflect.Constructor;import org.apache.log4j.*;import org.apache.log4j.spi.HierarchyEventListener;import org.apache.log4j.spi.LoggerRepository;import org.apache.log4j.helpers.OptionConverter;import java.util.Vector;import javax.management.MBeanAttributeInfo;import javax.management.MBeanConstructorInfo;import javax.management.MBeanNotificationInfo;import javax.management.MBeanOperationInfo;import javax.management.MBeanParameterInfo;import javax.management.ObjectName;import javax.management.MBeanInfo;import javax.management.Attribute;import javax.management.MBeanException;import javax.management.AttributeNotFoundException;import javax.management.RuntimeOperationsException;import javax.management.ReflectionException;import javax.management.InvalidAttributeValueException;import javax.management.NotificationBroadcasterSupport;import javax.management.NotificationBroadcaster;import javax.management.Notification;import javax.management.NotificationListener;import javax.management.NotificationFilter;import javax.management.NotificationFilterSupport;import javax.management.ListenerNotFoundException;public class HierarchyDynamicMBean extends AbstractDynamicMBean                                   implements HierarchyEventListener,                                              NotificationBroadcaster {  static final String ADD_APPENDER = "addAppender.";  static final String THRESHOLD = "threshold";  private MBeanConstructorInfo[] dConstructors = new MBeanConstructorInfo[1];  private MBeanOperationInfo[] dOperations = new MBeanOperationInfo[1];  private Vector vAttributes = new Vector();  private String dClassName = this.getClass().getName();  private String dDescription =     "This MBean acts as a management facade for org.apache.log4j.Hierarchy.";  private NotificationBroadcasterSupport nbs = new NotificationBroadcasterSupport();  private LoggerRepository hierarchy;  private static Logger log = Logger.getLogger(HierarchyDynamicMBean.class);  public HierarchyDynamicMBean() {    hierarchy = LogManager.getLoggerRepository();    buildDynamicMBeanInfo();  }  private  void buildDynamicMBeanInfo() {    Constructor[] constructors = this.getClass().getConstructors();    dConstructors[0] = new MBeanConstructorInfo(         "HierarchyDynamicMBean(): Constructs a HierarchyDynamicMBean instance",	 constructors[0]);    vAttributes.add(new MBeanAttributeInfo(THRESHOLD,					   "java.lang.String",					   "The \"threshold\" state of the hiearchy.",					   true,					   true,					   false));    MBeanParameterInfo[] params = new MBeanParameterInfo[1];    params[0] = new MBeanParameterInfo("name", "java.lang.String",				       "Create a logger MBean" );    dOperations[0] = new MBeanOperationInfo("addLoggerMBean",				    "addLoggerMBean(): add a loggerMBean",				    params ,				    "javax.management.ObjectName",				    MBeanOperationInfo.ACTION);  }  public  ObjectName addLoggerMBean(String name) {    Logger cat = LogManager.exists(name);    if(cat != null) {      return addLoggerMBean(cat);    } else {      return null;    }  }  ObjectName addLoggerMBean(Logger logger) {    String name = logger.getName();    ObjectName objectName = null;    try {      LoggerDynamicMBean loggerMBean = new LoggerDynamicMBean(logger);      objectName = new ObjectName("log4j", "logger", name);            if (!server.isRegistered(objectName)) {        server.registerMBean(loggerMBean, objectName);        NotificationFilterSupport nfs = new NotificationFilterSupport();        nfs.enableType(ADD_APPENDER + logger.getName());        log.debug("---Adding logger [" + name + "] as listener.");        nbs.addNotificationListener(loggerMBean, nfs, null);        vAttributes.add(new MBeanAttributeInfo("logger=" + name, "javax.management.ObjectName",                "The " + name + " logger.", true, true, // this makes the object                // clickable                false));              }    } catch(Exception e) {      log.error("Could not add loggerMBean for ["+name+"].", e);    }    return objectName;  }  public  void addNotificationListener(NotificationListener listener,			       NotificationFilter filter,			       java.lang.Object handback) {    nbs.addNotificationListener(listener, filter, handback);  }  protected  Logger getLogger() {    return log;  }  public  MBeanInfo getMBeanInfo() {    //cat.debug("getMBeanInfo called.");    MBeanAttributeInfo[] attribs = new MBeanAttributeInfo[vAttributes.size()];    vAttributes.toArray(attribs);    return new MBeanInfo(dClassName,			 dDescription,			 attribs,			 dConstructors,			 dOperations,			 new MBeanNotificationInfo[0]);  }  public  MBeanNotificationInfo[] getNotificationInfo(){    return nbs.getNotificationInfo();  }  public  Object invoke(String operationName,		Object params[],		String signature[]) throws MBeanException,                                           ReflectionException {    if (operationName == null) {      throw new RuntimeOperationsException(        new IllegalArgumentException("Operation name cannot be null"),	"Cannot invoke a null operation in " + dClassName);    }    // Check for a recognized operation name and call the corresponding operation    if(operationName.equals("addLoggerMBean")) {      return addLoggerMBean((String)params[0]);    } else {      throw new ReflectionException(	    new NoSuchMethodException(operationName),	    "Cannot find the operation " + operationName + " in " + dClassName);    }  }  public  Object getAttribute(String attributeName) throws AttributeNotFoundException,                                                    MBeanException,                                                    ReflectionException {    // Check attributeName is not null to avoid NullPointerException later on    if (attributeName == null) {      throw new RuntimeOperationsException(new IllegalArgumentException(			"Attribute name cannot be null"),       "Cannot invoke a getter of " + dClassName + " with null attribute name");    }    log.debug("Called getAttribute with ["+attributeName+"].");    // Check for a recognized attributeName and call the corresponding getter    if (attributeName.equals(THRESHOLD)) {      return hierarchy.getThreshold();    } else if(attributeName.startsWith("logger")) {      int k = attributeName.indexOf("%3D");      String val = attributeName;      if(k > 0) {	val = attributeName.substring(0, k)+'='+ attributeName.substring(k+3);      }      try {	return new ObjectName("log4j:"+val);      } catch(Exception e) {	log.error("Could not create ObjectName" + val);      }    }    // If attributeName has not been recognized throw an AttributeNotFoundException    throw(new AttributeNotFoundException("Cannot find " + attributeName +					 " attribute in " + dClassName));  }  public  void addAppenderEvent(Category logger, Appender appender) {    log.debug("addAppenderEvent called: logger="+logger.getName()+	      ", appender="+appender.getName());    Notification n = new Notification(ADD_APPENDER+logger.getName(), this, 0);    n.setUserData(appender);    log.debug("sending notification.");    nbs.sendNotification(n);  } public  void removeAppenderEvent(Category cat, Appender appender) {    log.debug("removeAppenderCalled: logger="+cat.getName()+	      ", appender="+appender.getName());  }  public  void postRegister(java.lang.Boolean registrationDone) {    log.debug("postRegister is called.");    hierarchy.addHierarchyEventListener(this);    Logger root = hierarchy.getRootLogger();    addLoggerMBean(root);  }  public  void removeNotificationListener(NotificationListener listener)                                         throws ListenerNotFoundException {    nbs.removeNotificationListener(listener);  }  public  void setAttribute(Attribute attribute) throws AttributeNotFoundException,                                                InvalidAttributeValueException,                                                MBeanException,                                                ReflectionException {    // Check attribute is not null to avoid NullPointerException later on    if (attribute == null) {      throw new RuntimeOperationsException(                  new IllegalArgumentException("Attribute cannot be null"),	  "Cannot invoke a setter of "+dClassName+" with null attribute");    }    String name = attribute.getName();    Object value = attribute.getValue();    if (name == null) {      throw new RuntimeOperationsException(               new IllegalArgumentException("Attribute name cannot be null"),	       "Cannot invoke the setter of "+dClassName+	       " with null attribute name");    }    if(name.equals(THRESHOLD)) {      Level l = OptionConverter.toLevel((String) value,					   hierarchy.getThreshold());      hierarchy.setThreshold(l);    }  }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产在线精品不卡| 成人福利视频网站| 精品少妇一区二区三区在线播放| 国产毛片精品视频| 亚洲综合在线五月| 国产精品激情偷乱一区二区∴| 色av一区二区| 国产不卡视频在线播放| 亚洲午夜免费电影| 中文字幕一区二区三区不卡| 欧美巨大另类极品videosbest| 成人永久免费视频| 日韩黄色免费电影| 午夜视频在线观看一区| 亚洲午夜久久久久中文字幕久| 亚洲欧美一区二区在线观看| 国产亚洲欧洲一区高清在线观看| 久久尤物电影视频在线观看| 欧美一区二区三区视频免费播放| 欧美性xxxxxx少妇| 欧美丰满少妇xxxxx高潮对白| 欧美日韩国产美女| 中文字幕一区日韩精品欧美| 无码av中文一区二区三区桃花岛| 高清国产午夜精品久久久久久| 亚洲欧美日韩国产一区二区三区| 欧美电影在哪看比较好| 国产日韩欧美高清在线| 欧美一二三四区在线| 国产目拍亚洲精品99久久精品| 亚洲图片自拍偷拍| 色婷婷av一区| 亚洲国产精品精华液2区45| 色综合久久88色综合天天免费| 日本一区二区三区dvd视频在线| 亚洲高清免费在线| 欧美色图在线观看| 欧美丝袜自拍制服另类| 国产999精品久久久久久绿帽| 国产精品久久毛片av大全日韩| 亚洲国产精品99久久久久久久久| 免费国产亚洲视频| 欧美日本一区二区三区| 亚洲综合免费观看高清完整版在线 | 日本91福利区| 精品人在线二区三区| 不卡电影免费在线播放一区| 国产日韩欧美精品综合| 久久久久久久久一| 国产一区二区在线视频| 国产农村妇女精品| 欧美日韩在线电影| 免费欧美日韩国产三级电影| 精品电影一区二区| 成人免费观看av| 91麻豆蜜桃一区二区三区| 一区二区三区免费网站| 欧美成人福利视频| 日本二三区不卡| 国产福利91精品一区| 亚洲国产精品一区二区www在线| 欧美系列在线观看| 久久久99精品免费观看不卡| 在线免费av一区| 国产一区 二区| 免费欧美在线视频| 亚洲综合自拍偷拍| 日韩精品一区二区三区四区| 99精品国产91久久久久久| 日韩欧美国产不卡| 成人的网站免费观看| 精品一区二区精品| 日韩av网站免费在线| 亚洲成人免费观看| 国产婷婷色一区二区三区| 国产日韩亚洲欧美综合| 日本特黄久久久高潮| 亚洲综合色视频| 亚洲欧美色综合| 亚洲欧美一区二区在线观看| 国产欧美一区二区精品婷婷| 一区二区三区四区视频精品免费 | 精品一区二区国语对白| 久久精品国产999大香线蕉| 日韩一级免费一区| 亚洲女人的天堂| 国产一区二区视频在线播放| 日韩免费电影网站| 日韩 欧美一区二区三区| 欧美一区二区三级| 午夜日韩在线电影| 97久久超碰国产精品| 亚洲欧美欧美一区二区三区| 美女网站一区二区| 日韩欧美国产麻豆| 韩国女主播成人在线| 精品国产伦一区二区三区观看方式 | 7777精品久久久大香线蕉| 日韩精品五月天| 久久久久久久久久久黄色| 成人黄色在线网站| 亚洲免费观看高清完整版在线观看 | jizzjizzjizz欧美| 午夜久久久久久电影| 欧美一区二区久久| 欧美天堂一区二区三区| 激情综合色综合久久综合| 亚洲精品中文在线| 日韩一级二级三级| 91视频一区二区三区| 日本成人在线一区| 国产精品视频免费| 91精品国产综合久久久久| kk眼镜猥琐国模调教系列一区二区 | 丁香天五香天堂综合| 日本国产一区二区| 一区二区三区在线观看欧美| 欧美专区日韩专区| 久久不见久久见免费视频1| 欧美一区二区三区思思人| 国产乱码精品一区二区三 | 亚洲欧美一区二区三区孕妇| 色婷婷一区二区三区四区| 一区二区免费看| www激情久久| 色八戒一区二区三区| 蜜桃一区二区三区在线观看| 在线观看三级视频欧美| 青青草97国产精品免费观看无弹窗版| 亚洲一区二区三区国产| 精品电影一区二区| 高清国产一区二区| 国产99一区视频免费| www.日韩在线| 午夜精品福利在线| 奇米色一区二区| 亚洲成人免费影院| 久久久久国产免费免费| 国产精品夜夜嗨| 日韩免费一区二区| 国产一区久久久| 日韩午夜激情视频| 亚洲无线码一区二区三区| 日韩一二三四区| 盗摄精品av一区二区三区| 国产午夜精品理论片a级大结局| 成人黄色网址在线观看| 久久久五月婷婷| 在线观看视频一区二区| 国产一区亚洲一区| 一区二区三区在线影院| 精品国产乱子伦一区| 欧美另类变人与禽xxxxx| 亚洲成av人片在线| 一区二区三区精品视频| 亚洲一区欧美一区| 亚洲激情图片一区| 一区二区三区四区不卡在线| 91猫先生在线| 亚洲精品久久嫩草网站秘色| 久久草av在线| 欧美性猛片aaaaaaa做受| 亚洲精品久久嫩草网站秘色| 日韩一区二区在线免费观看| 91高清在线观看| 日本亚洲三级在线| 日韩一级黄色片| 欧美性一二三区| 精品久久国产老人久久综合| 欧美日本在线播放| 国产成a人亚洲| 国产经典欧美精品| 91精品国产一区二区三区| 亚洲电影一区二区| 欧美日韩一区成人| 亚洲成人午夜影院| 欧美日韩夫妻久久| 日韩黄色在线观看| 欧美大胆人体bbbb| 国精产品一区一区三区mba桃花| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 精品国内片67194| 极品瑜伽女神91| 久久久久久久久久电影| 成人三级伦理片| 亚洲丝袜自拍清纯另类| 欧美这里有精品| 日本va欧美va欧美va精品| 精品国产自在久精品国产| 国产v综合v亚洲欧| 亚洲色图制服诱惑| 欧美三级电影在线观看| 麻豆久久一区二区| 欧美写真视频网站| 亚洲女爱视频在线| 欧美日韩中文精品| 九九精品视频在线看| 国产婷婷色一区二区三区在线| 99re66热这里只有精品3直播| 亚洲第一综合色|