📄 mejbwebservicebean.java
字号:
Object [] attrs = al.toArray(); System.out.println("Attributes retrieved for " + name); for ( int i=0; i<attrs.length; i++ ) { if ( attrs[i] instanceof Attribute ) { System.out.println("name = " + ((Attribute)attrs[i]).getName()); System.out.println("value = " + ((Attribute)attrs[i]).getValue()); } else { System.out.println("WARNING: AttributeList contains bad type: " + attrs[i]); } } return AttributeListSerializer.marshal(al); } else { System.out.println("WARINING: AttributeList for " + name + " is null"); } return null; } catch(Exception ex){ throw new RemoteException(this.toString() +"::getAttribute", ex); } } /** * Sets the value of a specific attribute of a named MBean. The MBean is identified by its object name. * @param name The name of the MBean within which the attribute is to be set. * @param attribute The identification of the attribute to be set and the value it is to be set to. * @return The value of the attribute that has been set. * @exception InstanceNotFoundException The MBean specified is not registered in the MBean server. * @exception AttributeNotFoundException The attribute specified is not accessible in the MBean. * @exception InvalidAttributeValueException The value specified for the attribute is not valid. * @exception MBeanException Wraps an exception thrown by the MBean's setter. * @exception ReflectionException Wraps a <CODE>java.lang.Exception</CODE> thrown when trying to invoke the setter. * @exception RuntimeOperationsException Wraps a <CODE>java.lang.IllegalArgumentException</CODE>: The object name in * parameter is null or the attribute in parameter is null. */ public void setAttribute(ObjectName name, javax.management.Attribute attribute) throws javax.management.InstanceNotFoundException, javax.management.AttributeNotFoundException, javax.management.InvalidAttributeValueException, MBeanException, javax.management.ReflectionException, RemoteException { this.mejbUtility.setAttribute(name,attribute); } /* WS version */ public void setAttribute(String name, String attributeName, String value) throws RemoteException { ObjectName n = null; Attribute a = null; try { n = new ObjectName(name); a = new Attribute(attributeName, value); setAttribute(n,a); } catch(Exception ex){ throw new RemoteException(this.toString() +"::setAttribute", ex); } } /** * Sets the values of several attributes of a named MBean. The MBean is identified by its object name. * @param name The object name of the MBean within which the attributes are to be set. * @param attributes A list of attributes: The identification of the * attributes to be set and the values they are to be set to. * @return The list of attributes that were set, with their new values. * @exception InstanceNotFoundException The MBean specified is not registered in the MBean server. * @exception ReflectionException An exception occurred when trying to invoke the getAttributes method of a Dynamic MBean. * @exception RuntimeOperationsException Wraps a <CODE>java.lang.IllegalArgumentException</CODE>: The object name in * parameter is null or attributes in parameter is null. */ public javax.management.AttributeList setAttributes(ObjectName name, javax.management.AttributeList attributes) throws javax.management.InstanceNotFoundException, javax.management.ReflectionException, RemoteException { return this.mejbUtility.setAttributes(name,attributes); } /* WS version */ public String setAttributes(String name, String xmlAttributeList) throws RemoteException { ObjectName n = null; AttributeList al = null; try { n = new ObjectName(name); al = AttributeListSerializer.unmarshal(xmlAttributeList); AttributeList newAtts = setAttributes(n,al); return AttributeListSerializer.marshal(newAtts); } catch(Exception ex){ throw new RemoteException(this.toString() +"::setAttributes", ex); } } /** * Invokes an operation on an MBean. * @param name The object name of the MBean on which the method is to be invoked. * @param operationName The name of the operation to be invoked. * @param params An array containing the parameters to be set when the operation is invoked * @param signature An array containing the signature of the operation. The class objects will * be loaded using the same class loader as the one used for loading the MBean on which the operation was invoked. * @return The object returned by the operation, which represents the result ofinvoking the operation * on the MBean specified. * @exception InstanceNotFoundException The MBean specified is not registered in the MBean server. * @exception MBeanException Wraps an exception thrown by the MBean's invoked method. * @exception ReflectionException Wraps a <CODE>java.lang.Exception</CODE> thrown while trying to invoke the method. */ public Object invoke(ObjectName name, String operationName, Object[] params, String[] signature) throws javax.management.InstanceNotFoundException, MBeanException, javax.management.ReflectionException, RemoteException { return this.mejbUtility.invoke(name,operationName,params,signature); } /* WS version */ public Object invoke(String name, String operationName, Set params, Set sig) throws InstanceNotFoundException, RemoteException { ObjectName n = null; try { n = new ObjectName(name); Object [] parameters = params.toArray(); String [] signature = (String [])sig.toArray(new String [] {}); return invoke(n,operationName,parameters,signature); } catch(Exception ex){ throw new RemoteException(this.toString() +"::invoke", ex); } } /** * Returns the default domain used for naming the managed object. * The default domain name is used as the domain part in the ObjectName * of managed objects if no domain is specified by the user. */ public String getDefaultDomain() throws RemoteException { return this.mejbUtility.getDefaultDomain(); } /* * returns the ListenerRegistry implementation for this MEJB */ public ListenerRegistration getListenerRegistry() throws RemoteException { return this.mejbUtility.getListenerRegistry(); } //called by AppContainer to register an AppClientModule MO if it wasn't registered during deployment public void registerAppClient(com.sun.enterprise.deployment.ApplicationClientDescriptor d) throws RemoteException, java.io.IOException { /* Hans, i Extracted MEJBUtility.class from appserv-rt.jar and did ajavap on the class and there is no method of this name or signature this.mejbUtility.registerAppClient(d); * *Compiled from MEJBUtility.javapublic class com.sun.enterprise.management.agent.MEJBUtility extends java.lang.Object { public static com.sun.enterprise.management.agent.MEJBUtility getMEJBUtility(); public java.util.Set queryNames(javax.management.ObjectName, javax.management.QueryExp) throws java.lang.Exception; public boolean isRegistered(javax.management.ObjectName) throws java.lang.Exception; public java.lang.Integer getMBeanCount() throws java.lang.Exception; public javax.management.MBeanInfo getMBeanInfo(javax.management.ObjectName)throws javax.management.InstanceNotFoundException, javax.management.IntrospectionException, javax.management.ReflectionException, java.rmi.RemoteException; public java.lang.Object getAttribute(javax.management.ObjectName, java.lang.String) throws javax.management.MBeanException, javax.management.AttributeNotFoundException, javax.management.InstanceNotFoundException, javax.management.ReflectionException, java.rmi.RemoteException; public javax.management.AttributeList getAttributes(javax.management.ObjectName, java.lang.String[]) throws javax.management.InstanceNotFoundException, javax.management.ReflectionException, java.rmi.RemoteException; public void setAttribute(javax.management.ObjectName, javax.management.Attribute) throws javax.management.InstanceNotFoundException, javax.management.AttributeNotFoundException, javax.management.InvalidAttributeValueException, javax.management.MBeanException, javax.management.ReflectionException, java.rmi.RemoteException; public javax.management.AttributeList setAttributes(javax.management.ObjectName, javax.management.AttributeList) throws javax.management.InstanceNotFoundException, javax.management.ReflectionException, java.rmi.RemoteException; public java.lang.Object invoke(javax.management.ObjectName, java.lang.String, java.lang.Object[], java.lang.String[]) throws javax.management.InstanceNotFoundException, javax.management.MBeanException, javax.management.ReflectionException, java.rmi.RemoteException; public java.lang.String getDefaultDomain(); public javax.management.j2ee.ListenerRegistration getListenerRegistry(); public java.lang.Object instantiate(java.lang.String) throws javax.management.ReflectionException, javax.management.MBeanException, java.rmi.RemoteException; public java.lang.Object instantiate(java.lang.String, javax.management.ObjectName) throws javax.management.ReflectionException, javax.management.MBeanException, javax.management.InstanceNotFoundException, java.rmi.RemoteException; public java.lang.Object instantiate(java.lang.String, java.lang.Object[], java.lang.String[]) throws javax.management.ReflectionException, javax.management.MBeanException, java.rmi.RemoteException; public java.lang.Object instantiate(java.lang.String, javax.management.ObjectName, java.lang.Object[], java.lang.String[]) throws javax.management.ReflectionException, javax.management.MBeanException, javax.management.InstanceNotFoundException, java.rmi.RemoteException; public javax.management.ObjectInstance createMBean(java.lang.String, javax.management.ObjectName) throws javax.management.ReflectionException, javax.management.InstanceAlreadyExistsException, javax.management.MBeanRegistrationException, javax.management.MBeanException, javax.management.NotCompliantMBeanException, java.rmi.RemoteException; * public javax.management.ObjectInstance createMBean(java.lang.String, javax.management.ObjectName, javax.management.ObjectName) throws javax.management.ReflectionException, javax.management.InstanceAlreadyExistsException, javax.management.MBeanRegistrationException, javax.management.MBeanException, javax.management.NotCompliantMBeanException, javax.management.InstanceNotFoundException, java.rmi.RemoteException; public javax.management.ObjectInstance createMBean(java.lang.String, javax.management.ObjectName, java.lang.Object[], java.lang.String[]) throws javax.management.ReflectionException, javax.management.InstanceAlreadyExistsException, javax.management.MBeanRegistrationException, javax.management.MBeanException, javax.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -