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

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

?? layoutdynamicmbean.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.Logger;import org.apache.log4j.Level;import org.apache.log4j.Layout;import org.apache.log4j.helpers.OptionConverter;import org.apache.log4j.spi.OptionHandler;import java.util.Vector;import java.util.Hashtable;import java.lang.reflect.Method;import javax.management.MBeanAttributeInfo;import javax.management.MBeanConstructorInfo;import javax.management.MBeanNotificationInfo;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.MBeanOperationInfo;import javax.management.MBeanParameterInfo;import java.beans.Introspector;import java.beans.BeanInfo;import java.beans.PropertyDescriptor;import java.beans.IntrospectionException;public class LayoutDynamicMBean extends AbstractDynamicMBean {  private MBeanConstructorInfo[] dConstructors = new MBeanConstructorInfo[1];  private Vector dAttributes = new Vector();  private String dClassName = this.getClass().getName();  private Hashtable dynamicProps = new Hashtable(5);  private MBeanOperationInfo[] dOperations = new MBeanOperationInfo[1];  private String dDescription =     "This MBean acts as a management facade for log4j layouts.";  // This category instance is for logging.  private static Logger cat = Logger.getLogger(LayoutDynamicMBean.class);  // We wrap this layout instance.  private Layout layout;  public  LayoutDynamicMBean(Layout layout) throws IntrospectionException {    this.layout = layout;    buildDynamicMBeanInfo();  }  private  void buildDynamicMBeanInfo() throws IntrospectionException {    Constructor[] constructors = this.getClass().getConstructors();    dConstructors[0] = new MBeanConstructorInfo(             "LayoutDynamicMBean(): Constructs a LayoutDynamicMBean instance",	     constructors[0]);    BeanInfo bi = Introspector.getBeanInfo(layout.getClass());    PropertyDescriptor[] pd = bi.getPropertyDescriptors();    int size = pd.length;    for(int i = 0; i < size; i++) {      String name = pd[i].getName();      Method readMethod =  pd[i].getReadMethod();      Method writeMethod =  pd[i].getWriteMethod();      if(readMethod != null) {	Class returnClass = readMethod.getReturnType();	if(isSupportedType(returnClass)) {	  String returnClassName;	  if(returnClass.isAssignableFrom(Level.class)) {	    returnClassName = "java.lang.String";	  } else {	    returnClassName = returnClass.getName();	  }	  dAttributes.add(new MBeanAttributeInfo(name,						 returnClassName,						 "Dynamic",						 true,						 writeMethod != null,						 false));	  dynamicProps.put(name, new MethodUnion(readMethod, writeMethod));	}      }    }    MBeanParameterInfo[] params = new MBeanParameterInfo[0];    dOperations[0] = new MBeanOperationInfo("activateOptions",					    "activateOptions(): add an layout",					    params,					    "void",					    MBeanOperationInfo.ACTION);  }  private  boolean isSupportedType(Class clazz) {    if(clazz.isPrimitive()) {      return true;    }    if(clazz == String.class) {      return true;    }    if(clazz.isAssignableFrom(Level.class)) {      return true;    }    return false;  }  public  MBeanInfo getMBeanInfo() {    cat.debug("getMBeanInfo called.");    MBeanAttributeInfo[] attribs = new MBeanAttributeInfo[dAttributes.size()];    dAttributes.toArray(attribs);    return new MBeanInfo(dClassName,			 dDescription,			 attribs,			 dConstructors,			 dOperations,			 new MBeanNotificationInfo[0]);  }  public  Object invoke(String operationName, Object params[], String signature[])    throws MBeanException,    ReflectionException {    if(operationName.equals("activateOptions") &&                     layout instanceof OptionHandler) {      OptionHandler oh = (OptionHandler) layout;      oh.activateOptions();      return "Options activated.";    }    return null;  }  protected  Logger  getLogger() {    return cat;  }  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");    }    MethodUnion mu = (MethodUnion) dynamicProps.get(attributeName);    cat.debug("----name="+attributeName+", mu="+mu);    if(mu != null && mu.readMethod != null) {      try {	return mu.readMethod.invoke(layout, null);      } catch(Exception e) {	return null;      }    }    // If attributeName has not been recognized throw an AttributeNotFoundException    throw(new AttributeNotFoundException("Cannot find " + attributeName +					 " attribute in " + dClassName));  }  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");    }    MethodUnion mu = (MethodUnion) dynamicProps.get(name);    if(mu != null && mu.writeMethod != null) {      Object[] o = new Object[1];      Class[] params = mu.writeMethod.getParameterTypes();      if(params[0] == org.apache.log4j.Priority.class) {	value = OptionConverter.toLevel((String) value,					(Level) getAttribute(name));      }      o[0] = value;      try {	mu.writeMethod.invoke(layout,  o);      } catch(Exception e) {	cat.error("FIXME", e);      }    } else {      throw(new AttributeNotFoundException("Attribute " + name +					   " not found in " +					   this.getClass().getName()));    }  }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一区二区三区日韩视频| 51久久夜色精品国产麻豆| 亚洲va韩国va欧美va精品| 精品国一区二区三区| 欧美中文字幕不卡| 国产成人免费视| 免费人成网站在线观看欧美高清| 国产精品久99| 久久久久国产精品免费免费搜索 | 99在线热播精品免费| 日本在线不卡视频一二三区| 亚洲色图色小说| 国产欧美综合色| 欧美成人免费网站| 欧美色精品天天在线观看视频| 成a人片亚洲日本久久| 美女网站色91| 天堂影院一区二区| 亚洲综合色网站| 亚洲视频 欧洲视频| 中文字幕免费观看一区| 欧美电视剧免费全集观看| 欧美午夜影院一区| 91麻豆精品视频| 成人的网站免费观看| 国产精品一区二区三区乱码| 免费观看91视频大全| 日本在线不卡一区| 亚洲国产一区二区视频| 亚洲精品中文在线| 国产精品亲子乱子伦xxxx裸| 久久夜色精品一区| 精品国产乱码久久久久久蜜臀| 欧美在线|欧美| 欧美曰成人黄网| 91免费观看视频| 成人精品视频网站| 成人一级黄色片| 成人激情综合网站| 国产91对白在线观看九色| 国产成人丝袜美腿| 国产精品996| 成人妖精视频yjsp地址| 成人高清视频在线观看| gogo大胆日本视频一区| av在线综合网| 色综合天天综合网天天看片| 91麻豆精品视频| 欧美曰成人黄网| 欧美久久久久久久久久| 在线电影院国产精品| 欧美日韩精品系列| 欧美一区二区三区不卡| 欧美成人午夜电影| 亚洲人快播电影网| 亚洲成人自拍网| 久久国产三级精品| 国精产品一区一区三区mba视频 | 国内精品嫩模私拍在线| 国产精品影视在线| 99热这里都是精品| 91激情在线视频| 日韩欧美一区二区在线视频| 久久婷婷国产综合精品青草| 国产精品美日韩| 亚洲午夜免费电影| 久久精品国产精品亚洲综合| 国产精品一品二品| 色噜噜狠狠色综合中国| 天涯成人国产亚洲精品一区av| 亚洲二区在线视频| 国产欧美精品一区二区三区四区| 中文在线一区二区| 亚洲一卡二卡三卡四卡| 婷婷久久综合九色国产成人| 国产在线精品一区二区夜色 | 亚洲第一福利一区| 久久99久久久久| 成人一道本在线| 欧美日韩高清一区| 国产欧美视频在线观看| 亚洲黄色免费网站| 久久福利视频一区二区| 成人av电影免费观看| 67194成人在线观看| 中文字幕国产精品一区二区| 午夜影视日本亚洲欧洲精品| 激情久久久久久久久久久久久久久久| 99久久婷婷国产| 日韩欧美综合一区| 亚洲女同女同女同女同女同69| 伦理电影国产精品| 色激情天天射综合网| 欧美一卡二卡在线观看| 国产免费成人在线视频| 成人免费毛片aaaaa**| 欧美综合一区二区| 中文av一区二区| 蜜臀精品一区二区三区在线观看| 99精品视频在线观看免费| 91精品福利在线一区二区三区| 中文字幕一区二区在线播放| 看国产成人h片视频| 91国产成人在线| 国产欧美日韩卡一| 青青草视频一区| 欧洲精品视频在线观看| 国产日产亚洲精品系列| 久久激情综合网| 欧美日高清视频| 亚洲丝袜自拍清纯另类| 国产精品一区二区久久不卡| 欧洲国内综合视频| 中文字幕一区av| 高清成人在线观看| 精品91自产拍在线观看一区| 亚洲成人在线免费| 欧美在线观看视频一区二区| 亚洲色图欧美偷拍| 成人白浆超碰人人人人| 久久久噜噜噜久久人人看| 人人狠狠综合久久亚洲| 欧美日韩一卡二卡| 亚洲一区二区三区四区五区中文 | 国产精品久久夜| 国产老女人精品毛片久久| 日韩亚洲欧美一区| 性久久久久久久久久久久| 91久久人澡人人添人人爽欧美| 亚洲乱码国产乱码精品精小说| 国产乱子伦视频一区二区三区 | 欧美日韩国产在线播放网站| 亚洲欧美激情一区二区| www.综合网.com| 亚洲色图欧洲色图婷婷| 99精品国产一区二区三区不卡| 国产亚洲精品精华液| 国产一区二区三区最好精华液| 久久这里只精品最新地址| 国内精品免费**视频| 久久久久88色偷偷免费| 高清不卡一区二区在线| 日本一区二区三区国色天香| 成人精品小蝌蚪| 亚洲三级视频在线观看| 在线精品视频免费播放| 天堂va蜜桃一区二区三区 | 久久久久久久电影| 亚洲激情av在线| 欧美日韩在线三区| 一区二区在线观看免费| 一本大道久久精品懂色aⅴ| 欧美国产日韩亚洲一区| 国产馆精品极品| 国产亚洲欧洲997久久综合| 国产在线精品免费av| 国产精品青草久久| 波多野结衣视频一区| 中文字幕在线不卡视频| av男人天堂一区| 天天综合天天综合色| 欧美精品精品一区| 日本视频免费一区| 欧美一级片免费看| 成人一区二区在线观看| 中文字幕一区免费在线观看| 色偷偷一区二区三区| 久久久久97国产精华液好用吗| 99精品欧美一区二区三区小说| 伊人色综合久久天天| 在线免费观看不卡av| 五月天久久比比资源色| 欧美一二三四在线| 免费在线成人网| 国产精品免费视频一区| 色综合天天综合给合国产| 亚洲一区二区在线观看视频 | 亚洲天堂福利av| 欧美午夜宅男影院| 免费观看在线综合| 亚洲三级免费观看| 精品婷婷伊人一区三区三| 美女脱光内衣内裤视频久久网站| 国产日韩欧美一区二区三区乱码 | 欧美一区二区三区四区五区 | 成人国产精品免费网站| 中文字幕在线不卡一区| 日韩欧美激情四射| 成人妖精视频yjsp地址| 国产成人精品一区二区三区网站观看| 亚洲黄色尤物视频| 日韩久久免费av| 成人不卡免费av| 视频一区二区三区中文字幕| 国产精品沙发午睡系列990531| 欧美日韩一区视频| 国产精品一二三区在线| 日韩专区一卡二卡| 国产精品丝袜一区| 日韩视频在线观看一区二区|