[jboss-cvs] JBossAS SVN: r85884 - projects/docs/enterprise/4.3.3/Server_Configuration_Guide/es-ES.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Mar 16 02:59:35 EDT 2009
Author: agarcia at jboss.com
Date: 2009-03-16 02:59:35 -0400 (Mon, 16 Mar 2009)
New Revision: 85884
Modified:
projects/docs/enterprise/4.3.3/Server_Configuration_Guide/es-ES/J2EE_Reference_Introduction.po
Log:
translation in progress
Modified: projects/docs/enterprise/4.3.3/Server_Configuration_Guide/es-ES/J2EE_Reference_Introduction.po
===================================================================
--- projects/docs/enterprise/4.3.3/Server_Configuration_Guide/es-ES/J2EE_Reference_Introduction.po 2009-03-16 06:49:00 UTC (rev 85883)
+++ projects/docs/enterprise/4.3.3/Server_Configuration_Guide/es-ES/J2EE_Reference_Introduction.po 2009-03-16 06:59:35 UTC (rev 85884)
@@ -8,7 +8,7 @@
"Project-Id-Version: J2EE_Reference_Introduction\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-01-20 02:37+0000\n"
-"PO-Revision-Date: 2009-03-13 16:02+1000\n"
+"PO-Revision-Date: 2009-03-16 16:41+1000\n"
"Last-Translator: Angela Garcia\n"
"Language-Team: <en at li.org>\n"
"MIME-Version: 1.0\n"
@@ -359,31 +359,31 @@
#: J2EE_Reference_Introduction.xml:146
#, no-c-format
msgid "MBean metadata classes"
-msgstr ""
+msgstr "Clases de metadatos MBean "
#. Tag: para
#: J2EE_Reference_Introduction.xml:151
#, no-c-format
msgid "The agent level components include:"
-msgstr ""
+msgstr "Los componentes a nivel de agente incluyen: "
#. Tag: para
#: J2EE_Reference_Introduction.xml:156
-#, fuzzy, no-c-format
+#, no-c-format
msgid "MBean server"
-msgstr "server"
+msgstr "Servidor MBean"
#. Tag: para
#: J2EE_Reference_Introduction.xml:161
#, no-c-format
msgid "Agent services"
-msgstr ""
+msgstr "Servicios agente"
#. Tag: title
#: J2EE_Reference_Introduction.xml:167
#, no-c-format
msgid "Managed Beans or MBeans"
-msgstr ""
+msgstr "Beans administradas o MBeans"
#. Tag: para
#: J2EE_Reference_Introduction.xml:168
@@ -393,43 +393,43 @@
"interfaces and follows the associated design patterns. The MBean for a "
"resource exposes all necessary information and operations that a management "
"application needs to control the resource."
-msgstr ""
+msgstr "Un MBean es un objeto Java que implementa una de las interfaces estandar MBean y sigue los patrones de siseño asociados. El MBean para un recurso expone toda la información y operaciones necesarias que una aplicacion de administración necesita para controlar el recurso."
#. Tag: para
#: J2EE_Reference_Introduction.xml:171
#, no-c-format
msgid "The scope of the management interface of an MBean includes the following:"
-msgstr ""
+msgstr "El ámbito de la interfaz de administración de un MBean incluye lo siguiente: "
#. Tag: para
#: J2EE_Reference_Introduction.xml:176
#, no-c-format
msgid "Attribute values that may be accessed by name"
-msgstr ""
+msgstr "Valores de atributos que se pueden acceder por nombre"
#. Tag: para
#: J2EE_Reference_Introduction.xml:181
#, no-c-format
msgid "Operations or functions that may be invoked"
-msgstr ""
+msgstr "Operaciones o funciones que pueden invocarse"
#. Tag: para
#: J2EE_Reference_Introduction.xml:186
#, no-c-format
msgid "Notifications or events that may be emitted"
-msgstr ""
+msgstr "Notificaciones o eventos que pueden emitirse"
#. Tag: para
#: J2EE_Reference_Introduction.xml:191
#, no-c-format
msgid "The constructors for the MBean's Java class"
-msgstr ""
+msgstr "Los constructores para la clase Java del MBean"
#. Tag: para
#: J2EE_Reference_Introduction.xml:196
#, no-c-format
msgid "JMX defines four types of MBeans to support different instrumentation needs:"
-msgstr ""
+msgstr "JMX define cuatro tipos de MBeans para soportar diferentes necesidades de instrumentación:"
#. Tag: para
#: J2EE_Reference_Introduction.xml:201
@@ -438,7 +438,7 @@
"<emphasis role=\"bold\">Standard MBeans</emphasis>: These use a simple "
"JavaBean style naming convention and a statically defined management "
"interface. This is the most common type of MBean used by JBoss."
-msgstr ""
+msgstr "<emphasis role=\"bold\">MBeans estándares</emphasis>: Estas utilizan una simple convención de nombrado de estilo JavaBean y una interfaz de administración definida estáticamente. Esyte es el tipo más común de MBean queJBoss utiliza."
#. Tag: para
#: J2EE_Reference_Introduction.xml:206
@@ -449,7 +449,7 @@
"their management interface at runtime when the component is instantiated for "
"the greatest flexibility. JBoss makes use of Dynamic MBeans in circumstances "
"where the components to be managed are not known until runtime."
-msgstr ""
+msgstr "<emphasis role=\"bold\">MBeans dinámicas</emphasis>: Estas deben implementar la interfaz <literal>javax.management.DynamicMBean</literal> y exponen su interfaz de administración en tiempo de ejecución cuando el componente es instanciado para mayor flexibilidad. JBoss utiliza MBeans dinámicas en casos en donde los componentes a ser administrados no se conocen hasta el momento de ejecución."
#. Tag: para
#: J2EE_Reference_Introduction.xml:211
@@ -458,7 +458,7 @@
"<emphasis role=\"bold\">Open MBeans</emphasis>: These are an extension of "
"dynamic MBeans. Open MBeans rely on basic, self-describing, user-friendly "
"data types for universal manageability."
-msgstr ""
+msgstr "<emphasis role=\"bold\">MBeans abiertos</emphasis>: Estos son una extensión de los MBeans dinámicos. Los MBeans abiertos dependen de tipos de datos básicos, auto-descriptivos, de fácil uso para administración universal."
#. Tag: para
#: J2EE_Reference_Introduction.xml:216
@@ -470,6 +470,8 @@
"instrumentation of resources by providing default behavior. JBoss XMBeans "
"are an implementation of Model MBeans."
msgstr ""
+"<emphasis role=\"bold\">MBeans modelos</emphasis>: Estos también son una extensión de los MBeans dinámicos. Los MBeans moldeos deben implementar la interfaz <literal>javax.management."
+"modelmbean.ModelMBean</literal>. Los MBeans modelos simplifican la instrumentación de recursos proporcionando el comportamiento predeterminado. Los XMBeans JBoss son una implementación de los MBeans modelos."
#. Tag: para
#: J2EE_Reference_Introduction.xml:221
@@ -477,13 +479,13 @@
msgid ""
"We will present an example of a Standard and a Model MBean in the section "
"that discusses extending JBoss with your own custom services."
-msgstr ""
+msgstr "Vamos a presentar un ejemplo de un MBean modelo y un estándar en la sección que discute la extensión de JBoss con sus propios servicios personalizados. "
#. Tag: title
#: J2EE_Reference_Introduction.xml:227
#, no-c-format
msgid "Notification Model"
-msgstr ""
+msgstr "Modelo de notificación"
#. Tag: para
#: J2EE_Reference_Introduction.xml:228
@@ -497,13 +499,13 @@
"<literal>NotificationListener</literal> event receiver interfaces. The "
"specification also defines the operations on the MBean server that allow for "
"the registration of notification listeners."
-msgstr ""
+msgstr "Las notificaciones JMX son una extensión del modelo de eventos Java. El servidor MBean y los MBeans pueden enviar notificaciones para propocionar información. La especificación JMX define el paquete <literal>javax.management</literal> y las interfaces de objeto de eventos <literal>Notification</literal>, remitente de eventos <literal>NotificationBroadcaster</literal> y recibidor de eventos <literal>NotificationListener</literal>. La especificación también define las operaciones en el servidor MBean que cuentan con la registración de escuchas de notificaciones."
#. Tag: title
#: J2EE_Reference_Introduction.xml:234
#, no-c-format
msgid "MBean Metadata Classes"
-msgstr ""
+msgstr "Clases de metadatos MBean"
#. Tag: para
#: J2EE_Reference_Introduction.xml:235
@@ -518,7 +520,7 @@
"example, one characteristic of an attribute is whether it is readable, "
"writable, or both. The metadata for an operation contains the signature of "
"its parameter and return types."
-msgstr ""
+msgstr "Hay una colección de clases de metadatos que describen la interfaz de administración de un MBean. Los usuarios pueden obtener una vista de los metadatos comunes de cualquiera de los cuatro tipos de MBean solicitándole al servidor MBean los MBeans que están registrados. Las clases de metadatos cubren los atributos, operaciones, notificaciones y constructores de un MBean. Para cada uno de estos, los metadatos incluyen un nombre, una descripción y sus características particulares. Por ejemplo, una característica de un atributo puede ser si es posible leerlo, escribir en él o ambos. Los metadatos para una operación contienen la firma de su parámetro y los tipos de retorno. "
#. Tag: para
#: J2EE_Reference_Introduction.xml:238
@@ -529,13 +531,13 @@
"the standard information available regardless of the type of MBean. A "
"management application that knows how to access the extended information of "
"a particular type of MBean is able to do so."
-msgstr ""
+msgstr "Los diferentes tipos de MBeans se extienden a las clases de metadatos para poder brindar información adicional cuando lo requiera. Esta herencia común hace disponible la información estándar sin importar el tipo de MBean. Una aplicación de administración que sabe cómo acceder a la información extendida de un tipo particular de MBean lo puede hacer. "
#. Tag: title
#: J2EE_Reference_Introduction.xml:244
#, no-c-format
msgid "MBean Server"
-msgstr ""
+msgstr "Servidor MBean"
#. Tag: para
#: J2EE_Reference_Introduction.xml:245
@@ -550,6 +552,8 @@
"available in the MBean server interface. This provides a loose coupling "
"between management applications and the MBeans they manage."
msgstr ""
+"Un componente clave del nivel agente es el servidor bean administrado. Su funcionalidad se expone por medio de una instancia del <literal>javax."
+"management.MBeanServer</literal>. Un servidor MBean es un registro para MBeans que hace disponible la interfaz de administración MBean para que las aplicaciones de administración las utilicen. El MBean nunca expone directamente el objeto MBean mismo sino que en su lugar su interfaz de administración se expone por medio de metadatos y operaciones disponibles en la interfaz del servidor MBean. Esto brinda un bajo acoplamiento entre las aplicaciones de administración y los MBeans que administran. "
#. Tag: para
#: J2EE_Reference_Introduction.xml:248
@@ -557,25 +561,25 @@
msgid ""
"MBeans can be instantiated and registered with the MBeanServer by the "
"following:"
-msgstr ""
+msgstr "Los MBeans se pueden instanciar y registrar con el MBeanServer por medio de los siguientes: "
#. Tag: para
#: J2EE_Reference_Introduction.xml:253
#, no-c-format
msgid "Another MBean"
-msgstr ""
+msgstr "Otro MBean"
#. Tag: para
#: J2EE_Reference_Introduction.xml:258
#, no-c-format
msgid "The agent itself"
-msgstr ""
+msgstr "El agente mismo"
#. Tag: para
#: J2EE_Reference_Introduction.xml:263
#, no-c-format
msgid "A remote management application (through the distributed services)"
-msgstr ""
+msgstr "Una aplicación de administración remota (por medio de los servicios distribuidos)"
#. Tag: para
#: J2EE_Reference_Introduction.xml:268
@@ -586,37 +590,37 @@
"identify the object on which to perform management operations. The "
"operations available on MBeans through the MBean server include the "
"following:"
-msgstr ""
+msgstr "Cuando registra un MBean, debe asignarle un nombre de objeto único. Luego el nombre de objeto se convierte en la única manera en que las aplicaciones de administración identifican el objeto en el cual realizar operaciones de administración. Las operaciones disponibles en MBeans por medio del servidor MBean incluyen las siguientes:"
#. Tag: para
#: J2EE_Reference_Introduction.xml:273
#, no-c-format
msgid "Discovering the management interface of MBeans"
-msgstr ""
+msgstr "Descubrimiento de la interfaz de administración de los MBeans"
#. Tag: para
#: J2EE_Reference_Introduction.xml:278
#, no-c-format
msgid "Reading and writing attribute values"
-msgstr ""
+msgstr "Lectura y escritura de valores de atributos "
#. Tag: para
#: J2EE_Reference_Introduction.xml:283
#, no-c-format
msgid "Invoking operations defined by MBeans"
-msgstr ""
+msgstr "Invocación de operaciones definidas por MBeans"
#. Tag: para
#: J2EE_Reference_Introduction.xml:288
#, no-c-format
msgid "Registering for notifications events"
-msgstr ""
+msgstr "Registro de eventos de notificaciones"
#. Tag: para
#: J2EE_Reference_Introduction.xml:293
#, no-c-format
msgid "Querying MBeans based on their object name or their attribute values"
-msgstr ""
+msgstr "Solicitud de MBeans con base en su nombre de objeto o sus valores de atributos"
#. Tag: para
#: J2EE_Reference_Introduction.xml:298
@@ -633,6 +637,9 @@
"versions of the specification will address the need for remote access "
"protocols in standard ways."
msgstr ""
+"Se requieren los conectores y adaptadores de protocolo para acceder al MBeanServer desde la MVJ del agente. Cada adaptador proporciona una vista por medio de su protocolo de todas los MBeans registrados en el servidor MBean al que el adaptador se conecta. Un adaptador de ejemplo es un adaptador HTML que permite la inspección y la modificación de MBeans utilizando un navegador. Como se indicó en <xref linkend="
+"\"An_Introduction_to_JMX-"
+"The_Relationship_between_the_components_of_the_JMX_architecture\"/>, no hay adaptadores de protocolo definidos por la especificación JMX actual. Las versiones posteriores de la especificación abordarán la necesidad de tener protocolos de acceso remoto de manera estándar. "
#. Tag: para
#: J2EE_Reference_Introduction.xml:301
@@ -645,7 +652,7 @@
"application to connect to an agent transparently through the network, "
"regardless of the protocol. The specification of the remote management "
"interface will be addressed in a future version of the JMX specification."
-msgstr ""
+msgstr "Un conector es una interfaz que las aplicaciones de administración utilizan para proporcionar una API común para acceder al servidor MBean de una manera independiente del protocolo de comunicación subyacente. Cada tipo de conector brinda la misma interfaz remota sobre un protocolo diferente. Esto le permite a una aplicación de administración remota el conectarse a un agente de manera transparente a través de la red sin importar el protocolo. La especificación de la interfaz de administración remota se abordará en una versión futura de la especificación JMX. "
#. Tag: para
#: J2EE_Reference_Introduction.xml:304
@@ -656,13 +663,13 @@
"its JVM, it must include at least one protocol adaptor or connector. JBoss "
"currently includes a custom HTML adaptor implementation and a custom JBoss "
"RMI adaptor."
-msgstr ""
+msgstr "Los adaptadores y los conectores hacen disponibles todas las operaciones del servidor MBean para una aplicación de administración remota. Para que un agente se administrable desde fuera de su MVJ, debe incluir por lo menos un conector o adaptador de protocolo. Actualmente JBoss incluye una implementación del adaptador HTML personalizado y un adaptador RMI JBoss personalizado. "
#. Tag: title
#: J2EE_Reference_Introduction.xml:310
-#, fuzzy, no-c-format
+#, no-c-format
msgid "Agent Services"
-msgstr "Servicios HTTP"
+msgstr "Servicios agente"
#. Tag: para
#: J2EE_Reference_Introduction.xml:311
@@ -674,7 +681,7 @@
"Agent services are often themselves MBeans, which allow the agent and their "
"functionality to be controlled through the MBean server. The JMX "
"specification defines the following agent services:"
-msgstr ""
+msgstr "Los servicios del agente JMX son objetos que soportan operaciones estándar en las MBeans registradas en el servidor MBean. La inclusión de los servicios de administración le ayuda a construir soluciones ad administración más poderosas. Con frecuencia los servicios agente son MBeans, lo cual le permite al servidor MBean controlar el agente y sus funcionalidades. La especificación JMX define los siguientes servicios agente: "
#. Tag: para
#: J2EE_Reference_Introduction.xml:316
@@ -683,7 +690,7 @@
"<emphasis role=\"bold\">A dynamic class loading MLet (management applet) "
"service</emphasis>: This allows for the retrieval and instantiation of new "
"classes and native libraries from an arbitrary network location."
-msgstr ""
+msgstr "<emphasis role=\"bold\">Un servicio MLet (del inglés management applet) de carga de clase dinámica</emphasis>: Le permite recuperar e instanciar nuevas clases y bibliotecas nativas de una ubicación de red arbitraria."
#. Tag: para
#: J2EE_Reference_Introduction.xml:321
@@ -692,7 +699,7 @@
"<emphasis role=\"bold\">Monitor services</emphasis>: These observe an MBean "
"attribute's numerical or string value, and can notify other objects of "
"several types of changes in the target."
-msgstr ""
+msgstr "<emphasis role=\"bold\">Servicios de monitoreo</emphasis>: Estos observan un valor numérico o de cadena del atributo MBean y pueden notificar otros objetos de varios tipos de cambios en el destino."
#. Tag: para
#: J2EE_Reference_Introduction.xml:326
@@ -701,7 +708,7 @@
"<emphasis role=\"bold\">Timer services</emphasis>: These provide a "
"scheduling mechanism based on a one-time alarm-clock notification or on a "
"repeated, periodic notification."
-msgstr ""
+msgstr "<emphasis role=\"bold\">Servicios temporizadores</emphasis>: Estos brindan un mecanismo de horario basado en una notificación de una alarma de un solo tiempo o de una notificación repetida y periódica."
#. Tag: para
#: J2EE_Reference_Introduction.xml:331
@@ -711,6 +718,8 @@
"defines associations between MBeans and enforces consistency on the "
"relationships."
msgstr ""
+"<emphasis role=\"bold\">El servicio de relación</emphasis>: Este servicio "
+"define asociaciones entre MBeans y refuerza la consistencia en las relaciones."
#. Tag: para
#: J2EE_Reference_Introduction.xml:336
@@ -718,19 +727,19 @@
msgid ""
"Any JMX-compliant implementation will provide all of these agent services. "
"However, JBoss does not rely on any of these standard agent services."
-msgstr ""
+msgstr "Cualquier implementación que cumpla con los requerimientos de JMX brindará todos estos servicios agentes. Sin embargo, JBoss no depende de ninguno de estos servicios agente estándares. "
#. Tag: title
#: J2EE_Reference_Introduction.xml:346
#, no-c-format
msgid "JBoss JMX Implementation Architecture"
-msgstr ""
+msgstr "Arquitectura de la implementación JMX JBoss"
#. Tag: title
#: J2EE_Reference_Introduction.xml:348
-#, fuzzy, no-c-format
+#, no-c-format
msgid "The JBoss ClassLoader Architecture"
-msgstr "Estructura del directorio de JBoss AS "
+msgstr "Arquitectura de cargador de clase de JBoss"
#. Tag: para
#: J2EE_Reference_Introduction.xml:349
@@ -741,13 +750,13 @@
"applications. Before discussing the JBoss specific class loading model, we "
"need to understand the nature of Java's type system and how class "
"loaders fit in."
-msgstr ""
+msgstr "JBoss emplea una arquitectura de carga de clase que facilita el compartir clases entre unidades de implementación y despliegue en vivo de servicios y aplicaciones. Antes de discutir el modelo de carga de clase especifico de JBoss, es necesario comprender la naturaleza del sistema de tipos de Java y la manera en que los cargadores de clase se integran. "
#. Tag: title
#: J2EE_Reference_Introduction.xml:355
#, no-c-format
msgid "Class Loading and Types in Java"
-msgstr ""
+msgstr "Carga de clase y tipos en Java"
#. Tag: para
#: J2EE_Reference_Introduction.xml:356
@@ -762,7 +771,7 @@
"class. This additional qualification of type is necessary to ensure that "
"environments in which classes may be loaded from arbitrary locations would "
"be type-safe."
-msgstr ""
+msgstr "La carga de clase es una parte fundamental de todas las arquitecturas de servidores. Los servicios arbitrarios y sus clases de soporte deben ser cargadas en el marco de trabajo del servidor. Esto puede llegar a ser problemático debido a la fuerte naturaleza de tipos de Java. La mayoría de los desarrolladores saben que el tipo de una clase en Java es una función del nombre completamente calificado de la clase. Sin embargo, el tipo también es una función del <literal>java.lang.ClassLoader</literal> que se utiliza para definir esa clase. La calificación adicional del tipo es necesario para asegurarse de que los entornos en los que las clases se pueden cargar desde ubicaciones arbitrarias son de tipo seguro. "
#. Tag: para
#: J2EE_Reference_Introduction.xml:359
@@ -773,13 +782,13 @@
"linkage errors and illegal access errors can show up in ways not seen in "
"more static class loading contexts. Let's take a look at the meaning of "
"each of these exceptions and how they can happen."
-msgstr ""
+msgstr "Sin embargo, en un entorno dinámico como un servidor de aplicaciones y especialmente JBoss con su soporte para despliegue en vivo pueden aparecer excepciones de clases, errores de enlaces y errores de acceso ilegal de maneras no vistas en contextos de carga de clase más estáticos. Veamos el significado de cada una de estas excepciones y la manera en que se pueden presentar."
#. Tag: title
#: J2EE_Reference_Introduction.xml:363
#, no-c-format
msgid "ClassCastExceptions - I'm Not Your Type"
-msgstr ""
+msgstr "ClassCastExceptions - I'm Not Your Type"
#. Tag: para
#: J2EE_Reference_Introduction.xml:364
@@ -790,6 +799,8 @@
"example is trying to obtain a <literal>String</literal> from a "
"<literal>List</literal> into which a <literal>URL</literal> was placed:"
msgstr ""
+"Se presenta una <literal>java.lang.ClassCastException</literal> cuando se intenta presentar una instancia en un tipo incompatible. Un ejemplo simple es el tratar de obtener un <literal>String</literal> de una "
+"<literal>List</literal> en la cual se puso una <literal>URL</literal>:"
#. Tag: programlisting
#: J2EE_Reference_Introduction.xml:367
@@ -802,6 +813,12 @@
"java.lang.ClassCastException: java.net.URL\n"
"at org.jboss.book.jmx.ex0.ExCCEa.main(Ex1CCE.java:16)"
msgstr ""
+"ArrayList array = new ArrayList();\n"
+"array.add(new URL(\"file:/tmp\"));\n"
+"String url = (String) array.get(0);\n"
+"\n"
+"java.lang.ClassCastException: java.net.URL\n"
+"at org.jboss.book.jmx.ex0.ExCCEa.main(Ex1CCE.java:16)"
#. Tag: para
#: J2EE_Reference_Introduction.xml:368
@@ -818,6 +835,10 @@
"The_ExCCEc_class_used_to_demonstrate_ClassCastException_due_to_duplicate_class_loaders"
"\"/>."
msgstr ""
+"La <literal>ClassCastException</literal> le dice que el intento de lanzar el elemento array a un <literal>String</literal> falló ya que el tipo real era <literal>URL</literal>. Sin embargo, no estamos interesados en este caso trivial. Considere el caso en que una JAR sea cargada por diferentes cargadores de clase. Aunque las clases cargadas por medio de cada cargador de clase son "
+"idénticas en términos del código byte, son tipos completamente diferentes de acuerdo a como lo ve el sistemas de tipos Java. Un ejemplo de esto es ilustrado por el código que aparece en <xref linkend=\"ClassCastExceptions___Im_Not_Your_Type-"
+"The_ExCCEc_class_used_to_demonstrate_ClassCastException_due_to_duplicate_class_loaders"
+"\"/>."
#. Tag: title
#: J2EE_Reference_Introduction.xml:371
@@ -825,7 +846,7 @@
msgid ""
"The ExCCEc class used to demonstrate ClassCastException due to duplicate "
"class loaders"
-msgstr ""
+msgstr "La clase ExCCEc que se utiliza para demostrar la ClassCastException debido a cargadores de clase duplicados"
#. Tag: programlisting
#: J2EE_Reference_Introduction.xml:372
@@ -896,12 +917,76 @@
" }\n"
"}"
msgstr ""
+"package org.jboss.book.jmx.ex0;\n"
+"\n"
+"import java.io.File;\n"
+"import java.net.URL;\n"
+"import java.net.URLClassLoader;\n"
+"import java.lang.reflect.Method;\n"
+"\n"
+"import org.apache.log4j.Logger;\n"
+"\n"
+"import org.jboss.util.ChapterExRepository;\n"
+"import org.jboss.util.Debug;\n"
+"\n"
+"/**\n"
+" * An example of a ClassCastException that\n"
+" * results from classes loaded through\n"
+" * different class loaders.\n"
+" * @author Scott.Stark at jboss.org\n"
+" * @version $Revision: 1.1 $\n"
+" */\n"
+"public class ExCCEc\n"
+"{\n"
+" public static void main(String[] args) throws Exception\n"
+" {\n"
+" ChapterExRepository.init(ExCCEc.class);\n"
+"\n"
+" String chapDir = System.getProperty(\"j2eechapter.dir\");\n"
+" Logger ucl0Log = Logger.getLogger(\"UCL0\");\n"
+" File jar0 = new File(chapDir+\"/j0.jar\");\n"
+" ucl0Log.info(\"jar0 path: \"+jar0.toString());\n"
+" URL[] cp0 = {jar0.toURL()};\n"
+" URLClassLoader ucl0 = new URLClassLoader(cp0);\n"
+" Thread.currentThread().setContextClassLoader(ucl0);\n"
+" Class objClass = ucl0.loadClass(\"org.jboss.book.jmx.ex0.ExObj\");\n"
+" StringBuffer buffer = new\n"
+" StringBuffer(\"ExObj Info\");\n"
+" Debug.displayClassInfo(objClass, buffer, false);\n"
+" ucl0Log.info(buffer.toString());\n"
+" Object value = objClass.newInstance();\n"
+" \n"
+" File jar1 = new File(chapDir+\"/j0.jar\");\n"
+" Logger ucl1Log = Logger.getLogger(\"UCL1\");\n"
+" ucl1Log.info(\"jar1 path: \"+jar1.toString());\n"
+" URL[] cp1 = {jar1.toURL()};\n"
+" URLClassLoader ucl1 = new URLClassLoader(cp1);\n"
+" Thread.currentThread().setContextClassLoader(ucl1);\n"
+" Class ctxClass2 = ucl1.loadClass(\"org.jboss.book.jmx.ex0.ExCtx\");\n"
+" buffer.setLength(0);\n"
+" buffer.append(\"ExCtx Info\");\n"
+" Debug.displayClassInfo(ctxClass2, buffer, false);\n"
+" ucl1Log.info(buffer.toString());\n"
+" Object ctx2 = ctxClass2.newInstance();\n"
+" \n"
+" try {\n"
+" Class[] types = {Object.class};\n"
+" Method useValue =\n"
+" ctxClass2.getMethod(\"useValue\", types);\n"
+" Object[] margs = {value};\n"
+" useValue.invoke(ctx2, margs);\n"
+" } catch(Exception e) {\n"
+" ucl1Log.error(\"Failed to invoke ExCtx.useValue\", e);\n"
+" throw e;\n"
+" }\n"
+" }\n"
+"}"
#. Tag: title
#: J2EE_Reference_Introduction.xml:373
#, no-c-format
msgid "The ExCtx, ExObj, and ExObj2 classes used by the examples"
-msgstr ""
+msgstr "Las clases ExCtx, ExObj y ExObj2 que los ejemplos utilizan"
#. Tag: programlisting
#: J2EE_Reference_Introduction.xml:374
@@ -966,6 +1051,64 @@
" }\n"
"}"
msgstr ""
+"package org.jboss.book.jmx.ex0;\n"
+"\n"
+"import java.io.IOException;\n"
+"import org.apache.log4j.Logger;\n"
+"import org.jboss.util.Debug;\n"
+"\n"
+"/**\n"
+" * A classes used to demonstrate various class\n"
+" * loading issues\n"
+" * @author Scott.Stark at jboss.org\n"
+" * @version $Revision: 1.1 $\n"
+" */\n"
+"public class ExCtx\n"
+"{\n"
+" ExObj value;\n"
+" \n"
+" public ExCtx() \n"
+" throws IOException\n"
+" {\n"
+" value = new ExObj();\n"
+" Logger log = Logger.getLogger(ExCtx.class);\n"
+" StringBuffer buffer = new StringBuffer(\"ctor.ExObj\");\n"
+" Debug.displayClassInfo(value.getClass(), buffer, false);\n"
+" log.info(buffer.toString());\n"
+" ExObj2 obj2 = value.ivar;\n"
+" buffer.setLength(0);\n"
+" buffer = new StringBuffer(\"ctor.ExObj.ivar\");\n"
+" Debug.displayClassInfo(obj2.getClass(), buffer, false);\n"
+" log.info(buffer.toString());\n"
+" }\n"
+"\n"
+" public Object getValue()\n"
+" {\n"
+" return value;\n"
+" }\n"
+"\n"
+" public void useValue(Object obj) \n"
+" throws Exception\n"
+" {\n"
+" Logger log = Logger.getLogger(ExCtx.class);\n"
+" StringBuffer buffer = new\n"
+" StringBuffer(\"useValue2.arg class\");\n"
+" Debug.displayClassInfo(obj.getClass(), buffer, false);\n"
+" log.info(buffer.toString());\n"
+" buffer.setLength(0);\n"
+" buffer.append(\"useValue2.ExObj class\");\n"
+" Debug.displayClassInfo(ExObj.class, buffer, false);\n"
+" log.info(buffer.toString());\n"
+" ExObj ex = (ExObj) obj;\n"
+" }\n"
+"\n"
+" void pkgUseValue(Object obj) \n"
+" throws Exception\n"
+" {\n"
+" Logger log = Logger.getLogger(ExCtx.class);\n"
+" log.info(\"In pkgUseValue\");\n"
+" }\n"
+"}"
#. Tag: programlisting
#: J2EE_Reference_Introduction.xml:375
@@ -985,6 +1128,19 @@
" public ExObj2 ivar = new ExObj2();\n"
"}"
msgstr ""
+"package org.jboss.book.jmx.ex0;\n"
+"\n"
+"import java.io.Serializable;\n"
+"\n"
+"/**\n"
+" * @author Scott.Stark at jboss.org\n"
+" * @version $Revision: 1.1 $\n"
+" */\n"
+"public class ExObj\n"
+" implements Serializable\n"
+"{\n"
+" public ExObj2 ivar = new ExObj2();\n"
+"}"
#. Tag: programlisting
#: J2EE_Reference_Introduction.xml:376
@@ -1003,6 +1159,18 @@
"{\n"
"}"
msgstr ""
+"package org.jboss.book.jmx.ex0;\n"
+"\n"
+"import java.io.Serializable;\n"
+"\n"
+"/**\n"
+" * @author Scott.Stark at jboss.org\n"
+" * @version $Revision: 1.1 $\n"
+" */\n"
+"public class ExObj2 \n"
+" implements Serializable\n"
+"{\n"
+"}"
#. Tag: para
#: J2EE_Reference_Introduction.xml:377
@@ -1013,7 +1181,7 @@
"and <literal>ucl1</literal> from the application class loader. Both are "
"setup to load classes from the <literal>output/jmx/j0.jar</literal>, the "
"contents of which are:"
-msgstr ""
+msgstr "El método <literal>ExCCEc.main</literal> utiliza la reflección para aislar las clases que los cargadores de clase <literal>ucl0</literal> y <literal>ucl1</literal> están cargando desde el cargador de clase de la aplicación. Ambos están configurados para cargar clases de <literal>output/jmx/j0.jar</literal>, el contenido de este es:"
#. Tag: programlisting
#: J2EE_Reference_Introduction.xml:380
@@ -1025,6 +1193,11 @@
"org/jboss/book/jmx/ex0/ExObj.class\n"
"org/jboss/book/jmx/ex0/ExObj2.class"
msgstr ""
+"[examples]$ jar -tf output/jmx/j0.jar\n"
+"...\n"
+"org/jboss/book/jmx/ex0/ExCtx.class\n"
+"org/jboss/book/jmx/ex0/ExObj.class\n"
+"org/jboss/book/jmx/ex0/ExObj2.class"
#. Tag: para
#: J2EE_Reference_Introduction.xml:381
@@ -1036,6 +1209,8 @@
"examples accompanying the book, and then run the example from within the "
"examples directory using the following command:"
msgstr ""
+"Vamos a ejecutar un ejemplo que demuestras la manera en que se puede presentar una excepción cast de clase y luego vamos a ver el problema específico en el ejemplo. Consulte <xref "
+"linkend=\"Book_Example_Installation\"/> para obtener instrucciones sobre cómo instalar los ejemplos que acompañan el libro y luego ejecutar el ejemplo desde dentro del directorio de ejemplos utilizando el siguiente comando:"
#. Tag: programlisting
#: J2EE_Reference_Introduction.xml:384
@@ -1058,10 +1233,27 @@
" [java] at org.jboss.book.jmx.ex0.ExCtx.useValue(ExCtx.java:44)\n"
" [java] ... 5 more"
msgstr ""
+"[examples]$ ant -Dchap=jmx -Dex=0c run-example\n"
+"...\n"
+" [java] java.lang.reflect.InvocationTargetException\n"
+" [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native "
+"Method)\n"
+" [java] at sun.reflect.NativeMethodAccessorImpl.invoke"
+"(NativeMethodAccessorImpl.java:39)\n"
+" [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke"
+"(DelegatingMethodAccessorImpl\n"
+" .java:25)\n"
+" [java] at java.lang.reflect.Method.invoke(Method.java:585)\n"
+" [java] at org.jboss.book.jmx.ex0.ExCCEc.main(ExCCEc.java:58)\n"
+" [java] Caused by: java.lang.ClassCastException: org.jboss.book.jmx.ex0."
+"ExObj\n"
+" [java] at org.jboss.book.jmx.ex0.ExCtx.useValue(ExCtx.java:44)\n"
+" [java] ... 5 more"
#. Tag: para
#: J2EE_Reference_Introduction.xml:385
#, no-c-format
+#, fuzzy
msgid ""
"Only the exception is shown here. The full output can be found in the "
"<literal>logs/jmx-ex0c.log</literal> file. At line 55 of <literal>ExCCEc."
@@ -1075,6 +1267,17 @@
"file shown in <xref linkend=\"ClassCastExceptions___Im_Not_Your_Type-"
"The_jmx_ex0c.log_debugging_output_for_the_ExObj_classes_seen\"/>."
msgstr ""
+"Aquí solo se muestra la excepción. The full output can be found in the "
+"<literal>logs/jmx-ex0c.log</literal> file. At line 55 of <literal>ExCCEc."
+"java</literal> we are invoking <literal>ExcCCECtx.useValue(Object)</literal> "
+"on the instance loaded and created in lines 37-48 using <literal>ucl1</"
+"literal>. The <literal>ExObj</literal> passed in is the one loaded and "
+"created in lines 25-35 via <literal>ucl0</literal>. The exception results "
+"when the <literal>ExCtx.useValue</literal> code attempts to cast the "
+"argument passed in to a <literal>ExObj</literal>. To understand why this "
+"fails consider the debugging output from the <literal>jmx-ex0c.log</literal> "
+"file shown in <xref linkend=\"ClassCastExceptions___Im_Not_Your_Type-"
+"The_jmx_ex0c.log_debugging_output_for_the_ExObj_classes_seen\"/>."
#. Tag: title
#: J2EE_Reference_Introduction.xml:388
@@ -1113,6 +1316,32 @@
"++++ClassLoader: null\n"
"++++Null CodeSource"
msgstr ""
+"[INFO,UCL0] ExObj Info\n"
+"org.jboss.book.jmx.ex0.ExObj(f8968f).ClassLoader=java.net."
+"URLClassLoader at 2611a7\n"
+"..java.net.URLClassLoader at 2611a7\n"
+"....file:/Users/orb/proj/jboss/jboss-docs/jbossas/j2ee/examples/output/jmx/"
+"j0.jar\n"
+"++++CodeSource: (file:/Users/orb/proj/jboss/jboss-docs/jbossas/j2ee/examples/"
+"output/\n"
+" jmx/j0.jar <no signer certificates>)\n"
+"Implemented Interfaces:\n"
+"++interface java.io.Serializable(41b571)\n"
+"++++ClassLoader: null\n"
+"++++Null CodeSource\n"
+"[INFO,ExCtx] useValue2.ExObj class\n"
+"org.jboss.book.jmx.ex0.ExObj(bc8e1e).ClassLoader=java.net."
+"URLClassLoader at 6bd8ea\n"
+"..java.net.URLClassLoader at 6bd8ea\n"
+"....file:/Users/orb/proj/jboss/jboss-docs/jbossas/j2ee/examples/output/jmx/"
+"j0.jar\n"
+"++++CodeSource: (file:/Users/orb/proj/jboss/jboss-docs/jbossas/j2ee/examples/"
+"output/\n"
+" jmx/j0.jar <no signer certificates>)\n"
+"Implemented Interfaces:\n"
+"++interface java.io.Serializable(41b571)\n"
+"++++ClassLoader: null\n"
+"++++Null CodeSource"
#. Tag: para
#: J2EE_Reference_Introduction.xml:390
@@ -1251,6 +1480,61 @@
" }\n"
"}"
msgstr ""
+"package org.jboss.book.jmx.ex0;\n"
+"\n"
+"import java.io.File;\n"
+"import java.net.URL;\n"
+"import java.net.URLClassLoader;\n"
+"import java.lang.reflect.Method;\n"
+"\n"
+"import org.apache.log4j.Logger;\n"
+"\n"
+"import org.jboss.util.ChapterExRepository;\n"
+"import org.jboss.util.Debug;\n"
+"\n"
+"/**\n"
+" * An example of IllegalAccessExceptions due to\n"
+" * classes loaded by two class loaders.\n"
+" * @author Scott.Stark at jboss.org\n"
+" * @version $Revision: 1.1 $\n"
+" */\n"
+"public class ExIAEd\n"
+"{\n"
+" public static void main(String[] args) throws Exception\n"
+" {\n"
+" ChapterExRepository.init(ExIAEd.class);\n"
+"\n"
+" String chapDir = System.getProperty(\"j2eechapter.dir\");\n"
+" Logger ucl0Log = Logger.getLogger(\"UCL0\");\n"
+" File jar0 = new File(chapDir+\"/j0.jar\");\n"
+" ucl0Log.info(\"jar0 path: \"+jar0.toString());\n"
+" URL[] cp0 = {jar0.toURL()};\n"
+" URLClassLoader ucl0 = new URLClassLoader(cp0);\n"
+" Thread.currentThread().setContextClassLoader(ucl0);\n"
+" \n"
+" StringBuffer buffer = new\n"
+" StringBuffer(\"ExIAEd Info\");\n"
+" Debug.displayClassInfo(ExIAEd.class, buffer, false);\n"
+" ucl0Log.info(buffer.toString());\n"
+" \n"
+" Class ctxClass1 = ucl0.loadClass(\"org.jboss.book.jmx.ex0.ExCtx\");\n"
+" buffer.setLength(0);\n"
+" buffer.append(\"ExCtx Info\");\n"
+" Debug.displayClassInfo(ctxClass1, buffer, false);\n"
+" ucl0Log.info(buffer.toString());\n"
+" Object ctx0 = ctxClass1.newInstance();\n"
+"\n"
+" try {\n"
+" Class[] types = {Object.class};\n"
+" Method useValue =\n"
+" ctxClass1.getDeclaredMethod(\"pkgUseValue\", types);\n"
+" Object[] margs = {null};\n"
+" useValue.invoke(ctx0, margs);\n"
+" } catch(Exception e) {\n"
+" ucl0Log.error(\"Failed to invoke ExCtx.pkgUseValue\", e);\n"
+" }\n"
+" }\n"
+"}"
#. Tag: para
#: J2EE_Reference_Introduction.xml:408
@@ -1279,6 +1563,16 @@
"[java] at java.lang.reflect.Method.invoke(Method.java:578)\n"
"[java] at org.jboss.book.jmx.ex0.ExIAEd.main(ExIAEd.java:48)"
msgstr ""
+"[examples]$ ant -Dchap=jmx -Dex=0d run-example\n"
+"Buildfile: build.xml\n"
+"...\n"
+"[java] java.lang.IllegalAccessException: Class org.jboss.book.jmx.ex0."
+"ExIAEd \n"
+" can not access a member of class org.jboss.book.jmx.ex0.ExCtx with "
+"modifiers \"\"\n"
+"[java] at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)\n"
+"[java] at java.lang.reflect.Method.invoke(Method.java:578)\n"
+"[java] at org.jboss.book.jmx.ex0.ExIAEd.main(ExIAEd.java:48)"
#. Tag: para
#: J2EE_Reference_Introduction.xml:412
@@ -1313,6 +1607,16 @@
"..java.net.URLClassLoader at 5d88a\n"
"..."
msgstr ""
+"[INFO,UCL0] ExIAEd Info\n"
+"org.jboss.book.jmx.ex0.ExIAEd(7808b9).ClassLoader=sun.misc.Launcher"
+"$AppClassLoader at a9c85c\n"
+"..sun.misc.Launcher$AppClassLoader at a9c85c\n"
+"...\n"
+"[INFO,UCL0] ExCtx Info\n"
+"org.jboss.book.jmx.ex0.ExCtx(64c34e).ClassLoader=java.net."
+"URLClassLoader at a9c85c\n"
+"..java.net.URLClassLoader at 5d88a\n"
+"..."
#. Tag: para
#: J2EE_Reference_Introduction.xml:416
@@ -1408,6 +1712,13 @@
" }\n"
"}"
msgstr ""
+"class <C,L1> {\n"
+" void f() {\n"
+" <Spoofed, L1><superscript>L1</superscript>x = <Delegated, "
+"L2><superscript>L2</superscript>\n"
+" x.secret_value = 1; // Should not be allowed\n"
+" }\n"
+"}"
#. Tag: programlisting
#: J2EE_Reference_Introduction.xml:434
@@ -1418,6 +1729,10 @@
" }\n"
"}"
msgstr ""
+"class <Delegated,L2> {\n"
+" static <Spoofed, L2><superscript>L3</superscript> g() {...}\n"
+" }\n"
+"}"
#. Tag: programlisting
#: J2EE_Reference_Introduction.xml:435
@@ -1427,6 +1742,9 @@
" public int secret_value;\n"
"}"
msgstr ""
+"class <Spoofed, L1> {\n"
+" public int secret_value;\n"
+"}"
#. Tag: programlisting
#: J2EE_Reference_Introduction.xml:436
@@ -1436,6 +1754,9 @@
" private int secret_value;\n"
"}"
msgstr ""
+"class <Spoofed, L2> {\n"
+" private int secret_value;\n"
+"}"
#. Tag: para
#: J2EE_Reference_Introduction.xml:437
@@ -1576,6 +1897,70 @@
" }\n"
"}"
msgstr ""
+"package org.jboss.book.jmx.ex0;\n"
+"import java.io.File;\n"
+"import java.net.URL;\n"
+"\n"
+"import org.apache.log4j.Logger;\n"
+"import org.jboss.util.ChapterExRepository;\n"
+"import org.jboss.util.Debug;\n"
+"\n"
+"/** \n"
+" * An example of a LinkageError due to classes being defined by more\n"
+" * than one class loader in a non-standard class loading environment.\n"
+" *\n"
+" * @author Scott.Stark at jboss.orgn\n"
+" * @version $Revision: 1.1 $\n"
+" */\n"
+"public class ExLE\n"
+"{\n"
+" public static void main(String[] args) \n"
+" throws Exception\n"
+" {\n"
+" ChapterExRepository.init(ExLE.class);\n"
+"\n"
+" String chapDir = System.getProperty(\"j2eechapter.dir\");\n"
+" Logger ucl0Log = Logger.getLogger(\"UCL0\");\n"
+" File jar0 = new File(chapDir+\"/j0.jar\");\n"
+" ucl0Log.info(\"jar0 path: \"+jar0.toString());\n"
+" URL[] cp0 = {jar0.toURL()};\n"
+" Ex0URLClassLoader ucl0 = new Ex0URLClassLoader(cp0);\n"
+" Thread.currentThread().setContextClassLoader(ucl0);\n"
+" <emphasis role=\"bold\">Class ctxClass1 = ucl0.loadClass(\"org.jboss."
+"book.jmx.ex0.ExCtx\");</emphasis>\n"
+" <emphasis role=\"bold\">Class obj2Class1 = ucl0.loadClass(\"org."
+"jboss.book.jmx.ex0.ExObj2\");</emphasis>\n"
+" StringBuffer buffer = new StringBuffer(\"ExCtx Info\");\n"
+" Debug.displayClassInfo(ctxClass1, buffer, false);\n"
+" ucl0Log.info(buffer.toString());\n"
+" buffer.setLength(0);\n"
+" buffer.append(\"ExObj2 Info, UCL0\");\n"
+" Debug.displayClassInfo(obj2Class1, buffer, false);\n"
+" ucl0Log.info(buffer.toString());\n"
+" \n"
+" File jar1 = new File(chapDir+\"/j1.jar\");\n"
+" Logger ucl1Log = Logger.getLogger(\"UCL1\");\n"
+" ucl1Log.info(\"jar1 path: \"+jar1.toString());\n"
+" URL[] cp1 = {jar1.toURL()};\n"
+" Ex0URLClassLoader ucl1 = new Ex0URLClassLoader(cp1);\n"
+" <emphasis role=\"bold\">Class obj2Class2 = ucl1.loadClass(\"org."
+"jboss.book.jmx.ex0.ExObj2\");</emphasis>\n"
+" buffer.setLength(0);\n"
+" buffer.append(\"ExObj2 Info, UCL1\");\n"
+" Debug.displayClassInfo(obj2Class2, buffer, false);\n"
+" ucl1Log.info(buffer.toString());\n"
+" \n"
+" <emphasis role=\"bold\">ucl0.setDelegate(ucl1);</emphasis>\n"
+" try {\n"
+" ucl0Log.info(\"Try ExCtx.newInstance()\");\n"
+" <emphasis role=\"bold\">Object ctx0 = ctxClass1.newInstance();</"
+"emphasis>\n"
+" ucl0Log.info(\"ExCtx.ctor succeeded, ctx0: \"+ctx0);\n"
+" } catch(Throwable e) {\n"
+" ucl0Log.error(\"ExCtx.ctor failed\", e);\n"
+" }\n"
+" }\n"
+"}"
#. Tag: programlisting
#: J2EE_Reference_Introduction.xml:448
@@ -1643,6 +2028,67 @@
" }\n"
"}"
msgstr ""
+"package org.jboss.book.jmx.ex0;\n"
+"\n"
+"import java.net.URLClassLoader;\n"
+"import java.net.URL;\n"
+"\n"
+"import org.apache.log4j.Logger;\n"
+"\n"
+"/** \n"
+" * A custom class loader that overrides the standard parent delegation\n"
+" * model\n"
+" *\n"
+" * @author Scott.Stark at jboss.org\n"
+" * @version $Revision: 1.1 $\n"
+" */\n"
+"public class Ex0URLClassLoader extends URLClassLoader\n"
+"{\n"
+" private static Logger log = Logger.getLogger(Ex0URLClassLoader.class);\n"
+" private Ex0URLClassLoader delegate;\n"
+"\n"
+" public Ex0URLClassLoader(URL[] urls)\n"
+" {\n"
+" super(urls);\n"
+" }\n"
+" \n"
+" void setDelegate(Ex0URLClassLoader delegate)\n"
+" {\n"
+" this.delegate = delegate;\n"
+" }\n"
+" \n"
+" protected synchronized Class loadClass(String name, boolean resolve)\n"
+" throws ClassNotFoundException\n"
+" {\n"
+" Class clazz = null;\n"
+" if (delegate != null) {\n"
+" log.debug(Integer.toHexString(hashCode()) +\n"
+" \"; Asking delegate to loadClass: \" + name);\n"
+" clazz = delegate.loadClass(name, resolve);\n"
+" log.debug(Integer.toHexString(hashCode()) +\n"
+" \"; Delegate returned: \"+clazz);\n"
+" } else {\n"
+" log.debug(Integer.toHexString(hashCode()) + \n"
+" \"; Asking super to loadClass: \"+name);\n"
+" clazz = super.loadClass(name, resolve);\n"
+" log.debug(Integer.toHexString(hashCode()) + \n"
+" \"; Super returned: \"+clazz);\n"
+" }\n"
+" return clazz;\n"
+" }\n"
+"\n"
+" protected Class findClass(String name)\n"
+" throws ClassNotFoundException\n"
+" {\n"
+" Class clazz = null;\n"
+" log.debug(Integer.toHexString(hashCode()) + \n"
+" \"; Asking super to findClass: \"+name);\n"
+" clazz = super.findClass(name);\n"
+" log.debug(Integer.toHexString(hashCode()) + \n"
+" \"; Super returned: \"+clazz);\n"
+" return clazz;\n"
+" }\n"
+"}"
#. Tag: para
#: J2EE_Reference_Introduction.xml:449
@@ -1690,6 +2136,20 @@
" log.info(buffer.toString());\n"
"}"
msgstr ""
+"public ExCtx() \n"
+" throws IOException\n"
+"{\n"
+" value = new ExObj();\n"
+" Logger log = Logger.getLogger(ExCtx.class);\n"
+" StringBuffer buffer = new StringBuffer(\"ctor.ExObj\");\n"
+" Debug.displayClassInfo(value.getClass(), buffer, false);\n"
+" log.info(buffer.toString());\n"
+" ExObj2 obj2 = value.ivar;\n"
+" buffer.setLength(0);\n"
+" buffer = new StringBuffer(\"ctor.ExObj.ivar\");\n"
+" Debug.displayClassInfo(obj2.getClass(), buffer, false);\n"
+" log.info(buffer.toString());\n"
+"}"
#. Tag: para
#: J2EE_Reference_Introduction.xml:453
@@ -1749,6 +2209,25 @@
"[java] at java.lang.Class.newInstance(Class.java:303)\n"
"[java] at org.jboss.book.jmx.ex0.ExLE.main(ExLE.java:53)"
msgstr ""
+"[examples]$ ant -Dchap=jmx -Dex=0e run-example\n"
+"Buildfile: build.xml\n"
+"...\n"
+"[java] java.lang.LinkageError: loader constraints violated when linking \n"
+" org/jboss/book/jmx/ex0/ExObj2 class\n"
+"[java] at org.jboss.book.jmx.ex0.ExCtx.<init>(ExCtx.java:24)\n"
+"[java] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native "
+"Method)\n"
+"[java] at sun.reflect.NativeConstructorAccessorImpl.newInstance"
+"(NativeConstructorAccessor\n"
+" Impl.java:39) \n"
+"[java] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance"
+"(DelegatingConstructor\n"
+" AccessorImpl.java:27)\n"
+"[java] at java.lang.reflect.Constructor.newInstance(Constructor."
+"java:494)\n"
+"[java] at java.lang.Class.newInstance0(Class.java:350)\n"
+"[java] at java.lang.Class.newInstance(Class.java:303)\n"
+"[java] at org.jboss.book.jmx.ex0.ExLE.main(ExLE.java:53)"
#. Tag: para
#: J2EE_Reference_Introduction.xml:463
@@ -1818,6 +2297,38 @@
" results.append(\"\\n++++Null CodeSource\");\n"
"}"
msgstr ""
+"Class clazz =...;\n"
+"StringBuffer results = new StringBuffer();\n"
+"\n"
+"ClassLoader cl = clazz.getClassLoader();\n"
+"results.append(\"\\n\" + clazz.getName() + \"(\" + \n"
+" Integer.toHexString(clazz.hashCode()) + \").ClassLoader=\" + "
+"cl);\n"
+"ClassLoader parent = cl;\n"
+"\n"
+"while (parent != null) {\n"
+" results.append(\"\\n..\"+parent);\n"
+" URL[] urls = getClassLoaderURLs(parent);\n"
+"\n"
+" int length = urls != null ? urls.length : 0;\n"
+" for(int u = 0; u < length; u ++) {\n"
+" results.append(\"\\n....\"+urls[u]);\n"
+" }\n"
+"\n"
+" if (showParentClassLoaders == false) {\n"
+" break;\n"
+" }\n"
+" if (parent != null) {\n"
+" parent = parent.getParent();\n"
+" }\n"
+"}\n"
+"\n"
+"CodeSource clazzCS = clazz.getProtectionDomain().getCodeSource();\n"
+"if (clazzCS != null) {\n"
+" results.append(\"\\n++++CodeSource: \"+clazzCS);\n"
+"} else {\n"
+" results.append(\"\\n++++Null CodeSource\");\n"
+"}"
#. Tag: para
#: J2EE_Reference_Introduction.xml:473
@@ -1888,6 +2399,20 @@
" <appender-ref ref=\"UCL\"/>\n"
"</category>"
msgstr ""
+"<appender name=\"UCL\" class=\"org.apache.log4j.FileAppender\">\n"
+" <param name=\"File\" value=\"${jboss.server.home.dir}/log/ucl.log\"/"
+">\n"
+" <param name=\"Append\" value=\"false\"/>\n"
+" <layout class=\"org.apache.log4j.PatternLayout\">\n"
+" <param name=\"ConversionPattern\" value=\"[%r,%c{1},%t] %m%n\"/"
+">\n"
+" </layout>\n"
+"</appender>\n"
+" \n"
+"<category name=\"org.jboss.mx.loading\" additivity=\"false\">\n"
+" <priority value=\"TRACE\" class=\"org.jboss.logging.XLevel\"/>\n"
+" <appender-ref ref=\"UCL\"/>\n"
+"</category>"
#. Tag: para
#: J2EE_Reference_Introduction.xml:484
@@ -2047,6 +2572,14 @@
" url=file:/home/vrenish/jboss-eap-4.3/jboss-as/server/production/deploy/"
"jboss-messaging.sar/ ,addedOrder=12}]"
msgstr ""
+"[org.jboss.mx.loading.UnifiedClassLoader3 at 1950198{ \n"
+" url=null ,addedOrder=2}, \n"
+" org.jboss.mx.loading.UnifiedClassLoader3 at 89e2f1{\n"
+" url=file:/home/vrenish/jboss-eap-4.3/jboss-as/server/production/deploy/"
+"ejb3.deployer/ ,addedOrder=3},\n"
+" org.jboss.mx.loading.UnifiedClassLoader3 at 1555185{ \n"
+" url=file:/home/vrenish/jboss-eap-4.3/jboss-as/server/production/deploy/"
+"jboss-messaging.sar/ ,addedOrder=12}]"
#. Tag: para
#: J2EE_Reference_Introduction.xml:544
@@ -2087,6 +2620,16 @@
"----------> Parent Classloader:\n"
"java.net.FactoryURLClassLoader at 2f5dda"
msgstr ""
+"org.jboss.jmx.adaptor.html.HtmlAdaptorServlet Information\n"
+"Not loaded in repository cache\n"
+"\n"
+"\n"
+"### Instance0 via UCL: WebappClassLoader\n"
+" delegate: false\n"
+" repositories:\n"
+" /WEB-INF/classes/\n"
+"----------> Parent Classloader:\n"
+"java.net.FactoryURLClassLoader at 2f5dda"
#. Tag: para
#: J2EE_Reference_Introduction.xml:556
@@ -2139,6 +2682,10 @@
"repository>\n"
"</jboss-app>"
msgstr ""
+"<jboss-app>\n"
+" <loader-repository>some.dot.com:loader=webtest.ear</loader-"
+"repository>\n"
+"</jboss-app>"
#. Tag: para
#: J2EE_Reference_Introduction.xml:568
@@ -2375,7 +2922,7 @@
#: J2EE_Reference_Introduction.xml:683
#, no-c-format
msgid "Disadvantages include:"
-msgstr ""
+msgstr "Las desventajas incluyen:"
#. Tag: para
#: J2EE_Reference_Introduction.xml:688
@@ -2440,9 +2987,9 @@
#. Tag: title
#: J2EE_Reference_Introduction.xml:721
-#, fuzzy, no-c-format
+#, no-c-format
msgid "Descriptors"
-msgstr "Descripción"
+msgstr "Descriptores"
#. Tag: para
#: J2EE_Reference_Introduction.xml:722
@@ -2486,19 +3033,19 @@
#: J2EE_Reference_Introduction.xml:743
#, no-c-format
msgid "org.jboss.mx.interceptor.PersistenceInterceptor"
-msgstr ""
+msgstr "org.jboss.mx.interceptor.PersistenceInterceptor"
#. Tag: para
#: J2EE_Reference_Introduction.xml:748
#, no-c-format
msgid "org.jboss.mx.interceptor.MBeanAttributeInterceptor"
-msgstr ""
+msgstr "org.jboss.mx.interceptor.MBeanAttributeInterceptor"
#. Tag: para
#: J2EE_Reference_Introduction.xml:753
#, no-c-format
msgid "org.jboss.mx.interceptor.ObjectReferenceInterceptor"
-msgstr ""
+msgstr "org.jboss.mx.interceptor.ObjectReferenceInterceptor"
#. Tag: para
#: J2EE_Reference_Introduction.xml:758
@@ -3354,6 +3901,44 @@
" </security-role>\n"
"</web-app>"
msgstr ""
+"<?xml version=\"1.0\"?>\n"
+"<!DOCTYPE web-app PUBLIC\n"
+" \"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN\"\n"
+" \"http://java.sun.com/dtd/web-app_2_3.dtd\">\n"
+"<web-app>\n"
+" <!-- ... -->\n"
+" \n"
+" <!-- A security constraint that restricts access to the HTML JMX "
+"console\n"
+" to users with the role JBossAdmin. Edit the roles to what you want "
+"and\n"
+" uncomment the WEB-INF/jboss-web.xml/security-domain element to "
+"enable\n"
+" secured access to the HTML JMX console.\n"
+" -->\n"
+" <security-constraint>\n"
+" <web-resource-collection>\n"
+" <web-resource-name>HtmlAdaptor</web-resource-name>\n"
+" <description> An example security config that only allows "
+"users with\n"
+" the role JBossAdmin to access the HTML JMX console web\n"
+" application </description>\n"
+" <url-pattern>/*</url-pattern>\n"
+" <http-method>GET</http-method>\n"
+" <http-method>POST</http-method>\n"
+" </web-resource-collection>\n"
+" <auth-constraint>\n"
+" <role-name>JBossAdmin</role-name>\n"
+" </auth-constraint>\n"
+" </security-constraint>\n"
+" <login-config>\n"
+" <auth-method>BASIC</auth-method>\n"
+" <realm-name>JBoss JMX Console</realm-name>\n"
+" </login-config>\n"
+" <security-role>\n"
+" <role-name>JBossAdmin</role-name>\n"
+" </security-role>\n"
+"</web-app>"
#. Tag: title
#: J2EE_Reference_Introduction.xml:1179
@@ -3380,6 +3965,18 @@
" <security-domain>java:/jaas/jmx-console</security-domain>\n"
"</jboss-web>"
msgstr ""
+"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+"<!DOCTYPE jboss-web\n"
+" PUBLIC \"-//JBoss//DTD Web Application 2.3//EN\"\n"
+" \"http://www.jboss.org/j2ee/dtd/jboss-web_3_0.dtd\">\n"
+"<jboss-web>\n"
+" <!-- \n"
+" Uncomment the security-domain to enable security. You will\n"
+" need to edit the htmladaptor login configuration to setup the\n"
+" login modules used to authentication users. \n"
+" -->\n"
+" <security-domain>java:/jaas/jmx-console</security-domain>\n"
+"</jboss-web>"
#. Tag: para
#: J2EE_Reference_Introduction.xml:1181
@@ -3498,6 +4095,60 @@
" }\n"
"}"
msgstr ""
+"public class JMXBrowser\n"
+"{\n"
+" /**\n"
+" * @param args the command line arguments\n"
+" */\n"
+" public static void main(String[] args) throws Exception\n"
+" {\n"
+" InitialContext ic = new InitialContext();\n"
+" RMIAdaptor server = (RMIAdaptor) ic.lookup(\"jmx/invoker/RMIAdaptor"
+"\");\n"
+" \n"
+" // Get the MBeanInfo for the JNDIView MBean\n"
+" ObjectName name = new ObjectName(\"jboss:service=JNDIView\");\n"
+" MBeanInfo info = server.getMBeanInfo(name);\n"
+" System.out.println(\"JNDIView Class: \" + info.getClassName());\n"
+"\n"
+" MBeanOperationInfo[] opInfo = info.getOperations();\n"
+" System.out.println(\"JNDIView Operations: \");\n"
+" for(int o = 0; o < opInfo.length; o ++) {\n"
+" MBeanOperationInfo op = opInfo[o];\n"
+"\n"
+" String returnType = op.getReturnType();\n"
+" String opName = op.getName();\n"
+" System.out.print(\" + \" + returnType + \" \" + opName + "
+"\"(\");\n"
+"\n"
+" MBeanParameterInfo[] params = op.getSignature();\n"
+" for(int p = 0; p < params.length; p++) {\n"
+" MBeanParameterInfo paramInfo = params[p];\n"
+"\n"
+" String pname = paramInfo.getName();\n"
+" String type = paramInfo.getType();\n"
+"\n"
+" if (pname.equals(type)) {\n"
+" System.out.print(type);\n"
+" } else {\n"
+" System.out.print(type + \" \" + name);\n"
+" }\n"
+"\n"
+" if (p < params.length-1) {\n"
+" System.out.print(','); \n"
+" }\n"
+" }\n"
+" System.out.println(\")\");\n"
+" }\n"
+" \n"
+" // Invoke the list(boolean) op\n"
+" String[] sig = {\"boolean\"};\n"
+" Object[] opArgs = {Boolean.TRUE};\n"
+" Object result = server.invoke(name, \"list\", opArgs, sig);\n"
+"\n"
+" System.out.println(\"JNDIView.list(true) output:\\n\"+result);\n"
+" }\n"
+"}"
#. Tag: para
#: J2EE_Reference_Introduction.xml:1209
@@ -3623,6 +4274,117 @@
"Ref)\n"
" [java] </pre>"
msgstr ""
+"[examples]$ ant -Dchap=jmx -Dex=4 run-example\n"
+"...\n"
+" \n"
+"run-example4:\n"
+" [java] JNDIView Class: org.jboss.mx.modelmbean.XMBean\n"
+" [java] JNDIView Operations: \n"
+" [java] + java.lang.String list(boolean jboss:service=JNDIView)\n"
+" [java] + java.lang.String listXML()\n"
+" [java] + void create()\n"
+" [java] + void start()\n"
+" [java] + void stop()\n"
+" [java] + void destroy()\n"
+" [java] + void jbossInternalLifecycle(java.lang.String jboss:"
+"service=JNDIView)\n"
+" [java] + java.lang.String getName()\n"
+" [java] + int getState()\n"
+" [java] + java.lang.String getStateString()\n"
+" [java] JNDIView.list(true) output:\n"
+" [java] <h1>java: Namespace</h1>\n"
+" [java] <pre>\n"
+" [java] +- XAConnectionFactory (class: org.jboss.mq."
+"SpyXAConnectionFactory)\n"
+" [java] +- DefaultDS (class: javax.sql.DataSource)\n"
+" [java] +- SecurityProxyFactory (class: org.jboss.security."
+"SubjectSecurityProxyFactory)\n"
+" [java] +- DefaultJMSProvider (class: org.jboss.jms.jndi."
+"JNDIProviderAdapter)\n"
+" [java] +- comp (class: javax.naming.Context)\n"
+" [java] +- JmsXA (class: org.jboss.resource.adapter.jms."
+"JmsConnectionFactoryImpl)\n"
+" [java] +- ConnectionFactory (class: org.jboss.mq."
+"SpyConnectionFactory)\n"
+" [java] +- jaas (class: javax.naming.Context)\n"
+" [java] | +- JmsXARealm (class: org.jboss.security.plugins."
+"SecurityDomainContext)\n"
+" [java] | +- jbossmq (class: org.jboss.security.plugins."
+"SecurityDomainContext)\n"
+" [java] | +- HsqlDbRealm (class: org.jboss.security.plugins."
+"SecurityDomainContext)\n"
+" [java] +- timedCacheFactory (class: javax.naming.Context)\n"
+" [java] Failed to lookup: timedCacheFactory, errmsg=null\n"
+" [java] +- TransactionPropagationContextExporter (class: org.jboss.tm."
+"TransactionPropag\n"
+"ationContextFactory)\n"
+" [java] +- StdJMSPool (class: org.jboss.jms.asf."
+"StdServerSessionPoolFactory)\n"
+" [java] +- Mail (class: javax.mail.Session)\n"
+" [java] +- TransactionPropagationContextImporter (class: org.jboss.tm."
+"TransactionPropag\n"
+"ationContextImporter)\n"
+" [java] +- TransactionManager (class: org.jboss.tm.TxManager)\n"
+" [java] </pre>\n"
+" [java] <h1>Global JNDI Namespace</h1>\n"
+" [java] <pre>\n"
+" [java] +- XAConnectionFactory (class: org.jboss.mq."
+"SpyXAConnectionFactory)\n"
+" [java] +- UIL2ConnectionFactory[link -> ConnectionFactory] (class: "
+"javax.naming.Lin\n"
+"kRef)\n"
+" [java] +- UserTransactionSessionFactory (proxy: $Proxy11 implements "
+"interface org.jbos\n"
+"s.tm.usertx.interfaces.UserTransactionSessionFactory)\n"
+" [java] +- HTTPConnectionFactory (class: org.jboss.mq."
+"SpyConnectionFactory)\n"
+" [java] +- console (class: org.jnp.interfaces.NamingContext)\n"
+" [java] | +- PluginManager (proxy: $Proxy36 implements interface org."
+"jboss.console.ma\n"
+"nager.PluginManagerMBean)\n"
+" [java] +- UIL2XAConnectionFactory[link -> XAConnectionFactory] "
+"(class: javax.naming\n"
+".LinkRef)\n"
+" [java] +- UUIDKeyGeneratorFactory (class: org.jboss.ejb.plugins."
+"keygenerator.uuid.UUID\n"
+"KeyGeneratorFactory)\n"
+" [java] +- HTTPXAConnectionFactory (class: org.jboss.mq."
+"SpyXAConnectionFactory)\n"
+" [java] +- topic (class: org.jnp.interfaces.NamingContext)\n"
+" [java] | +- testDurableTopic (class: org.jboss.mq.SpyTopic)\n"
+" [java] | +- testTopic (class: org.jboss.mq.SpyTopic)\n"
+" [java] | +- securedTopic (class: org.jboss.mq.SpyTopic)\n"
+" [java] +- queue (class: org.jnp.interfaces.NamingContext)\n"
+" [java] | +- A (class: org.jboss.mq.SpyQueue)\n"
+" [java] | +- testQueue (class: org.jboss.mq.SpyQueue)\n"
+" [java] | +- ex (class: org.jboss.mq.SpyQueue)\n"
+" [java] | +- DLQ (class: org.jboss.mq.SpyQueue)\n"
+" [java] | +- D (class: org.jboss.mq.SpyQueue)\n"
+" [java] | +- C (class: org.jboss.mq.SpyQueue)\n"
+" [java] | +- B (class: org.jboss.mq.SpyQueue)\n"
+" [java] +- ConnectionFactory (class: org.jboss.mq."
+"SpyConnectionFactory)\n"
+" [java] +- UserTransaction (class: org.jboss.tm.usertx.client."
+"ClientUserTransaction)\n"
+" [java] +- jmx (class: org.jnp.interfaces.NamingContext)\n"
+" [java] | +- invoker (class: org.jnp.interfaces.NamingContext)\n"
+" [java] | | +- RMIAdaptor (proxy: $Proxy35 implements interface "
+"org.jboss.jmx.adapt\n"
+"or.rmi.RMIAdaptor,interface org.jboss.jmx.adaptor.rmi.RMIAdaptorExt)\n"
+" [java] | +- rmi (class: org.jnp.interfaces.NamingContext)\n"
+" [java] | | +- RMIAdaptor[link -> jmx/invoker/RMIAdaptor] "
+"(class: javax.naming.L\n"
+"inkRef)\n"
+" [java] +- HiLoKeyGeneratorFactory (class: org.jboss.ejb.plugins."
+"keygenerator.hilo.HiLo\n"
+"KeyGeneratorFactory)\n"
+" [java] +- UILXAConnectionFactory[link -> XAConnectionFactory] "
+"(class: javax.naming.\n"
+"LinkRef)\n"
+" [java] +- UILConnectionFactory[link -> ConnectionFactory] (class: "
+"javax.naming.Link\n"
+"Ref)\n"
+" [java] </pre>"
#. Tag: title
#: J2EE_Reference_Introduction.xml:1216
@@ -3664,6 +4426,21 @@
" -a, --adapter=<name> The JNDI name of the RMI adapter to use\n"
" -q, --quiet Be somewhat more quiet"
msgstr ""
+"[bin]$ ./twiddle.sh -h\n"
+"A JMX client to 'twiddle' with a remote JBoss server.\n"
+"\n"
+"usage: twiddle.sh [options] <command> [command_arguments]\n"
+"\n"
+"options:\n"
+" -h, --help Show this help message\n"
+" --help-commands Show a list of commands\n"
+" -H=<command> Show command specific help\n"
+" -c=command.properties Specify the command.properties file to use\n"
+" -D<name>[=<value>] Set a system property\n"
+" -- Stop processing options\n"
+" -s, --server=<url> The JNDI URL of the remote server\n"
+" -a, --adapter=<name> The JNDI name of the RMI adapter to use\n"
+" -q, --quiet Be somewhat more quiet"
#. Tag: title
#: J2EE_Reference_Introduction.xml:1222
@@ -3689,6 +4466,8 @@
"[bin]$ ./twiddle.sh -s toki serverinfo -d jboss\n"
"[bin]$ ./twiddle.sh -s toki:1099 serverinfo -d jboss"
msgstr ""
+"[bin]$ ./twiddle.sh -s toki serverinfo -d jboss\n"
+"[bin]$ ./twiddle.sh -s toki:1099 serverinfo -d jboss"
#. Tag: para
#: J2EE_Reference_Introduction.xml:1227
@@ -3702,7 +4481,7 @@
#: J2EE_Reference_Introduction.xml:1230
#, no-c-format
msgid "[bin]$ ./twiddle.sh -s toki -a jmx/rmi/RMIAdaptor serverinfo -d jboss"
-msgstr ""
+msgstr "[bin]$ ./twiddle.sh -s toki -a jmx/rmi/RMIAdaptor serverinfo -d jboss"
#. Tag: title
#: J2EE_Reference_Introduction.xml:1234
@@ -3737,6 +4516,20 @@
"[bin]$ ./twiddle.sh --server=toki serverinfo --domain\n"
"jboss"
msgstr ""
+"[bin]$ ./twiddle.sh -H serverinfo\n"
+"Get information about the MBean server\n"
+"\n"
+"usage: serverinfo [options]\n"
+"\n"
+"options:\n"
+" -d, --domain Get the default domain\n"
+" -c, --count Get the MBean count\n"
+" -l, --list List the MBeans\n"
+" -- Stop processing options\n"
+"[bin]$ ./twiddle.sh --server=toki serverinfo --count\n"
+"460\n"
+"[bin]$ ./twiddle.sh --server=toki serverinfo --domain\n"
+"jboss"
#. Tag: para
#: J2EE_Reference_Introduction.xml:1239
@@ -3768,6 +4561,23 @@
"jboss:service=invoker,type=http\n"
"jboss:service=invoker,target=Naming,type=http"
msgstr ""
+"[bin]$ ./twiddle.sh -H query\n"
+"Query the server for a list of matching MBeans\n"
+"\n"
+"usage: query [options] <query>\n"
+"options:\n"
+" -c, --count Display the matching MBean count\n"
+" -- Stop processing options\n"
+"Examples:\n"
+" query all mbeans: query '*:*'\n"
+" query all mbeans in the jboss.j2ee domain: query 'jboss.j2ee:*'\n"
+"[bin]$ ./twiddle.sh -s toki query 'jboss:service=invoker,*'\n"
+"jboss:readonly=true,service=invoker,target=Naming,type=http\n"
+"jboss:service=invoker,type=jrmp\n"
+"jboss:service=invoker,type=local\n"
+"jboss:service=invoker,type=pooled\n"
+"jboss:service=invoker,type=http\n"
+"jboss:service=invoker,target=Naming,type=http"
#. Tag: para
#: J2EE_Reference_Introduction.xml:1243
@@ -3806,6 +4616,32 @@
"Name=JRMPInvoker\n"
"RMIClientSocketFactory=null"
msgstr ""
+"[bin]$ ./twiddle.sh -H get\n"
+"Get the values of one or more MBean attributes\n"
+"\n"
+"usage: get [options] <name> [<attr>+]\n"
+" If no attribute names are given all readable attributes are retrieved\n"
+"options:\n"
+" --noprefix Do not display attribute name prefixes\n"
+" -- Stop processing options\n"
+"[bin]$ ./twiddle.sh get jboss:service=invoker,type=jrmp RMIObjectPort "
+"StateString\n"
+"RMIObjectPort=4444\n"
+"StateString=Started\n"
+"[bin]$ ./twiddle.sh get jboss:service=invoker,type=jrmp\n"
+"ServerAddress=0.0.0.0\n"
+"RMIClientSocketFactoryBean=null\n"
+"StateString=Started\n"
+"State=3\n"
+"RMIServerSocketFactoryBean=org.jboss.net.sockets."
+"DefaultSocketFactory at ad093076\n"
+"EnableClassCaching=false\n"
+"SecurityDomain=null\n"
+"RMIServerSocketFactory=null\n"
+"Backlog=200\n"
+"RMIObjectPort=4444\n"
+"Name=JRMPInvoker\n"
+"RMIClientSocketFactory=null"
#. Tag: para
#: J2EE_Reference_Introduction.xml:1247
@@ -3867,6 +4703,55 @@
" void stop()\n"
" void destroy()"
msgstr ""
+"[bin]$ ./twiddle.sh -H info\n"
+"Get the metadata for an MBean\n"
+"\n"
+"usage: info <mbean-name>\n"
+" Use '*' to query for all attributes\n"
+"[bin]$ Description: Management Bean.\n"
+"+++ Attributes:\n"
+" Name: ServerAddress\n"
+" Type: java.lang.String\n"
+" Access: rw\n"
+" Name: RMIClientSocketFactoryBean\n"
+" Type: java.rmi.server.RMIClientSocketFactory\n"
+" Access: rw\n"
+" Name: StateString\n"
+" Type: java.lang.String\n"
+" Access: r-\n"
+" Name: State\n"
+" Type: int\n"
+" Access: r-\n"
+" Name: RMIServerSocketFactoryBean\n"
+" Type: java.rmi.server.RMIServerSocketFactory\n"
+" Access: rw\n"
+" Name: EnableClassCaching\n"
+" Type: boolean\n"
+" Access: rw\n"
+" Name: SecurityDomain\n"
+" Type: java.lang.String\n"
+" Access: rw\n"
+" Name: RMIServerSocketFactory\n"
+" Type: java.lang.String\n"
+" Access: rw\n"
+" Name: Backlog\n"
+" Type: int\n"
+" Access: rw\n"
+" Name: RMIObjectPort\n"
+" Type: int\n"
+" Access: rw\n"
+" Name: Name\n"
+" Type: java.lang.String\n"
+" Access: r-\n"
+" Name: RMIClientSocketFactory\n"
+" Type: java.lang.String\n"
+" Access: rw\n"
+"+++ Operations:\n"
+" void start()\n"
+" void jbossInternalLifecycle(java.lang.String java.lang.String)\n"
+" void create()\n"
+" void stop()\n"
+" void destroy()"
#. Tag: para
#: J2EE_Reference_Introduction.xml:1251
@@ -3970,6 +4855,97 @@
"LinkRef)\n"
"</pre>"
msgstr ""
+"[bin]$ ./twiddle.sh -H invoke\n"
+"Invoke an operation on an MBean\n"
+"\n"
+"usage: invoke [options] <query> <operation> (<arg>)*\n"
+"\n"
+"options:\n"
+" -q, --query-type[=<type>] Treat object name as a query\n"
+" -- Stop processing options\n"
+"\n"
+"query type:\n"
+" f[irst] Only invoke on the first matching name [default]\n"
+" a[ll] Invoke on all matching names\n"
+"[bin]$ ./twiddle.sh invoke jboss:service=JNDIView list true\n"
+"<h1>java: Namespace</h1>\n"
+"<pre>\n"
+" +- XAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)\n"
+" +- DefaultDS (class: javax.sql.DataSource)\n"
+" +- SecurityProxyFactory (class: org.jboss.security."
+"SubjectSecurityProxyFactory)\n"
+" +- DefaultJMSProvider (class: org.jboss.jms.jndi.JNDIProviderAdapter)\n"
+" +- comp (class: javax.naming.Context)\n"
+" +- JmsXA (class: org.jboss.resource.adapter.jms.JmsConnectionFactoryImpl)\n"
+" +- ConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)\n"
+" +- jaas (class: javax.naming.Context)\n"
+" | +- JmsXARealm (class: org.jboss.security.plugins."
+"SecurityDomainContext)\n"
+" | +- jbossmq (class: org.jboss.security.plugins.SecurityDomainContext)\n"
+" | +- HsqlDbRealm (class: org.jboss.security.plugins."
+"SecurityDomainContext)\n"
+" +- timedCacheFactory (class: javax.naming.Context)\n"
+"Failed to lookup: timedCacheFactory, errmsg=null\n"
+" +- TransactionPropagationContextExporter (class: org.jboss.tm."
+"TransactionPropagationContext\n"
+"Factory)\n"
+" +- StdJMSPool (class: org.jboss.jms.asf.StdServerSessionPoolFactory)\n"
+" +- Mail (class: javax.mail.Session)\n"
+" +- TransactionPropagationContextImporter (class: org.jboss.tm."
+"TransactionPropagationContext\n"
+"Importer)\n"
+" +- TransactionManager (class: org.jboss.tm.TxManager)\n"
+"</pre>\n"
+"<h1>Global JNDI Namespace</h1>\n"
+"<pre>\n"
+" +- XAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)\n"
+" +- UIL2ConnectionFactory[link -> ConnectionFactory] (class: javax."
+"naming.LinkRef)\n"
+" +- UserTransactionSessionFactory (proxy: $Proxy11 implements interface org."
+"jboss.tm.usertx.\n"
+"interfaces.UserTransactionSessionFactory)\n"
+" +- HTTPConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)\n"
+" +- console (class: org.jnp.interfaces.NamingContext)\n"
+" | +- PluginManager (proxy: $Proxy36 implements interface org.jboss."
+"console.manager.Plugin\n"
+"ManagerMBean)\n"
+" +- UIL2XAConnectionFactory[link -> XAConnectionFactory] (class: javax."
+"naming.LinkRef)\n"
+" +- UUIDKeyGeneratorFactory (class: org.jboss.ejb.plugins.keygenerator.uuid."
+"UUIDKeyGenerator\n"
+"Factory)\n"
+" +- HTTPXAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)\n"
+" +- topic (class: org.jnp.interfaces.NamingContext)\n"
+" | +- testDurableTopic (class: org.jboss.mq.SpyTopic)\n"
+" | +- testTopic (class: org.jboss.mq.SpyTopic)\n"
+" | +- securedTopic (class: org.jboss.mq.SpyTopic)\n"
+" +- queue (class: org.jnp.interfaces.NamingContext)\n"
+" | +- A (class: org.jboss.mq.SpyQueue)\n"
+" | +- testQueue (class: org.jboss.mq.SpyQueue)\n"
+" | +- ex (class: org.jboss.mq.SpyQueue)\n"
+" | +- DLQ (class: org.jboss.mq.SpyQueue)\n"
+" | +- D (class: org.jboss.mq.SpyQueue)\n"
+" | +- C (class: org.jboss.mq.SpyQueue)\n"
+" | +- B (class: org.jboss.mq.SpyQueue)\n"
+" +- ConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)\n"
+" +- UserTransaction (class: org.jboss.tm.usertx.client."
+"ClientUserTransaction)\n"
+" +- jmx (class: org.jnp.interfaces.NamingContext)\n"
+" | +- invoker (class: org.jnp.interfaces.NamingContext)\n"
+" | | +- RMIAdaptor (proxy: $Proxy35 implements interface org.jboss.jmx."
+"adaptor.rmi.RMIAd\n"
+"aptor,interface org.jboss.jmx.adaptor.rmi.RMIAdaptorExt)\n"
+" | +- rmi (class: org.jnp.interfaces.NamingContext)\n"
+" | | +- RMIAdaptor[link -> jmx/invoker/RMIAdaptor] (class: javax."
+"naming.LinkRef)\n"
+" +- HiLoKeyGeneratorFactory (class: org.jboss.ejb.plugins.keygenerator.hilo."
+"HiLoKeyGenerator\n"
+"Factory)\n"
+" +- UILXAConnectionFactory[link -> XAConnectionFactory] (class: javax."
+"naming.LinkRef)\n"
+" +- UILConnectionFactory[link -> ConnectionFactory] (class: javax.naming."
+"LinkRef)\n"
+"</pre>"
#. Tag: title
#: J2EE_Reference_Introduction.xml:1260
@@ -4588,6 +5564,14 @@
" public void destroy();\n"
"}"
msgstr ""
+"package org.jboss.system;\n"
+"public interface Service\n"
+"{\n"
+" public void create() throws Exception;\n"
+" public void start() throws Exception;\n"
+" public void stop();\n"
+" public void destroy();\n"
+"}"
#. Tag: para
#: J2EE_Reference_Introduction.xml:1529
@@ -4806,6 +5790,43 @@
" </depends-list>\n"
"</mbean>"
msgstr ""
+"<mbean code=\"org.jboss.mq.server.jmx.Topic\"\n"
+" name=\"jms.topic:service=Topic,name=testTopic\">\n"
+" <!-- Declare a dependency on the \"jboss.mq:service=DestinationManager"
+"\" and\n"
+" bind this name to the DestinationManager attribute -->\n"
+" <depends optional-attribute-name=\"DestinationManager\">\n"
+" jboss.mq:service=DestinationManager \n"
+" </depends>\n"
+"\n"
+" <!-- Declare a dependency on the \"jboss.mq:service=SecurityManager\" "
+"and\n"
+" bind this name to the SecurityManager attribute -->\n"
+" <depends optional-attribute-name=\"SecurityManager\">\n"
+" jboss.mq:service=SecurityManager\n"
+" </depends>\n"
+"\n"
+" <!-- ... -->\n"
+"\n"
+" <!-- Declare a dependency on the\n"
+" \"jboss.mq:service=CacheManager\" without\n"
+" any binding of the name to an attribute-->\n"
+" <depends>jboss.mq:service=CacheManager</depends>\n"
+"</mbean>\n"
+"\n"
+"<mbean code=\"org.jboss.mq.server.jmx.TopicMgr\" \n"
+" name=\"jboss.mq.destination:service=TopicMgr\">\n"
+" <!-- Declare a dependency on the given topic destination mbeans and\n"
+" bind these names to the Topics attribute -->\n"
+" <depends-list optional-attribute-name=\"Topics\">\n"
+" <depends-list-element>jms.topic:service=Topic,name=A</"
+"depends-list-element>\n"
+" <depends-list-element>jms.topic:service=Topic,name=B</"
+"depends-list-element>\n"
+" <depends-list-element>jms.topic:service=Topic,name=C</"
+"depends-list-element>\n"
+" </depends-list>\n"
+"</mbean>"
#. Tag: para
#: J2EE_Reference_Introduction.xml:1595
@@ -4875,6 +5896,39 @@
" <!-- ... -->\n"
"</mbean>"
msgstr ""
+"<mbean code=\"org.jboss.resource.connectionmanager."
+"LocalTxConnectionManager\" \n"
+" name=\"jboss.jca:service=LocalTxCM,name=hsqldbDS\">\n"
+" <depends optional-attribute-name=\"ManagedConnectionFactoryName"
+"\">\n"
+" <!--embedded mbean-->\n"
+" <mbean code=\"org.jboss.resource.connectionmanager.RARDeployment"
+"\" \n"
+" name=\"jboss.jca:service=LocalTxDS,name=hsqldbDS\">\n"
+" <attribute name=\"JndiName\">DefaultDS</attribute>\n"
+" <attribute name=\"ManagedConnectionFactoryProperties\">\n"
+" <properties>\n"
+" <config-property name=\"ConnectionURL\"\n"
+" type=\"java.lang.String\"> \n"
+" jdbc:hsqldb:hsql://localhost:1476\n"
+" </config-property>\n"
+" <config-property name=\"DriverClass\" type=\"java."
+"lang.String\">\n"
+" org.hsqldb.jdbcDriver\n"
+" </config-property>\n"
+" <config-property name=\"UserName\" type=\"java.lang."
+"String\">\n"
+" sa\n"
+" </config-property>\n"
+" <config-property name=\"Password\" type=\"java.lang."
+"String\"/>\n"
+" </properties>\n"
+" </attribute>\n"
+" <!-- ... -->\n"
+" </mbean>\n"
+" </depends>\n"
+" <!-- ... -->\n"
+"</mbean>"
#. Tag: title
#: J2EE_Reference_Introduction.xml:1604
@@ -5079,6 +6133,17 @@
"literal>\", \"<literal>TAGS</literal>\", \"<literal>core</literal>\", "
"\"<literal>tags</literal>\""
msgstr ""
+"\"<literal>#*</literal>\", \"<literal>%*</literal>\", \"<literal>,*</literal>"
+"\", \"<literal>.*</literal>\", \"<literal>_$*</literal>\", \"<literal>*#</"
+"literal>\", \"<literal>*$</literal>\", \"<literal>*%</literal>\", "
+"\"<literal>*.BAK</literal>\", \"<literal>*.old</literal>\", \"<literal>*."
+"orig</literal>\", \"<literal>*.rej</literal>\", \"<literal>*.bak</literal>"
+"\", \"<literal>*.sh</literal>\", \"<literal>*,v</literal>\", \"<literal>*~</"
+"literal>\", \"<literal>.make.state</literal>\", \"<literal>.nse_depinfo</"
+"literal>\", \"<literal>CVS</literal>\", \"<literal>CVS.admin</literal>\", "
+"\"<literal>RCS</literal>\", \"<literal>RCSLOG</literal>\", \"<literal>SCCS</"
+"literal>\", \"<literal>TAGS</literal>\", \"<literal>core</literal>\", "
+"\"<literal>tags</literal>\""
#. Tag: para
#: J2EE_Reference_Introduction.xml:1684
@@ -5238,6 +6303,18 @@
" public void stop() throws Exception;\n"
"}"
msgstr ""
+"package org.jboss.book.jmx.ex1;\n"
+" \n"
+"// The JNDIMap MBean interface\n"
+"import javax.naming.NamingException;\n"
+" \n"
+"public interface JNDIMapMBean\n"
+"{\n"
+" public String getJndiName();\n"
+" public void setJndiName(String jndiName) throws NamingException;\n"
+" public void start() throws Exception;\n"
+" public void stop() throws Exception;\n"
+"}"
#. Tag: programlisting
#: J2EE_Reference_Introduction.xml:1733
@@ -5311,6 +6388,73 @@
" }\n"
"}"
msgstr ""
+"package org.jboss.book.jmx.ex1;\n"
+"\n"
+"// The JNDIMap MBean implementation\n"
+"import java.util.HashMap;\n"
+"import javax.naming.InitialContext;\n"
+"import javax.naming.Name;\n"
+"import javax.naming.NamingException;\n"
+"import org.jboss.naming.NonSerializableFactory;\n"
+"\n"
+"public class JNDIMap implements JNDIMapMBean\n"
+"{\n"
+" private String jndiName;\n"
+" private HashMap contextMap = new HashMap();\n"
+" private boolean started;\n"
+" \n"
+" public String getJndiName()\n"
+" {\n"
+" return jndiName;\n"
+" }\n"
+" public void setJndiName(String jndiName) throws NamingException\n"
+" {\n"
+" String oldName = this.jndiName;\n"
+" this.jndiName = jndiName;\n"
+" if (started) {\n"
+" unbind(oldName);\n"
+" try {\n"
+" rebind();\n"
+" } catch(Exception e) {\n"
+" NamingException ne = new NamingException(\"Failedto update "
+"jndiName\");\n"
+" ne.setRootCause(e);\n"
+" throw ne;\n"
+" }\n"
+" }\n"
+" }\n"
+"\n"
+" public void start() throws Exception\n"
+" {\n"
+" started = true;\n"
+" rebind();\n"
+" }\n"
+" \n"
+" public void stop()\n"
+" {\n"
+" started = false;\n"
+" unbind(jndiName);\n"
+" }\n"
+" \n"
+" private void rebind() throws NamingException\n"
+" {\n"
+" InitialContext rootCtx = new InitialContext();\n"
+" Name fullName = rootCtx.getNameParser(\"\").parse(jndiName);\n"
+" System.out.println(\"fullName=\"+fullName);\n"
+" NonSerializableFactory.rebind(fullName, contextMap, true);\n"
+" }\n"
+"\n"
+" private void unbind(String jndiName)\n"
+" {\n"
+" try {\n"
+" InitialContext rootCtx = new InitialContext();\n"
+" rootCtx.unbind(jndiName);\n"
+" NonSerializableFactory.unbind(jndiName);\n"
+" } catch(NamingException e) {\n"
+" e.printStackTrace();\n"
+" }\n"
+" }\n"
+"}"
#. Tag: para
#: J2EE_Reference_Introduction.xml:1734
@@ -5357,6 +6501,16 @@
" public void setJndiName(String jndiName) throws NamingException;\n"
"}"
msgstr ""
+"package org.jboss.book.jmx.ex2;\n"
+"\n"
+"// The JNDIMap MBean interface\n"
+"import javax.naming.NamingException;\n"
+"\n"
+"public interface JNDIMapMBean extends org.jboss.system.ServiceMBean\n"
+"{\n"
+" public String getJndiName();\n"
+" public void setJndiName(String jndiName) throws NamingException;\n"
+"}"
#. Tag: programlisting
#: J2EE_Reference_Introduction.xml:1739
@@ -5429,6 +6583,72 @@
" }\n"
"}"
msgstr ""
+"package org.jboss.book.jmx.ex2;\n"
+"// The JNDIMap MBean implementation\n"
+"import java.util.HashMap;\n"
+"import javax.naming.InitialContext;\n"
+"import javax.naming.Name;\n"
+"import javax.naming.NamingException;\n"
+"import org.jboss.naming.NonSerializableFactory;\n"
+"\n"
+"public class JNDIMap extends org.jboss.system.ServiceMBeanSupport\n"
+" implements JNDIMapMBean\n"
+"{\n"
+" private String jndiName;\n"
+" private HashMap contextMap = new HashMap();\n"
+" \n"
+" public String getJndiName()\n"
+" {\n"
+" return jndiName;\n"
+" }\n"
+"\n"
+" public void setJndiName(String jndiName) \n"
+" throws NamingException\n"
+" {\n"
+" String oldName = this.jndiName;\n"
+" this.jndiName = jndiName;\n"
+" if (super.getState() == STARTED) {\n"
+" unbind(oldName);\n"
+" try {\n"
+" rebind();\n"
+" } catch(Exception e) {\n"
+" NamingException ne = new NamingException(\"Failed to update "
+"jndiName\");\n"
+" ne.setRootCause(e);\n"
+" throw ne;\n"
+" }\n"
+" }\n"
+" }\n"
+" \n"
+" public void startService() throws Exception\n"
+" {\n"
+" rebind();\n"
+" }\n"
+"\n"
+" public void stopService()\n"
+" {\n"
+" unbind(jndiName);\n"
+" }\n"
+" \n"
+" private void rebind() throws NamingException\n"
+" {\n"
+" InitialContext rootCtx = new InitialContext();\n"
+" Name fullName = rootCtx.getNameParser(\"\").parse(jndiName);\n"
+" log.info(\"fullName=\"+fullName);\n"
+" NonSerializableFactory.rebind(fullName, contextMap, true);\n"
+" }\n"
+"\n"
+" private void unbind(String jndiName)\n"
+" {\n"
+" try {\n"
+" InitialContext rootCtx = new InitialContext();\n"
+" rootCtx.unbind(jndiName);\n"
+" NonSerializableFactory.unbind(jndiName);\n"
+" } catch(NamingException e) {\n"
+" log.error(\"Failed to unbind map\", e);\n"
+" }\n"
+" }\n"
+"}"
#. Tag: para
#: J2EE_Reference_Introduction.xml:1740
@@ -5459,6 +6679,15 @@
" </mbean>\n"
"</server>"
msgstr ""
+"<!-- The SAR META-INF/jboss-service.xml descriptor -->\n"
+"<server>\n"
+" <mbean code=\"org.jboss.book.jmx.ex1.JNDIMap\" \n"
+" name=\"j2eechap2.ex1:service=JNDIMap\">\n"
+" <attribute name=\"JndiName\">inmemory/maps/MapTest</"
+"attribute>\n"
+" <depends>jboss:service=Naming</depends>\n"
+" </mbean>\n"
+"</server>"
#. Tag: para
#: J2EE_Reference_Introduction.xml:1747
@@ -5479,6 +6708,9 @@
"InitialContext ctx = new InitialContext();\n"
"HashMap map = (HashMap) ctx.lookup(\"inmemory/maps/MapTest\");"
msgstr ""
+"// Sample lookup code\n"
+"InitialContext ctx = new InitialContext();\n"
+"HashMap map = (HashMap) ctx.lookup(\"inmemory/maps/MapTest\");"
#. Tag: title
#: J2EE_Reference_Introduction.xml:1754
@@ -5563,6 +6795,20 @@
" </mbean>\n"
"</server>"
msgstr ""
+"<?xml version='1.0' encoding='UTF-8' ?>\n"
+"<!DOCTYPE server PUBLIC \n"
+" \"-//JBoss//DTD MBean Service 3.2//EN\"\n"
+" \"http://www.jboss.org/j2ee/dtd/jboss-service_3_2.dtd"
+"\">\n"
+"<server>\n"
+" <mbean code=\"org.jboss.book.jmx.xmbean.JNDIMap\"\n"
+" name=\"j2eechap2.xmbean:service=JNDIMap\" \n"
+" xmbean-dd=\"META-INF/jndimap-xmbean.xml\">\n"
+" <attribute name=\"JndiName\">inmemory/maps/MapTest</"
+"attribute>\n"
+" <depends>jboss:service=Naming</depends>\n"
+" </mbean>\n"
+"</server>"
#. Tag: programlisting
#: J2EE_Reference_Introduction.xml:1786
@@ -5723,6 +6969,46 @@
" changed from javax.management.Attribute at 82a72a to \n"
" javax.management.Attribute at acdb96]"
msgstr ""
+"[examples]$ ant -Dchap=jmx -Dex=xmbean1 run-example\n"
+"...\n"
+"run-examplexmbean1: \n"
+" [java] JNDIMap Class: org.jboss.mx.modelmbean.XMBean\n"
+" [java] JNDIMap Operations: \n"
+" [java] + void start()\n"
+" [java] + void stop()\n"
+" [java] + void put(java.lang.Object chap2.xmbean:service=JNDIMap,java."
+"lang.Object \n"
+" chap2.xmbean:service=JNDIMap)\n"
+" [java] + java.lang.Object get(java.lang.Object chap2.xmbean:"
+"service=JNDIMap)\n"
+" [java] name=chap2.xmbean:service=JNDIMap\n"
+" [java] listener=org.jboss.book.jmx.xmbean.TestXMBean1$Listener at f38cf0\n"
+" [java] key=key0, value=value0\n"
+" [java] handleNotification, event: javax.management.Notification"
+"[source=chap2.xmbean:\n"
+" service=JNDIMap][type=org.jboss.book.jmx.xmbean.JNDIMap.put]"
+"[message=]\n"
+" [java] JNDIMap.put(key1, value1) successful\n"
+" [java] handleNotification, event: javax.management.Notification"
+"[source=chap2.xmbean:\n"
+" service=JNDIMap][type=org.jboss.book.jmx.xmbean.JNDIMap.get]"
+"[message=]\n"
+" [java] JNDIMap.get(key0): null\n"
+" [java] handleNotification, event: javax.management.Notification"
+"[source=chap2.xmbean:\n"
+" service=JNDIMap][type=org.jboss.book.jmx.xmbean.JNDIMap.get]"
+"[message=]\n"
+" [java] JNDIMap.get(key1): value1\n"
+" [java] handleNotification, event: javax.management.Notification"
+"[source=chap2.xmbean:\n"
+" service=JNDIMap][type=org.jboss.book.jmx.xmbean.JNDIMap.put]"
+"[message=]\n"
+" [java] handleNotification, event: javax.management."
+"AttributeChangeNotification[source\n"
+" =chap2.xmbean:service=JNDIMap][type=jmx.attribute.change]"
+"[message=InitialValues \n"
+" changed from javax.management.Attribute at 82a72a to \n"
+" javax.management.Attribute at acdb96]"
#. Tag: para
#: J2EE_Reference_Introduction.xml:1791
@@ -5890,6 +7176,108 @@
" </notification>\n"
"</mbean>"
msgstr ""
+"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+"<!DOCTYPE mbean PUBLIC\n"
+" \"-//JBoss//DTD JBOSS XMBEAN 1.0//EN\"\n"
+" \"http://www.jboss.org/j2ee/dtd/jboss_xmbean_1_0.dtd\">\n"
+"<mbean>\n"
+" <description>The JNDIMap XMBean Example Version 2</"
+"description>\n"
+" <descriptors>\n"
+" <persistence persistPolicy=\"OnUpdate\" persistPeriod=\"10\"\n"
+" persistLocation=\"${jboss.server.data.dir}\" persistName="
+"\"JNDIMap.ser\"/>\n"
+" <currencyTimeLimit value=\"10\"/>\n"
+" <state-action-on-update value=\"keep-running\"/>\n"
+" <persistence-manager value=\"org.jboss.mx.persistence."
+"ObjectStreamPersistenceManager\"/>\n"
+" </descriptors> <class>org.jboss.test.jmx.xmbean.JNDIMap</"
+"class>\n"
+" <constructor>\n"
+" <description>The default constructor</description>\n"
+" <name>JNDIMap</name>\n"
+" </constructor> \n"
+" <!-- Attributes -->\n"
+" <attribute access=\"read-write\" getMethod=\"getJndiName\" setMethod="
+"\"setJndiName\">\n"
+" <description>\n"
+" The location in JNDI where the Map we manage will be bound\n"
+" </description>\n"
+" <name>JndiName</name>\n"
+" <type>java.lang.String</type>\n"
+" <descriptors>\n"
+" <default value=\"inmemory/maps/MapTest\"/>\n"
+" </descriptors>\n"
+" </attribute>\n"
+" <attribute access=\"read-write\" getMethod=\"getInitialValues\"\n"
+" setMethod=\"setInitialValues\">\n"
+" <description>The array of initial values that will be placed "
+"into the\n"
+" map associated with the service. The array is a collection of\n"
+" key,value pairs with elements[0,2,4,...2n] being the keys and\n"
+" elements [1,3,5,...,2n+1] the associated values</"
+"description>\n"
+" <name>InitialValues</name>\n"
+" <type>[Ljava.lang.String;</type>\n"
+" <descriptors>\n"
+" <default value=\"key0,value0\"/>\n"
+" </descriptors>\n"
+" </attribute> \n"
+" <!-- Operations -->\n"
+" <operation>\n"
+" <description>The start lifecycle operation</"
+"description>\n"
+" <name>start</name>\n"
+" </operation>\n"
+" <operation>\n"
+" <description>The stop lifecycle operation</description>\n"
+" <name>stop</name>\n"
+" </operation>\n"
+" <operation impact=\"ACTION\">\n"
+" <description>Put a value into the nap</description>\n"
+" <name>put</name>\n"
+" <parameter>\n"
+" <description>The key the value will be store under</"
+"description>\n"
+" <name>key</name>\n"
+" <type>java.lang.Object</type>\n"
+" </parameter>\n"
+" <parameter>\n"
+" <description>The value to place into the map</"
+"description>\n"
+" <name>value</name>\n"
+" <type>java.lang.Object</type>\n"
+" </parameter>\n"
+" </operation>\n"
+" <operation impact=\"INFO\">\n"
+" <description>Get a value from the map</description>\n"
+" <name>get</name>\n"
+" <parameter>\n"
+" <description>The key to lookup in the map</"
+"description>\n"
+" <name>get</name>\n"
+" <type>java.lang.Object</type>\n"
+" </parameter>\n"
+" <return-type>java.lang.Object</return-type>\n"
+" </operation> \n"
+" <!-- Notifications -->\n"
+" <notification>\n"
+" <description>The notification sent whenever a value is get "
+"into the map\n"
+" managed by the service</description>\n"
+" <name>javax.management.Notification</name>\n"
+" <notification-type>org.jboss.book.jmx.xmbean.JNDIMap.get</"
+"notification-type>\n"
+" </notification>\n"
+" <notification>\n"
+" <description>The notification sent whenever a value is put "
+"into the map\n"
+" managed by the service</description>\n"
+" <name>javax.management.Notification</name>\n"
+" <notification-type>org.jboss.book.jmx.xmbean.JNDIMap.put</"
+"notification-type>\n"
+" </notification>\n"
+"</mbean>"
#. Tag: para
#: J2EE_Reference_Introduction.xml:1816
@@ -5946,6 +7334,50 @@
"timeStamp=1098632\n"
"693925,message=null,userData=null]"
msgstr ""
+"[examples]$ ant -Dchap=jmx -Dex=xmbean2 -Djboss.deploy.conf=default run-"
+"example\n"
+"...\n"
+"run-examplexmbean2:\n"
+" [java] JNDIMap Class: org.jboss.mx.modelmbean.XMBean\n"
+" [java] JNDIMap Operations: \n"
+" [java] + void start()\n"
+" [java] + void stop()\n"
+" [java] + void put(java.lang.Object chap2.xmbean:service=JNDIMap,java."
+"lang.Object cha\n"
+"p2.xmbean:service=JNDIMap)\n"
+" [java] + java.lang.Object get(java.lang.Object chap2.xmbean:"
+"service=JNDIMap)\n"
+" [java] + java.lang.String getJndiName()\n"
+" [java] + void setJndiName(java.lang.String chap2.xmbean:"
+"service=JNDIMap)\n"
+" [java] + [Ljava.lang.String; getInitialValues()\n"
+" [java] + void setInitialValues([Ljava.lang.String; chap2.xmbean:"
+"service=JNDIMap)\n"
+" [java] handleNotification, event: null\n"
+" [java] key=key10, value=value10\n"
+" [java] handleNotification, event: javax.management.Notification"
+"[source=chap2.xmbean:s\n"
+"ervice=JNDIMap,type=org.jboss.chap2.xmbean.JNDIMap.put,sequenceNumber=7,"
+"timeStamp=10986326\n"
+"93716,message=null,userData=null]\n"
+" [java] JNDIMap.put(key1, value1) successful\n"
+" [java] handleNotification, event: javax.management.Notification"
+"[source=chap2.xmbean:s\n"
+"ervice=JNDIMap,type=org.jboss.chap2.xmbean.JNDIMap.get,sequenceNumber=8,"
+"timeStamp=10986326\n"
+"93857,message=null,userData=null]\n"
+" [java] JNDIMap.get(key0): null\n"
+" [java] handleNotification, event: javax.management.Notification"
+"[source=chap2.xmbean:s\n"
+"ervice=JNDIMap,type=org.jboss.chap2.xmbean.JNDIMap.get,sequenceNumber=9,"
+"timeStamp=10986326\n"
+"93896,message=null,userData=null]\n"
+" [java] JNDIMap.get(key1): value1\n"
+" [java] handleNotification, event: javax.management.Notification"
+"[source=chap2.xmbean:s\n"
+"ervice=JNDIMap,type=org.jboss.chap2.xmbean.JNDIMap.put,sequenceNumber=10,"
+"timeStamp=1098632\n"
+"693925,message=null,userData=null]"
#. Tag: para
#: J2EE_Reference_Introduction.xml:1820
@@ -5966,6 +7398,10 @@
" [java] InitialValues.length=2\n"
" [java] key=key10, value=value10"
msgstr ""
+"[examples] ant -Dchap=jmx -Dex=xmbean2a run-example\n"
+"...\n"
+" [java] InitialValues.length=2\n"
+" [java] key=key10, value=value10"
#. Tag: programlisting
#: J2EE_Reference_Introduction.xml:1825
@@ -5977,6 +7413,11 @@
" [java] key=key10, value=value10\n"
" [java] key=key2, value=value2"
msgstr ""
+"[examples] ant -Dchap=jmx -Dex=xmbean2a run-example\n"
+"...\n"
+" [java] InitialValues.length=4\n"
+" [java] key=key10, value=value10\n"
+" [java] key=key2, value=value2"
#. Tag: programlisting
#: J2EE_Reference_Introduction.xml:1828
@@ -5989,6 +7430,12 @@
" [java] key=key2, value=value2\n"
" [java] key=key3, value=value3"
msgstr ""
+"[examples] ant -Dchap=jmx -Dex=xmbean2a run-example\n"
+"...\n"
+" [java] InitialValues.length=6\n"
+" [java] key=key10, value=value10\n"
+" [java] key=key2, value=value2\n"
+" [java] key=key3, value=value3"
#. Tag: para
#: J2EE_Reference_Introduction.xml:1830
@@ -6057,6 +7504,58 @@
" }\n"
"}"
msgstr ""
+"package org.jboss.book.jmx.xmbean;\n"
+"\n"
+"import javax.management.Attribute;\n"
+"import javax.management.ObjectName;\n"
+"import javax.naming.InitialContext;\n"
+"\n"
+"import org.jboss.jmx.adaptor.rmi.RMIAdaptor;\n"
+"\n"
+"/**\n"
+" * A client that demonstrates the persistence of the xmbean\n"
+" * attributes. Every time it run it looks up the InitialValues\n"
+" * attribute, prints it out and then adds a new key/value to the\n"
+" * list.\n"
+" * \n"
+" * @author Scott.Stark at jboss.org\n"
+" * @version $Revision: 1.1 $\n"
+" */\n"
+"public class TestXMBeanRestart\n"
+"{\n"
+" /**\n"
+" * @param args the command line arguments\n"
+" */\n"
+" public static void main(String[] args) throws Exception\n"
+" {\n"
+" InitialContext ic = new InitialContext();\n"
+" RMIAdaptor server = (RMIAdaptor) ic.lookup(\"jmx/rmi/RMIAdaptor\");\n"
+" \n"
+" // Get the InitialValues attribute\n"
+" ObjectName name = new ObjectName(\"j2eechap2.xmbean:service=JNDIMap"
+"\");\n"
+" String[] initialValues = (String[])\n"
+" server.getAttribute(name, \"InitialValues\");\n"
+" System.out.println(\"InitialValues.length=\"+initialValues.length);\n"
+" int length = initialValues.length;\n"
+" for (int n = 0; n < length; n += 2) {\n"
+" String key = initialValues[n];\n"
+" String value = initialValues[n+1];\n"
+" \n"
+" System.out.println(\"key=\"+key+\", value=\"+value);\n"
+" }\n"
+" // Add a new key/value pair\n"
+" String[] newInitialValues = new String[length+2];\n"
+" System.arraycopy(initialValues, 0, newInitialValues,\n"
+" 0, length);\n"
+" newInitialValues[length] = \"key\"+(length/2+1);\n"
+" newInitialValues[length+1] = \"value\"+(length/2+1);\n"
+" \n"
+" Attribute ivalues = new\n"
+" Attribute(\"InitialValues\", newInitialValues);\n"
+" server.setAttribute(name, ivalues);\n"
+" }\n"
+"}"
#. Tag: para
#: J2EE_Reference_Introduction.xml:1834
@@ -6134,6 +7633,68 @@
"timeStamp=10986\n"
"33665614,message=null,userData=null]"
msgstr ""
+"[examples]$ ant -Dchap=jmx -Dex=xmbean2 run-example\n"
+"...\n"
+"\n"
+"run-examplexmbean2:\n"
+" [java] JNDIMap Class: org.jboss.mx.modelmbean.XMBean\n"
+" [java] JNDIMap Operations: \n"
+" [java] + void start()\n"
+" [java] + void stop()\n"
+" [java] + void put(java.lang.Object chap2.xmbean:service=JNDIMap,java."
+"lang.Object cha\n"
+"p2.xmbean:service=JNDIMap)\n"
+" [java] + java.lang.Object get(java.lang.Object chap2.xmbean:"
+"service=JNDIMap)\n"
+" [java] + java.lang.String getJndiName()\n"
+" [java] + void setJndiName(java.lang.String chap2.xmbean:"
+"service=JNDIMap)\n"
+" [java] + [Ljava.lang.String; getInitialValues()\n"
+" [java] + void setInitialValues([Ljava.lang.String; chap2.xmbean:"
+"service=JNDIMap)\n"
+" [java] handleNotification, event: null\n"
+" [java] <emphasis role=\"bold\">key=key10, value=value10</emphasis>\n"
+" [java] <emphasis role=\"bold\">key=key2, value=value2</emphasis>\n"
+" [java] <emphasis role=\"bold\">key=key3, value=value3</emphasis>\n"
+" [java] <emphasis role=\"bold\">key=key4, value=value4</emphasis>\n"
+" [java] handleNotification, event: javax.management.Notification"
+"[source=chap2.xmbean:s\n"
+"ervice=JNDIMap,type=org.jboss.book.jmx.xmbean.JNDIMap.put,sequenceNumber=3,"
+"timeStamp=10986\n"
+"33664712,message=null,userData=null]\n"
+" [java] JNDIMap.put(key1, value1) successful\n"
+" [java] handleNotification, event: javax.management.Notification"
+"[source=chap2.xmbean:s\n"
+"ervice=JNDIMap,type=org.jboss.book.jmx.xmbean.JNDIMap.get,sequenceNumber=4,"
+"timeStamp=10986\n"
+"33664821,message=null,userData=null]\n"
+" [java] JNDIMap.get(key0): null\n"
+" [java] handleNotification, event: javax.management.Notification"
+"[source=chap2.xmbean:s\n"
+"ervice=JNDIMap,type=org.jboss.book.jmx.xmbean.JNDIMap.get,sequenceNumber=5,"
+"timeStamp=10986\n"
+"33664860,message=null,userData=null]\n"
+" [java] JNDIMap.get(key1): value1\n"
+" [java] handleNotification, event: javax.management.Notification"
+"[source=chap2.xmbean:s\n"
+"ervice=JNDIMap,type=org.jboss.book.jmx.xmbean.JNDIMap.put,sequenceNumber=6,"
+"timeStamp=10986\n"
+"33664877,message=null,userData=null]\n"
+" [java] handleNotification, event: javax.management.Notification"
+"[source=chap2.xmbean:s\n"
+"ervice=JNDIMap,type=org.jboss.book.jmx.xmbean.JNDIMap.put,sequenceNumber=7,"
+"timeStamp=10986\n"
+"33664895,message=null,userData=null]\n"
+" [java] handleNotification, event: javax.management.Notification"
+"[source=chap2.xmbean:s\n"
+"ervice=JNDIMap,type=org.jboss.book.jmx.xmbean.JNDIMap.put,sequenceNumber=8,"
+"timeStamp=10986\n"
+"33664899,message=null,userData=null]\n"
+" [java] handleNotification, event: javax.management.Notification"
+"[source=chap2.xmbean:s\n"
+"ervice=JNDIMap,type=org.jboss.book.jmx.xmbean.JNDIMap.put,sequenceNumber=9,"
+"timeStamp=10986\n"
+"33665614,message=null,userData=null]"
#. Tag: para
#: J2EE_Reference_Introduction.xml:1838
@@ -6195,6 +7756,20 @@
"| +- org/jboss/book/jmx/ex3/EjbMBeanAdaptor.class\n"
"+- META-INF/application.xml"
msgstr ""
+"<emphasis role=\"bold\">output/jmx/jmx-ex3.ear</emphasis>\n"
+"+- META-INF/MANIFEST.MF\n"
+"+- META-INF/jboss-app.xml\n"
+"+- jmx-ex3.jar (archive) [EJB jar]\n"
+"| +- META-INF/MANIFEST.MF\n"
+"| +- META-INF/ejb-jar.xml\n"
+"| +- org/jboss/book/jmx/ex3/EchoBean.class\n"
+"| +- org/jboss/book/jmx/ex3/EchoLocal.class\n"
+"| +- org/jboss/book/jmx/ex3/EchoLocalHome.class\n"
+"+- jmx-ex3.sar (archive) [MBean sar]\n"
+"| +- META-INF/MANIFEST.MF\n"
+"| +- META-INF/jboss-service.xml\n"
+"| +- org/jboss/book/jmx/ex3/EjbMBeanAdaptor.class\n"
+"+- META-INF/application.xml"
#. Tag: para
#: J2EE_Reference_Introduction.xml:1856
@@ -6552,6 +8127,346 @@
" \n"
"}"
msgstr ""
+"package org.jboss.book.jmx.ex3;\n"
+" \n"
+"import java.lang.reflect.Method;\n"
+"import javax.ejb.CreateException;\n"
+"import javax.management.Attribute;\n"
+"import javax.management.AttributeList;\n"
+"import javax.management.AttributeNotFoundException;\n"
+"import javax.management.DynamicMBean;\n"
+"import javax.management.InvalidAttributeValueException;\n"
+"import javax.management.JMRuntimeException;\n"
+"import javax.management.MBeanAttributeInfo;\n"
+"import javax.management.MBeanConstructorInfo;\n"
+"import javax.management.MBeanInfo;\n"
+"import javax.management.MBeanNotificationInfo;\n"
+"import javax.management.MBeanOperationInfo;\n"
+"import javax.management.MBeanException;\n"
+"import javax.management.MBeanServer;\n"
+"import javax.management.ObjectName;\n"
+"import javax.management.ReflectionException;\n"
+"import javax.naming.InitialContext;\n"
+"import javax.naming.NamingException;\n"
+"\n"
+"import org.jboss.system.ServiceMBeanSupport;\n"
+"\n"
+"/** \n"
+" * An example of a DynamicMBean that exposes select attributes and\n"
+" * operations of an EJB as an MBean.\n"
+" * @author Scott.Stark at jboss.org\n"
+" * @version $Revision: 1.1 $\n"
+" */\n"
+"public class EjbMBeanAdaptor extends ServiceMBeanSupport\n"
+" implements DynamicMBean\n"
+"{\n"
+" private String helloPrefix;\n"
+" private String ejbJndiName;\n"
+" private EchoLocalHome home;\n"
+" \n"
+" /** These are the mbean attributes we expose\n"
+" */\n"
+" private MBeanAttributeInfo[] attributes = {\n"
+" new MBeanAttributeInfo(\"HelloPrefix\", \"java.lang.String\",\n"
+" \"The prefix message to append to the session "
+"echo reply\",\n"
+" true, // isReadable\n"
+" true, // isWritable\n"
+" false), // isIs\n"
+" new MBeanAttributeInfo(\"EjbJndiName\", \"java.lang.String\",\n"
+" \"The JNDI name of the session bean local home"
+"\",\n"
+" true, // isReadable\n"
+" true, // isWritable\n"
+" false) // isIs\n"
+" };\n"
+"\n"
+" /** \n"
+" * These are the mbean operations we expose\n"
+" */\n"
+" private MBeanOperationInfo[] operations;\n"
+" \n"
+" /** \n"
+" * We override this method to setup our echo operation info. It\n"
+" * could also be done in a ctor.\n"
+" */\n"
+" public ObjectName preRegister(MBeanServer server,\n"
+" ObjectName name)\n"
+" throws Exception\n"
+" {\n"
+" log.info(\"preRegister notification seen\");\n"
+" \n"
+" operations = new MBeanOperationInfo[5];\n"
+" \n"
+" Class thisClass = getClass();\n"
+" Class[] parameterTypes = {String.class};\n"
+" Method echoMethod =\n"
+" thisClass.getMethod(\"echo\", parameterTypes);\n"
+" String desc = \"The echo op invokes the session bean echo method and"
+"\"\n"
+" + \" returns its value prefixed with the helloPrefix attribute "
+"value\";\n"
+" operations[0] = new MBeanOperationInfo(desc, echoMethod);\n"
+" \n"
+" // Add the Service interface operations from our super class\n"
+" parameterTypes = new Class[0];\n"
+" Method createMethod =\n"
+" thisClass.getMethod(\"create\", parameterTypes);\n"
+" operations[1] = new MBeanOperationInfo(\"The\n"
+" JBoss Service.create\", createMethod);\n"
+" Method startMethod =\n"
+" thisClass.getMethod(\"start\", parameterTypes);\n"
+" operations[2] = new MBeanOperationInfo(\"The\n"
+" JBoss Service.start\", startMethod);\n"
+" Method stopMethod =\n"
+" thisClass.getMethod(\"stop\", parameterTypes);\n"
+" operations[3] = new MBeanOperationInfo(\"The\n"
+" JBoss Service.stop\", startMethod);\n"
+" Method destroyMethod =\n"
+" thisClass.getMethod(\"destroy\", parameterTypes);\n"
+" operations[4] = new MBeanOperationInfo(\"The\n"
+" JBoss Service.destroy\", startMethod);\n"
+" return name;\n"
+" }\n"
+" \n"
+" \n"
+" // --- Begin ServiceMBeanSupport overides\n"
+" protected void createService() throws Exception\n"
+" {\n"
+" log.info(\"Notified of create state\");\n"
+" }\n"
+"\n"
+" protected void startService() throws Exception\n"
+" {\n"
+" log.info(\"Notified of start state\");\n"
+" InitialContext ctx = new InitialContext();\n"
+" home = (EchoLocalHome) ctx.lookup(ejbJndiName);\n"
+" }\n"
+"\n"
+" protected void stopService()\n"
+" {\n"
+" log.info(\"Notified of stop state\");\n"
+" }\n"
+"\n"
+" // --- End ServiceMBeanSupport overides\n"
+" \n"
+" public String getHelloPrefix()\n"
+" {\n"
+" return helloPrefix;\n"
+" }\n"
+" public void setHelloPrefix(String helloPrefix)\n"
+" {\n"
+" this.helloPrefix = helloPrefix;\n"
+" }\n"
+" \n"
+" public String getEjbJndiName()\n"
+" {\n"
+" return ejbJndiName;\n"
+" }\n"
+" public void setEjbJndiName(String ejbJndiName)\n"
+" {\n"
+" this.ejbJndiName = ejbJndiName;\n"
+" }\n"
+" \n"
+" public String echo(String arg)\n"
+" throws CreateException, NamingException\n"
+" {\n"
+" log.debug(\"Lookup EchoLocalHome@\"+ejbJndiName);\n"
+" EchoLocal bean = home.create();\n"
+" String echo = helloPrefix + bean.echo(arg);\n"
+" return echo;\n"
+" }\n"
+" \n"
+" // --- Begin DynamicMBean interface methods\n"
+" /** \n"
+" * Returns the management interface that describes this dynamic\n"
+" * resource. It is the responsibility of the implementation to\n"
+" * make sure the description is accurate.\n"
+" *\n"
+" * @return the management interface descriptor.\n"
+" */\n"
+" public MBeanInfo getMBeanInfo()\n"
+" {\n"
+" String classname = getClass().getName();\n"
+" String description = \"This is an MBean that uses a session bean in "
+"the\"\n"
+" + \" implementation of its echo operation.\";\n"
+" MBeanInfo[] constructors = null;\n"
+" MBeanNotificationInfo[] notifications = null;\n"
+" MBeanInfo mbeanInfo = new MBeanInfo(classname,\n"
+" description, attributes,\n"
+" constructors, operations,\n"
+" notifications);\n"
+" // Log when this is called so we know when in the\n"
+" lifecycle this is used\n"
+" Throwable trace = new Throwable(\"getMBeanInfo trace\");\n"
+" log.info(\"Don't panic, just a stack\n"
+" trace\", trace);\n"
+" return mbeanInfo;\n"
+" }\n"
+" \n"
+" /** \n"
+" * Returns the value of the attribute with the name matching the\n"
+" * passed string.\n"
+" *\n"
+" * @param attribute the name of the attribute.\n"
+" * @return the value of the attribute.\n"
+" * @exception AttributeNotFoundException when there is no such\n"
+" * attribute.\n"
+" * @exception MBeanException wraps any error thrown by the\n"
+" * resource when\n"
+" * getting the attribute.\n"
+" * @exception ReflectionException wraps any error invoking the\n"
+" * resource.\n"
+" */\n"
+" public Object getAttribute(String attribute)\n"
+" throws AttributeNotFoundException, \n"
+" MBeanException, \n"
+" ReflectionException\n"
+" {\n"
+" Object value = null;\n"
+" if (attribute.equals(\"HelloPrefix\")) {\n"
+" value = getHelloPrefix();\n"
+" } else if(attribute.equals(\"EjbJndiName\")) {\n"
+" value = getEjbJndiName();\n"
+" } else {\n"
+" throw new AttributeNotFoundException(\"Unknown\n"
+" attribute(\"+attribute+\") requested\");\n"
+" }\n"
+" return value;\n"
+" }\n"
+" \n"
+" /** \n"
+" * Returns the values of the attributes with names matching the\n"
+" * passed string array.\n"
+" *\n"
+" * @param attributes the names of the attribute.\n"
+" * @return an {@link AttributeList AttributeList} of name\n"
+" * and value pairs.\n"
+" */\n"
+" public AttributeList getAttributes(String[] attributes)\n"
+" {\n"
+" AttributeList values = new AttributeList();\n"
+" for (int a = 0; a < attributes.length; a++) {\n"
+" String name = attributes[a];\n"
+" try {\n"
+" Object value = getAttribute(name);\n"
+" Attribute attr = new Attribute(name, value);\n"
+" values.add(attr);\n"
+" } catch(Exception e) {\n"
+" log.error(\"Failed to find attribute: \"+name, e);\n"
+" }\n"
+" }\n"
+" return values;\n"
+" }\n"
+" \n"
+" /**\n"
+" * Sets the value of an attribute. The attribute and new value\n"
+" * are passed in the name value pair {@link Attribute\n"
+" * Attribute}.\n"
+" *\n"
+" * @see javax.management.Attribute\n"
+" *\n"
+" * @param attribute the name and new value of the attribute.\n"
+" * @exception AttributeNotFoundException when there is no such\n"
+" * attribute.\n"
+" * @exception InvalidAttributeValueException when the new value\n"
+" * cannot be converted to the type of the attribute.\n"
+" * @exception MBeanException wraps any error thrown by the\n"
+" * resource when setting the new value.\n"
+" * @exception ReflectionException wraps any error invoking the\n"
+" * resource.\n"
+" */\n"
+" public void setAttribute(Attribute attribute)\n"
+" throws AttributeNotFoundException, \n"
+" InvalidAttributeValueException,\n"
+" MBeanException, \n"
+" ReflectionException\n"
+" {\n"
+" String name = attribute.getName();\n"
+" if (name.equals(\"HelloPrefix\")) { \n"
+" String value = attribute.getValue().toString();\n"
+" setHelloPrefix(value);\n"
+" } else if(name.equals(\"EjbJndiName\")) {\n"
+" String value = attribute.getValue().toString();\n"
+" setEjbJndiName(value);\n"
+" } else {\n"
+" throw new AttributeNotFoundException(\"Unknown attribute(\"+name+"
+"\") requested\");\n"
+" }\n"
+" }\n"
+" \n"
+" /**\n"
+" * Sets the values of the attributes passed as an\n"
+" * {@link AttributeList AttributeList} of name and new\n"
+" * value pairs.\n"
+" *\n"
+" * @param attributes the name an new value pairs.\n"
+" * @return an {@link AttributeList AttributeList} of name and\n"
+" * value pairs that were actually set.\n"
+" */\n"
+" public AttributeList setAttributes(AttributeList attributes)\n"
+" {\n"
+" AttributeList setAttributes = new AttributeList();\n"
+" for(int a = 0; a < attributes.size(); a++) {\n"
+" Attribute attr = (Attribute) attributes.get(a);\n"
+" try {\n"
+" setAttribute(attr);\n"
+" setAttributes.add(attr);\n"
+" } catch(Exception ignore) {\n"
+" }\n"
+" }\n"
+" return setAttributes;\n"
+" }\n"
+" \n"
+" /**\n"
+" * Invokes a resource operation.\n"
+" *\n"
+" * @param actionName the name of the operation to perform.\n"
+" * @param params the parameters to pass to the operation.\n"
+" * @param signature the signartures of the parameters.\n"
+" * @return the result of the operation.\n"
+" * @exception MBeanException wraps any error thrown by the\n"
+" * resource when performing the operation.\n"
+" * @exception ReflectionException wraps any error invoking the\n"
+" * resource.\n"
+" */\n"
+" public Object invoke(String actionName, Object[] params,\n"
+" String[] signature)\n"
+" throws MBeanException,\n"
+" ReflectionException\n"
+" {\n"
+" Object rtnValue = null;\n"
+" log.debug(\"Begin invoke, actionName=\"+actionName);\n"
+" try {\n"
+" if (actionName.equals(\"echo\")) {\n"
+" String arg = (String) params[0];\n"
+" rtnValue = echo(arg);\n"
+" log.debug(\"Result: \"+rtnValue);\n"
+" } else if (actionName.equals(\"create\")) {\n"
+" super.create();\n"
+" } else if (actionName.equals(\"start\")) {\n"
+" super.start();\n"
+" } else if (actionName.equals(\"stop\")) {\n"
+" super.stop();\n"
+" } else if (actionName.equals(\"destroy\")) {\n"
+" super.destroy();\n"
+" } else {\n"
+" throw new JMRuntimeException(\"Invalid state,\n"
+" don't know about op=\"+actionName);\n"
+" }\n"
+" } catch(Exception e) {\n"
+" throw new ReflectionException(e, \"echo failed\");\n"
+" }\n"
+"\n"
+"\n"
+" log.debug(\"End invoke, actionName=\"+actionName);\n"
+" return rtnValue;\n"
+" }\n"
+" \n"
+" // --- End DynamicMBean interface methods\n"
+" \n"
+"}"
#. Tag: para
#: J2EE_Reference_Introduction.xml:1860
@@ -6595,6 +8510,18 @@
" public void destroy();\n"
"}"
msgstr ""
+"public interface EjbMBeanAdaptorMBean\n"
+"{\n"
+" public String getHelloPrefix();\n"
+" public void setHelloPrefix(String prefix);\n"
+" public String getEjbJndiName();\n"
+" public void setEjbJndiName(String jndiName);\n"
+" public String echo(String arg) throws CreateException, NamingException;\n"
+" public void create() throws Exception;\n"
+" public void start() throws Exception;\n"
+" public void stop();\n"
+" public void destroy();\n"
+"}"
#. Tag: para
#: J2EE_Reference_Introduction.xml:1867
@@ -6721,6 +8648,17 @@
" </mbean>\n"
"</server>"
msgstr ""
+"<server>\n"
+" <mbean code=\"org.jboss.book.jmx.ex3.EjbMBeanAdaptor\"\n"
+" name=\"jboss.book:service=EjbMBeanAdaptor\">\n"
+" <attribute name=\"HelloPrefix\">AdaptorPrefix</"
+"attribute>\n"
+" <attribute name=\"EjbJndiName\">local/j2ee_chap2.EchoBean</"
+"attribute>\n"
+" <depends>jboss.j2ee:service=EJB,jndiName=local/j2ee_chap2."
+"EchoBean</depends>\n"
+" </mbean>\n"
+"</server>"
#. Tag: para
#: J2EE_Reference_Introduction.xml:1892
@@ -6732,7 +8670,7 @@
#: J2EE_Reference_Introduction.xml:1895
#, no-c-format
msgid "[examples]$ ant -Dchap=jmx -Dex=3 run-example"
-msgstr ""
+msgstr "[examples]$ ant -Dchap=jmx -Dex=3 run-example"
#. Tag: para
#: J2EE_Reference_Introduction.xml:1896
@@ -6815,6 +8753,76 @@
"/tmp60550jmx-ex3.ear-contents/jmx-ex3.jar \n"
"14:57:14,075 INFO [EARDeployer] Started J2EE application: ..."
msgstr ""
+"14:57:12,906 INFO [EARDeployer] Init J2EE application: file:/private/tmp/"
+"jboss-eap-4.3/jboss-as/server/\n"
+" production/deploy/j2ee_chap2-ex3.ear\n"
+"14:57:13,044 INFO [EjbMBeanAdaptor] Don't panic, just a stack trace\n"
+"java.lang.Throwable: getMBeanInfo trace\n"
+" at org.jboss.book.jmx.ex3.EjbMBeanAdaptor.getMBeanInfo(EjbMBeanAdaptor."
+"java:153)\n"
+"...\n"
+"14:57:13,088 INFO [EjbMBeanAdaptor] preRegister notification seen\n"
+"14:57:13,093 INFO [EjbMBeanAdaptor] Don't panic, just a stack trace\n"
+"java.lang.Throwable: getMBeanInfo trace\n"
+" at org.jboss.book.jmx.ex3.EjbMBeanAdaptor.getMBeanInfo(EjbMBeanAdaptor."
+"java:153)\n"
+"...\n"
+"14:57:13,117 INFO [EjbMBeanAdaptor] Don't panic, just a stack trace\n"
+"java.lang.Throwable: getMBeanInfo trace\n"
+" at org.jboss.book.jmx.ex3.EjbMBeanAdaptor.getMBeanInfo(EjbMBeanAdaptor."
+"java:153)\n"
+"... \n"
+"14:57:13,140 WARN [EjbMBeanAdaptor] Unexcepted error accessing MBeanInfo "
+"for null\n"
+"java.lang.NullPointerException\n"
+" at org.jboss.system.ServiceMBeanSupport.postRegister(ServiceMBeanSupport."
+"java:418)\n"
+"...\n"
+"14:57:13,203 INFO [EjbMBeanAdaptor] Don't panic, just a stack trace\n"
+"java.lang.Throwable: getMBeanInfo trace\n"
+" at org.jboss.book.jmx.ex3.EjbMBeanAdaptor.getMBeanInfo(EjbMBeanAdaptor."
+"java:153)\n"
+"... \n"
+"14:57:13,232 INFO [EjbMBeanAdaptor] Don't panic, just a stack trace\n"
+"java.lang.Throwable: getMBeanInfo trace\n"
+" at org.jboss.book.jmx.ex3.EjbMBeanAdaptor.getMBeanInfo(EjbMBeanAdaptor."
+"java:153)\n"
+"...\n"
+"14:57:13,420 INFO [EjbModule] Deploying Chap2EchoInfoBean\n"
+"14:57:13,443 INFO [EjbModule] Deploying chap2.EchoBean\n"
+"14:57:13,488 INFO [EjbMBeanAdaptor] Don't panic, just a stack trace\n"
+"java.lang.Throwable: getMBeanInfo trace\n"
+" at org.jboss.book.jmx.ex3.EjbMBeanAdaptor.getMBeanInfo(EjbMBeanAdaptor."
+"java:153)\n"
+"...\n"
+"14:57:13,542 INFO [EjbMBeanAdaptor] Don't panic, just a stack trace\n"
+"java.lang.Throwable: getMBeanInfo trace\n"
+" at org.jboss.book.jmx.ex3.EjbMBeanAdaptor.getMBeanInfo(EjbMBeanAdaptor."
+"java:153)\n"
+"...\n"
+"14:57:13,558 INFO [EjbMBeanAdaptor] Begin invoke, actionName=create\n"
+"14:57:13,560 INFO [EjbMBeanAdaptor] Notified of create state\n"
+"14:57:13,562 INFO [EjbMBeanAdaptor] End invoke, actionName=create\n"
+"14:57:13,604 INFO [EjbMBeanAdaptor] Don't panic, just a stack trace\n"
+"java.lang.Throwable: getMBeanInfo trace\n"
+" at org.jboss.book.jmx.ex3.EjbMBeanAdaptor.getMBeanInfo(EjbMBeanAdaptor."
+"java:153)\n"
+"... \n"
+"14:57:13,621 INFO [EjbMBeanAdaptor] Don't panic, just a stack trace\n"
+"java.lang.Throwable: getMBeanInfo trace\n"
+" at org.jboss.book.jmx.ex3.EjbMBeanAdaptor.getMBeanInfo(EjbMBeanAdaptor."
+"java:153)\n"
+"14:57:13,641 INFO [EjbMBeanAdaptor] Begin invoke, actionName=getState\n"
+"14:57:13,942 INFO [EjbMBeanAdaptor] Begin invoke, actionName=start\n"
+"14:57:13,944 INFO [EjbMBeanAdaptor] Notified of start state\n"
+"14:57:13,951 INFO [EjbMBeanAdaptor] Testing Echo\n"
+"14:57:13,983 INFO [EchoBean] echo, info=echo info, arg=, arg=startService\n"
+"14:57:13,986 INFO [EjbMBeanAdaptor] echo(startService) = startService\n"
+"14:57:13,988 INFO [EjbMBeanAdaptor] End invoke, actionName=start\n"
+"14:57:13,991 INFO [EJBDeployer] Deployed: file:/tmp/jboss-eap-4.3/jboss-as/"
+"server/production/tmp/deploy\n"
+"/tmp60550jmx-ex3.ear-contents/jmx-ex3.jar \n"
+"14:57:14,075 INFO [EARDeployer] Started J2EE application: ..."
#. Tag: para
#: J2EE_Reference_Introduction.xml:1900
@@ -6869,6 +8877,12 @@
"10:51:48,687 INFO [EjbMBeanAdaptor] Result: AdaptorPrefix-echo-arg\n"
"10:51:48,687 INFO [EjbMBeanAdaptor] End invoke, actionName=echo"
msgstr ""
+"10:51:48,671 INFO [EjbMBeanAdaptor] Begin invoke, actionName=echo\n"
+"10:51:48,671 INFO [EjbMBeanAdaptor] Lookup EchoLocalHome at local/j2ee_chap2."
+"EchoBean\n"
+"10:51:48,687 INFO [EchoBean] echo, info=echo info, arg=, arg=-echo-arg\n"
+"10:51:48,687 INFO [EjbMBeanAdaptor] Result: AdaptorPrefix-echo-arg\n"
+"10:51:48,687 INFO [EjbMBeanAdaptor] End invoke, actionName=echo"
#. Tag: title
#: J2EE_Reference_Introduction.xml:1923
@@ -7215,6 +9229,22 @@
" Object invoke(Invocation invocation) throws Exception;\n"
"}"
msgstr ""
+"package org.jboss.invocation;\n"
+" \n"
+"import java.rmi.Remote;\n"
+"import org.jboss.proxy.Interceptor;\n"
+"import org.jboss.util.id.GUID;\n"
+" \n"
+" \n"
+"public interface Invoker\n"
+" extends Remote\n"
+"{\n"
+" GUID ID = new GUID();\n"
+"\n"
+" String getServerHostName() throws Exception;\n"
+"\n"
+" Object invoke(Invocation invocation) throws Exception;\n"
+"}"
#. Tag: para
#: J2EE_Reference_Introduction.xml:2042
@@ -7504,6 +9534,148 @@
" }\n"
"}"
msgstr ""
+"package org.jboss.jmx.connector.invoker;\n"
+"public interface InvokerAdaptorServiceMBean\n"
+" extends org.jboss.system.ServiceMBean\n"
+"{\n"
+" Class getExportedInterface();\n"
+" void setExportedInterface(Class exportedInterface);\n"
+"\n"
+" Object invoke(org.jboss.invocation.Invocation invocation)\n"
+" throws Exception;\n"
+"}\n"
+"\n"
+"package org.jboss.jmx.connector.invoker;\n"
+"\n"
+"import java.lang.reflect.InvocationTargetException;\n"
+"import java.lang.reflect.Method;\n"
+"import java.lang.reflect.UndeclaredThrowableException;\n"
+"import java.util.Collections;\n"
+"import java.util.HashMap;\n"
+"import java.util.Map;\n"
+"\n"
+"import javax.management.MBeanServer;\n"
+"import javax.management.ObjectName;\n"
+"\n"
+"import org.jboss.invocation.Invocation;\n"
+"import org.jboss.invocation.MarshalledInvocation;\n"
+"import org.jboss.mx.server.ServerConstants;\n"
+"import org.jboss.system.ServiceMBeanSupport;\n"
+"import org.jboss.system.Registry;\n"
+"\n"
+"public class InvokerAdaptorService\n"
+" extends ServiceMBeanSupport\n"
+" implements InvokerAdaptorServiceMBean, ServerConstants\n"
+"{\n"
+" private static ObjectName mbeanRegistry;\n"
+" \n"
+" static {\n"
+" try {\n"
+" mbeanRegistry = new ObjectName(MBEAN_REGISTRY);\n"
+" } catch (Exception e) {\n"
+" throw new RuntimeException(e.toString());\n"
+" }\n"
+" }\n"
+"\n"
+" private Map marshalledInvocationMapping = new HashMap();\n"
+" private Class exportedInterface;\n"
+"\n"
+" public Class getExportedInterface()\n"
+" {\n"
+" return exportedInterface;\n"
+" }\n"
+"\n"
+" public void setExportedInterface(Class exportedInterface)\n"
+" {\n"
+" this.exportedInterface = exportedInterface;\n"
+" }\n"
+"\n"
+" protected void startService()\n"
+" throws Exception\n"
+" {\n"
+" // Build the interface method map\n"
+" Method[] methods = exportedInterface.getMethods();\n"
+" HashMap tmpMap = new HashMap(methods.length);\n"
+" for (int m = 0; m < methods.length; m ++) {\n"
+" Method method = methods[m];\n"
+" Long hash = new Long(MarshalledInvocation.calculateHash"
+"(method));\n"
+" tmpMap.put(hash, method);\n"
+" }\n"
+"\n"
+" marshalledInvocationMapping = Collections.unmodifiableMap(tmpMap);\n"
+" // Place our ObjectName hash into the Registry so invokers can\n"
+" // resolve it\n"
+" Registry.bind(new Integer(serviceName.hashCode()), serviceName);\n"
+" }\n"
+"\n"
+" protected void stopService()\n"
+" throws Exception\n"
+" {\n"
+" Registry.unbind(new Integer(serviceName.hashCode()));\n"
+" }\n"
+"\n"
+"\n"
+" public Object invoke(Invocation invocation)\n"
+" throws Exception\n"
+" {\n"
+" // Make sure we have the correct classloader before unmarshalling\n"
+" Thread thread = Thread.currentThread();\n"
+" ClassLoader oldCL = thread.getContextClassLoader();\n"
+"\n"
+" // Get the MBean this operation applies to\n"
+" ClassLoader newCL = null;\n"
+" ObjectName objectName = (ObjectName) \n"
+" invocation.getValue(\"JMX_OBJECT_NAME\");\n"
+" if (objectName != null) {\n"
+" // Obtain the ClassLoader associated with the MBean deployment\n"
+" newCL = (ClassLoader) \n"
+" server.invoke(mbeanRegistry, \"getValue\",\n"
+" new Object[] { objectName, CLASSLOADER },\n"
+" new String[] { ObjectName.class.getName(),\n"
+" \"java.lang.String\" });\n"
+" }\n"
+" \n"
+" if (newCL != null && newCL != oldCL) {\n"
+" thread.setContextClassLoader(newCL);\n"
+" }\n"
+"\n"
+" try {\n"
+" // Set the method hash to Method mapping\n"
+" if (invocation instanceof MarshalledInvocation) {\n"
+" MarshalledInvocation mi = (MarshalledInvocation) "
+"invocation;\n"
+" mi.setMethodMap(marshalledInvocationMapping);\n"
+" }\n"
+"\n"
+" // Invoke the MBeanServer method via reflection\n"
+" Method method = invocation.getMethod();\n"
+" Object[] args = invocation.getArguments();\n"
+" Object value = null;\n"
+" try {\n"
+" String name = method.getName();\n"
+" Class[] sig = method.getParameterTypes();\n"
+" Method mbeanServerMethod =\n"
+" MBeanServer.class.getMethod(name, sig);\n"
+" value = mbeanServerMethod.invoke(server, args);\n"
+" } catch(InvocationTargetException e) {\n"
+" Throwable t = e.getTargetException();\n"
+" if (t instanceof Exception) {\n"
+" throw (Exception) t;\n"
+" } else {\n"
+" throw new UndeclaredThrowableException(t, method.toString"
+"());\n"
+" }\n"
+" }\n"
+"\n"
+" return value;\n"
+" } finally {\n"
+" if (newCL != null && newCL != oldCL) {\n"
+" thread.setContextClassLoader(oldCL);\n"
+" }\n"
+" }\n"
+" }\n"
+"}"
#. Tag: para
#: J2EE_Reference_Introduction.xml:2103
@@ -7704,6 +9876,50 @@
" </mbean>\n"
"</server>"
msgstr ""
+"<server>\n"
+" <!-- The JRMP invoker proxy configuration for the "
+"InvokerAdaptorService -->\n"
+" <mbean code=\"org.jboss.invocation.jrmp.server.JRMPProxyFactory\"\n"
+" name=\"jboss.jmx:type=adaptor,name=Invoker,protocol=jrmp,"
+"service=proxyFactory\">\n"
+" <!-- Use the standard JRMPInvoker from conf/jboss-service.xml --"
+">\n"
+" <attribute name=\"InvokerName\">jboss:service=invoker,"
+"type=jrmp</attribute>\n"
+" <!-- The target MBean is the InvokerAdaptorService configured "
+"below -->\n"
+" <attribute name=\"TargetName\">jboss.jmx:type=adaptor,"
+"name=Invoker</attribute>\n"
+" <!-- Where to bind the RMIAdaptor proxy -->\n"
+" <attribute name=\"JndiName\">jmx/invoker/RMIAdaptor</"
+"attribute>\n"
+" <!-- The RMI compabitle MBeanServer interface -->\n"
+" <attribute name=\"ExportedInterface\">org.jboss.jmx.adaptor."
+"rmi.RMIAdaptor</attribute>\n"
+" <attribute name=\"ClientInterceptors\">\n"
+" <iterceptors>\n"
+" <interceptor>org.jboss.proxy."
+"ClientMethodInterceptor</interceptor>\n"
+" <interceptor>\n"
+" org.jboss.jmx.connector.invoker.client."
+"InvokerAdaptorClientInterceptor \n"
+" </interceptor>\n"
+" <interceptor>org.jboss.invocation."
+"InvokerInterceptor</interceptor>\n"
+" </iterceptors>\n"
+" </attribute>\n"
+" <depends>jboss:service=invoker,type=jrmp</depends>\n"
+" </mbean> \n"
+" <!-- This is the service that handles the RMIAdaptor invocations by "
+"routing\n"
+" them to the MBeanServer the service is deployed under. -->\n"
+" <mbean code=\"org.jboss.jmx.connector.invoker.InvokerAdaptorService"
+"\" \n"
+" name=\"jboss.jmx:type=adaptor,name=Invoker\">\n"
+" <attribute name=\"ExportedInterface\">org.jboss.jmx.adaptor."
+"rmi.RMIAdaptor</attribute>\n"
+" </mbean>\n"
+"</server>"
#. Tag: para
#: J2EE_Reference_Introduction.xml:2138
@@ -8354,6 +10570,19 @@
" marshalledInvocationMapping.put(hash, method);\n"
"}"
msgstr ""
+"import java.lang.reflect.Method;\n"
+"import java.util.HashMap;\n"
+"import org.jboss.invocation.MarshalledInvocation;\n"
+"\n"
+"HashMap marshalledInvocationMapping = new HashMap();\n"
+"\n"
+"// Build the Naming interface method map\n"
+"Method[] methods = SRPRemoteServerInterface.class.getMethods();\n"
+"for(int m = 0; m < methods.length; m ++) {\n"
+" Method method = methods[m];\n"
+" Long hash = new Long(MarshalledInvocation.calculateHash(method));\n"
+" marshalledInvocationMapping.put(hash, method);\n"
+"}"
#. Tag: para
#: J2EE_Reference_Introduction.xml:2420
@@ -8405,6 +10634,37 @@
" return value;\n"
"}"
msgstr ""
+"import org.jboss.invocation.Invocation;\n"
+"import org.jboss.invocation.MarshalledInvocation;\n"
+"\n"
+"public Object invoke(Invocation invocation)\n"
+" throws Exception\n"
+"{\n"
+" SRPRemoteServerInterface theServer = <"
+"the_actual_rmi_server_object>;\n"
+" // Set the method hash to Method mapping\n"
+" if (invocation instanceof MarshalledInvocation) {\n"
+" MarshalledInvocation mi = (MarshalledInvocation) invocation;\n"
+" mi.setMethodMap(marshalledInvocationMapping);\n"
+" }\n"
+"\n"
+" // Invoke the Naming method via reflection\n"
+" Method method = invocation.getMethod();\n"
+" Object[] args = invocation.getArguments();\n"
+" Object value = null;\n"
+" try {\n"
+" value = method.invoke(theServer, args);\n"
+" } catch(InvocationTargetException e) {\n"
+" Throwable t = e.getTargetException(); \n"
+" if (t instanceof Exception) {\n"
+" throw (Exception) e;\n"
+" } else {\n"
+" throw new UndeclaredThrowableException(t, method.toString());\n"
+" }\n"
+" }\n"
+"\n"
+" return value;\n"
+"}"
#. Tag: para
#: J2EE_Reference_Introduction.xml:2428
@@ -8432,6 +10692,19 @@
"attribute>\n"
"</mbean>"
msgstr ""
+"<!-- Expose the SRP service interface via HTTP -->\n"
+"<mbean code=\"org.jboss.invocation.http.server.HttpProxyFactory\"\n"
+" name=\"jboss.security.tests:service=SRP/HTTP\">\n"
+" <attribute name=\"InvokerURL\">http://localhost:8080/invoker/"
+"JMXInvokerServlet</attribute>\n"
+" <attribute name=\"InvokerName\">jboss.security.tests:"
+"service=SRPService</attribute>\n"
+" <attribute name=\"ExportedInterface\">\n"
+" org.jboss.security.srp.SRPRemoteServerInterface\n"
+" </attribute>\n"
+" <attribute name=\"JndiName\">srp-test-http/SRPServerInterface</"
+"attribute>\n"
+"</mbean>"
#. Tag: para
#: J2EE_Reference_Introduction.xml:2434
More information about the jboss-cvs-commits
mailing list