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

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

?? ejbmbeanadaptor.java

?? server-config-guide.rar,jboss 4.3配置及測試源碼
?? JAVA
字號:
package org.jboss.book.jmx.ex3;import java.lang.reflect.Method;import javax.ejb.CreateException;import javax.management.Attribute;import javax.management.AttributeList;import javax.management.AttributeNotFoundException;import javax.management.DynamicMBean;import javax.management.InvalidAttributeValueException;import javax.management.JMRuntimeException;import javax.management.MBeanAttributeInfo;import javax.management.MBeanConstructorInfo;import javax.management.MBeanInfo;import javax.management.MBeanNotificationInfo;import javax.management.MBeanOperationInfo;import javax.management.MBeanException;import javax.management.MBeanServer;import javax.management.ObjectName;import javax.management.ReflectionException;import javax.naming.InitialContext;import javax.naming.NamingException;import org.jboss.system.ServiceMBeanSupport;/** An example of a DynamicMBean that exposes select attributes and operations of an EJB as an MBean.  @author Scott.Stark@jboss.org @version $Revision: 1.1 $ */public class EjbMBeanAdaptor extends ServiceMBeanSupport   implements DynamicMBean{   private String helloPrefix;   private String ejbJndiName;   private EchoLocalHome home;   /** These are the mbean attributes we expose    */   private MBeanAttributeInfo[] attributes = {      new MBeanAttributeInfo("HelloPrefix", "java.lang.String",         "The prefix message to append to the session echo reply",         true, // isReadable         true, // isWritable         false), // isIs      new MBeanAttributeInfo("EjbJndiName", "java.lang.String",         "The JNDI name of the session bean local home",         true, // isReadable         true, // isWritable         false) // isIs   };   /** These are the mbean operations we expose    */   private MBeanOperationInfo[] operations;   /** We override this method to setup our echo operation info. It could    also be done in a ctor.    */   public ObjectName preRegister(MBeanServer server, ObjectName name)      throws Exception   {      log.info("preRegister notification seen");      operations = new MBeanOperationInfo[5];      Class thisClass = getClass();      Class[] parameterTypes = {String.class};      Method echoMethod = thisClass.getMethod("echo", parameterTypes);      String desc = "The echo op invokes the session bean echo method and"         + " returns its value prefixed with the helloPrefix attribute value";      operations[0] = new MBeanOperationInfo(desc, echoMethod);      // Add the Service interface operations from our super class      parameterTypes = new Class[0];      Method createMethod = thisClass.getMethod("create", parameterTypes);      operations[1] = new MBeanOperationInfo("The JBoss Service.create", createMethod);      Method startMethod = thisClass.getMethod("start", parameterTypes);      operations[2] = new MBeanOperationInfo("The JBoss Service.start", startMethod);      Method stopMethod = thisClass.getMethod("stop", parameterTypes);      operations[3] = new MBeanOperationInfo("The JBoss Service.stop", startMethod);      Method destroyMethod = thisClass.getMethod("destroy", parameterTypes);      operations[4] = new MBeanOperationInfo("The JBoss Service.destroy", startMethod);      return name;   }// --- Begin ServiceMBeanSupport overides   protected void createService() throws Exception   {      log.info("Notified of create state");   }   protected void startService() throws Exception   {      log.info("Notified of start state");      InitialContext ctx = new InitialContext();      home = (EchoLocalHome) ctx.lookup(ejbJndiName);      log.info("Testing Echo");      EchoLocal bean = home.create();      String echo = bean.echo("startService");      log.info("echo(startService) = "+echo);   }   protected void stopService()   {      log.info("Notified of stop state");   }// --- End ServiceMBeanSupport overides   public String getHelloPrefix()   {      return helloPrefix;   }   public void setHelloPrefix(String helloPrefix)   {      this.helloPrefix = helloPrefix;   }   public String getEjbJndiName()   {      return ejbJndiName;   }   public void setEjbJndiName(String ejbJndiName)   {      this.ejbJndiName = ejbJndiName;   }   public String echo(String arg)      throws CreateException, NamingException   {      log.info("Lookup EchoLocalHome@"+ejbJndiName);      EchoLocal bean = home.create();      String echo = helloPrefix + bean.echo(arg);      return echo;   }// --- Begin DynamicMBean interface methods   /** Returns the management interface that describes this dynamic resource.    * It is the responsibility of the implementation to make sure the    * description is accurate.    *    * @return the management interface descriptor.    */   public MBeanInfo getMBeanInfo()   {      String classname = getClass().getName();      String description = "This is an MBean that uses a session bean in the"         + " implementation of its echo operation.";      MBeanConstructorInfo[] constructors = null;      MBeanNotificationInfo[] notifications = null;      MBeanInfo mbeanInfo = new MBeanInfo(classname, description, attributes,         constructors, operations, notifications);      // Log when this is called so we know when in the lifecycle this is used      Throwable trace = new Throwable("getMBeanInfo trace");      log.info("Don't panic, just a stack trace", trace);      return mbeanInfo;   }   /** Returns the value of the attribute with the name matching the    * passed string.    *    * @param attribute the name of the attribute.    * @return the value of the attribute.    * @exception AttributeNotFoundException when there is no such attribute.    * @exception MBeanException wraps any error thrown by the resource when    * getting the attribute.    * @exception ReflectionException wraps any error invoking the resource.    */   public Object getAttribute(String attribute)      throws AttributeNotFoundException, MBeanException, ReflectionException   {      Object value = null;      if( attribute.equals("HelloPrefix") )         value = getHelloPrefix();      else if( attribute.equals("EjbJndiName") )         value = getEjbJndiName();      else         throw new AttributeNotFoundException("Unknown attribute("+attribute+") requested");      return value;   }   /** Returns the values of the attributes with names matching the    * passed string array.    *    * @param attributes the names of the attribute.    * @return an {@link AttributeList AttributeList} of name and value pairs.    */   public AttributeList getAttributes(String[] attributes)   {      AttributeList values = new AttributeList();      for(int a = 0; a < attributes.length; a ++)      {         String name = attributes[a];         try         {            Object value = getAttribute(name);            Attribute attr = new Attribute(name, value);            values.add(attr);         }         catch(Exception e)         {            log.error("Failed to find attribute: "+name, e);         }      }      return values;   }   /** Sets the value of an attribute. The attribute and new value are    * passed in the name value pair {@link Attribute Attribute}.    *    * @see javax.management.Attribute    *    * @param attribute the name and new value of the attribute.    * @exception AttributeNotFoundException when there is no such attribute.    * @exception InvalidAttributeValueException when the new value cannot be    * converted to the type of the attribute.    * @exception MBeanException wraps any error thrown by the resource when    * setting the new value.    * @exception ReflectionException wraps any error invoking the resource.    */   public void setAttribute(Attribute attribute)      throws AttributeNotFoundException, InvalidAttributeValueException,      MBeanException, ReflectionException   {      String name = attribute.getName();      if( name.equals("HelloPrefix") )      {         String value = attribute.getValue().toString();         setHelloPrefix(value);      }      else if( name.equals("EjbJndiName") )      {         String value = attribute.getValue().toString();         setEjbJndiName(value);      }      else         throw new AttributeNotFoundException("Unknown attribute("+name+") requested");   }   /** Sets the values of the attributes passed as an    * {@link AttributeList AttributeList} of name and new value pairs.    *    * @param attributes the name an new value pairs.    * @return an {@link AttributeList AttributeList} of name and value pairs    * that were actually set.    */   public AttributeList setAttributes(AttributeList attributes)   {      AttributeList setAttributes = new AttributeList();      for(int a = 0; a < attributes.size(); a ++)      {         Attribute attr = (Attribute) attributes.get(a);         try         {            setAttribute(attr);            setAttributes.add(attr);         }         catch(Exception ignore)         {         }      }      return setAttributes;   }   /** Invokes a resource operation.    *    * @param actionName the name of the operation to perform.    * @param params the parameters to pass to the operation.    * @param signature the signartures of the parameters.    * @return the result of the operation.    * @exception MBeanException wraps any error thrown by the resource when    * performing the operation.    * @exception ReflectionException wraps any error invoking the resource.    */   public Object invoke(String actionName, Object[] params, String[] signature)      throws MBeanException, ReflectionException   {      Object rtnValue = null;      log.info("Begin invoke, actionName="+actionName);      try      {         if( actionName.equals("echo") )         {            String arg = (String) params[0];            rtnValue = echo(arg);            log.info("Result: "+rtnValue);         }         else if( actionName.equals("create") )         {            super.create();         }         else if( actionName.equals("start") )         {            super.start();         }         else if( actionName.equals("stop") )         {            super.stop();         }         else if( actionName.equals("destroy") )         {            super.destroy();         }         else         {            throw new JMRuntimeException("Invalid state, don't know about op="+actionName);         }      }      catch(Exception e)      {         throw new ReflectionException(e, "echo failed");      }      log.info("End invoke, actionName="+actionName);      return rtnValue;   }// --- End DynamicMBean interface methods}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜臀久久久久久久| 欧美日韩亚洲综合在线| 欧美亚洲一区三区| 国产日韩三级在线| 日本麻豆一区二区三区视频| 福利一区在线观看| 欧美日产国产精品| 亚洲欧美另类图片小说| 免费高清成人在线| 欧美日韩精品欧美日韩精品一综合| 精品国产露脸精彩对白| 一级日本不卡的影视| 国产一区二区三区高清播放| 91成人在线观看喷潮| 国产欧美中文在线| 美女高潮久久久| 欧美美女bb生活片| 一区二区三区在线视频免费观看| 国产在线国偷精品产拍免费yy| 精品视频一区二区三区免费| 亚洲欧洲成人自拍| 高清免费成人av| 亚洲精品在线网站| 精品一区二区在线免费观看| 欧美人伦禁忌dvd放荡欲情| 18成人在线观看| av成人免费在线观看| 欧美经典一区二区三区| 久久97超碰色| 日韩欧美电影一区| 久久99精品一区二区三区三区| 91精品国产高清一区二区三区蜜臀| 亚洲永久免费视频| 欧美影院精品一区| 亚洲已满18点击进入久久| 色噜噜偷拍精品综合在线| 一级日本不卡的影视| 欧洲精品在线观看| 亚洲国产精品久久久久秋霞影院| 色系网站成人免费| 亚洲福利电影网| 在线电影欧美成精品| 蜜桃一区二区三区四区| 精品毛片乱码1区2区3区| 国产精品亚洲视频| 综合激情成人伊人| 欧洲在线/亚洲| 午夜av一区二区三区| 欧美一区午夜视频在线观看 | 久久99热99| 久久久久久免费| 东方欧美亚洲色图在线| 1024成人网| 欧美精选一区二区| 国产成人a级片| 日韩美女啊v在线免费观看| 日本韩国一区二区| 蜜桃av噜噜一区| 国产精品久久二区二区| 色就色 综合激情| 蜜桃视频一区二区| 国产欧美日韩在线看| 日本道精品一区二区三区| 麻豆精品一区二区av白丝在线| 久久久久久麻豆| 欧美午夜精品电影| 国产大陆a不卡| 天天射综合影视| 国产欧美日韩综合精品一区二区 | 综合亚洲深深色噜噜狠狠网站| 日本精品一区二区三区四区的功能| 亚洲国产精品一区二区www| 久久亚洲一级片| 欧洲激情一区二区| 国产一区二区三区在线观看精品| 成人免费一区二区三区视频| 91麻豆精品91久久久久同性| 国产91色综合久久免费分享| 亚洲国产欧美在线人成| 欧美国产视频在线| 欧美一区二区二区| 91国产成人在线| 国产一区二区三区在线观看免费| 亚洲自拍偷拍图区| 中文字幕亚洲成人| 精品国产不卡一区二区三区| 色乱码一区二区三区88| 国产高清在线精品| 免费观看成人av| 亚洲va欧美va国产va天堂影院| 久久久精品综合| 51精品国自产在线| 91福利国产成人精品照片| 国产精品一区二区在线播放| 亚洲国产sm捆绑调教视频| 国产精品久久久久久久久搜平片 | 成人精品一区二区三区中文字幕| 日精品一区二区| 亚洲欧美电影一区二区| 国产欧美日韩麻豆91| 日韩视频一区二区三区| 欧美在线短视频| 91蝌蚪porny九色| 成人性视频免费网站| 国产高清久久久| 国产乱码一区二区三区| 免费视频最近日韩| 免费成人深夜小野草| 日韩av在线播放中文字幕| 婷婷开心激情综合| 日韩电影一区二区三区四区| 丝袜亚洲另类欧美综合| 一区二区成人在线| 亚洲国产欧美在线| 性欧美大战久久久久久久久| 一区二区三区丝袜| 亚洲电影第三页| 亚洲地区一二三色| 婷婷夜色潮精品综合在线| 亚洲国产aⅴ天堂久久| 天天av天天翘天天综合网| 肉丝袜脚交视频一区二区| 午夜日韩在线电影| 日本欧美一区二区在线观看| 免费xxxx性欧美18vr| 韩国精品在线观看| 成人午夜电影久久影院| 99视频精品免费视频| 欧美午夜精品一区二区蜜桃| 欧美日韩国产片| 日韩欧美成人一区| 国产亚洲短视频| 国产精品久久二区二区| 一区二区三区**美女毛片| 亚洲丶国产丶欧美一区二区三区| 日欧美一区二区| 国产成人激情av| 欧洲生活片亚洲生活在线观看| 69堂国产成人免费视频| 国产亚洲综合性久久久影院| 中文字幕在线不卡视频| 亚洲二区视频在线| 国内精品伊人久久久久av一坑| 国产激情精品久久久第一区二区| a4yy欧美一区二区三区| 欧美在线高清视频| 国产亚洲成aⅴ人片在线观看| 亚洲视频中文字幕| 免费成人在线播放| 91色九色蝌蚪| 欧美一级xxx| 亚洲欧美日本韩国| 极品少妇xxxx精品少妇偷拍| 99视频精品在线| 日韩欧美激情一区| 一区二区在线电影| 国产乱人伦偷精品视频免下载| 91视频你懂的| 精品久久人人做人人爰| 亚洲女女做受ⅹxx高潮| 精品系列免费在线观看| 91黄色免费看| 国产精品污www在线观看| 午夜精品国产更新| 波多野结衣91| 欧美成人国产一区二区| 一区二区欧美在线观看| 丁香五精品蜜臀久久久久99网站| 欧美日韩一区三区四区| 亚洲欧洲日产国产综合网| 男人的j进女人的j一区| 在线视频一区二区三区| 国产日本欧美一区二区| 秋霞影院一区二区| 色素色在线综合| 国产精品丝袜一区| 狠狠狠色丁香婷婷综合久久五月| 欧美色网站导航| 国产精品国产三级国产aⅴ中文| 老司机精品视频导航| 欧美在线视频你懂得| 中文字幕亚洲区| 成人免费看片app下载| 日韩欧美国产一区二区三区 | 粉嫩13p一区二区三区| 精品日韩一区二区| 奇米888四色在线精品| 欧美日韩国产电影| 亚洲国产成人高清精品| 色综合视频一区二区三区高清| 欧美激情综合在线| 国产成人高清在线| 国产欧美视频一区二区| 国产精品66部| 久久蜜桃av一区二区天堂| 蜜桃视频一区二区| 欧美成人精品福利| 久久国产精品第一页| 91精品欧美久久久久久动漫 | 欧美男人的天堂一二区|