This file is indexed.

/usr/share/java/libcommons-modeler-java/api/org/apache/commons/modeler/package-summary.html is in libcommons-modeler-java-doc 2.0.1-7.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_79) on Thu Jun 04 07:23:45 UTC 2015 -->
<title>org.apache.commons.modeler (Model MBeans Support Package (Version 2.0.1))</title>
<meta name="date" content="2015-06-04">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="org.apache.commons.modeler (Model MBeans Support Package (Version 2.0.1))";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev Package</li>
<li><a href="../../../../org/apache/commons/modeler/ant/package-summary.html">Next Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/commons/modeler/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 title="Package" class="title">Package&nbsp;org.apache.commons.modeler</h1>
<div class="docSummary">
<div class="block">The <em>Modeler</em> component of the Jakarta Commons subproject
offers convenient support for configuring and instantiating Model MBeans
(management beans), as described in the JMX Specification.</div>
</div>
<p>See:&nbsp;<a href="#package_description">Description</a></p>
</div>
<div class="contentContainer">
<ul class="blockList">
<li class="blockList">
<table class="packageSummary" border="0" cellpadding="3" cellspacing="0" summary="Interface Summary table, listing interfaces, and an explanation">
<caption><span>Interface Summary</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Interface</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/commons/modeler/RegistryMBean.html" title="interface in org.apache.commons.modeler">RegistryMBean</a></td>
<td class="colLast">
<div class="block">Interface for modeler MBeans.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="packageSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation">
<caption><span>Class Summary</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/commons/modeler/AttributeInfo.html" title="class in org.apache.commons.modeler">AttributeInfo</a></td>
<td class="colLast">
<div class="block">Internal configuration information for an <code>Attribute</code>
 descriptor.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/commons/modeler/BaseAttributeFilter.html" title="class in org.apache.commons.modeler">BaseAttributeFilter</a></td>
<td class="colLast">
<div class="block">Implementation of <code>NotificationFilter</code> for attribute change
 notifications.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/commons/modeler/BaseModelMBean.html" title="class in org.apache.commons.modeler">BaseModelMBean</a></td>
<td class="colLast">
<div class="block">Basic implementation of the <code>ModelMBean</code> interface, which
 supports the minimal requirements of the interface contract.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/commons/modeler/BaseModelMBean.MethodKey.html" title="class in org.apache.commons.modeler">BaseModelMBean.MethodKey</a></td>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/commons/modeler/BaseNotification.html" title="class in org.apache.commons.modeler">BaseNotification</a></td>
<td class="colLast">
<div class="block">Base JMX Notification.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/commons/modeler/BaseNotificationBroadcaster.html" title="class in org.apache.commons.modeler">BaseNotificationBroadcaster</a></td>
<td class="colLast">
<div class="block">Implementation of <code>NotificationBroadcaster</code> for attribute
 change notifications.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/commons/modeler/BaseNotificationBroadcasterEntry.html" title="class in org.apache.commons.modeler">BaseNotificationBroadcasterEntry</a></td>
<td class="colLast">
<div class="block">Utility class representing a particular registered listener entry.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/commons/modeler/ConstructorInfo.html" title="class in org.apache.commons.modeler">ConstructorInfo</a></td>
<td class="colLast">
<div class="block">Internal configuration information for a <code>Constructor</code>
 descriptor.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/commons/modeler/FeatureInfo.html" title="class in org.apache.commons.modeler">FeatureInfo</a></td>
<td class="colLast">
<div class="block">Convenience base class for <code>AttributeInfo</code>,
 <code>ConstructorInfo</code>, and <code>OperationInfo</code> classes
 that will be used to collect configuration information for the
 <code>ModelMBean</code> beans exposed for management.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/commons/modeler/FieldInfo.html" title="class in org.apache.commons.modeler">FieldInfo</a></td>
<td class="colLast">
<div class="block">Simple JavaBean representing the contents of a <code>&lt;field&gt;</code>
 element in an MBeans descriptor file.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/commons/modeler/FixedNotificationFilter.html" title="class in org.apache.commons.modeler">FixedNotificationFilter</a></td>
<td class="colLast">
<div class="block">Special NotificationFilter that allows modeler to optimize its notifications.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/commons/modeler/JndiJmx.html" title="class in org.apache.commons.modeler">JndiJmx</a></td>
<td class="colLast">
<div class="block">Link between JNDI and JMX.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/commons/modeler/Main.html" title="class in org.apache.commons.modeler">Main</a></td>
<td class="colLast">
<div class="block">Small main that loads mbeans.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/commons/modeler/ManagedBean.html" title="class in org.apache.commons.modeler">ManagedBean</a></td>
<td class="colLast">
<div class="block">Internal configuration information for a managed bean (MBean)
 descriptor.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/commons/modeler/NotificationInfo.html" title="class in org.apache.commons.modeler">NotificationInfo</a></td>
<td class="colLast">
<div class="block">Internal configuration information for a <code>Notification</code>
 descriptor.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/commons/modeler/OperationInfo.html" title="class in org.apache.commons.modeler">OperationInfo</a></td>
<td class="colLast">
<div class="block">Internal configuration information for an <code>Operation</code>
 descriptor.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/commons/modeler/ParameterInfo.html" title="class in org.apache.commons.modeler">ParameterInfo</a></td>
<td class="colLast">
<div class="block">Internal configuration information for a <code>Parameter</code>
 descriptor.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/commons/modeler/Registry.html" title="class in org.apache.commons.modeler">Registry</a></td>
<td class="colLast">
<div class="block">Registry for modeler MBeans.</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
<a name="package_description">
<!--   -->
</a>
<h2 title="Package org.apache.commons.modeler Description">Package org.apache.commons.modeler Description</h2>
<div class="block"><p>The <em>Modeler</em> component of the Jakarta Commons subproject
offers convenient support for configuring and instantiating Model MBeans
(management beans), as described in the JMX Specification.  It is typically
used within a server-based application that wants to expose management
features via JMX.  See the
<a href="http://java.sun.com/products/JavaManagement/download.html">
JMX Specification (Version 1.1)</a> for more information about Model MBeans
and other JMX concepts.</p>

<p>Model MBeans are very powerful - and the JMX specification includes a
mechanism to use a standard JMX-provided base class to satisfy many of the
requirements, without having to create custom Model MBean implementation
classes yourself.  However, one of the requirements in creating such a
Model MBean is to create the corresponding metadata information (i.e. an
implementation of the
<code>javax.management.modelmbean.ModelMBeanInfo</code> interface and its
corresponding subordinate interfaces).  Creating this information can be
tedious and error prone.  The <em>Modeler</em> package makes the process
much simpler, because the required information is constructed dynamically
from an easy-to-understand XML description of the metadata.  Once you have
the metadata defined, and registered at runtime in the provided
<a href="Registry.html">Registry</a>, <em>Modeler</em> also supports
convenient factory methods to instantiate new Model MBean instances for you.
</p>

<p>The steps required to use Modeler in your server-based application are
described in detail below.  You can find some simple usage code in the unit
tests that come with Modeler (in the <code>src/test</code> subdirectory of the
source distribution), and much more complex usage code in Tomcat 4.1 (in the
<code>org.apache.catalina.mbeans</code> package).</p>. More advanced uses can
be found in Tomcat 5 and jakarta-tomcat-connectors.


<h3>1.  Acquire a JMX Implementation</h3>

<p><em>Modeler</em> has been tested with different JMX implementations:
<ul>
<li>JMX Reference Implementation (version 1.0.1 or later) -
    <a href="http://java.sun.com/products/JavaManagement/download.html">
    http://java.sun.com/products/JavaManagement/download.html</a></li>
<li>MX4J (version 1.1 or later) -
    <a href="http://mx4j.sourceforge.net/">http://mx4j.sourceforge.net</a></li>
<li>JBoss MX
    <a href="http://www.jboss.org/">http://www.jboss.org</a></li>
</ul>

<p>After unpacking the release, you will need to ensure that the appropriate
JAR file (<code>jmxri.jar</code> or <code>mx4j.jar</code>) is included on your
compilation classpath, and in the classpath of your server application when it
is executed.</p>


<h3>2.  Create a Modeler Configuration File</h3>

<p><em>Modeler</em> requires that you construct a configuration file that
describes the metadata ultimately need to construct the
<code>javax.management.modelmbean.ModelMBeanInfo</code> structure that is
required by JMX.  Your XML file must conform to the
<a href="../../../../../../mbeans-descriptors.dtd">mbeans-descriptors.dtd</a>
DTD that defines the acceptable structure.</p>

<p>Fundamentally, you will be constructing an <code>&lt;mbean&gt;</code>
element for each type of Model MBean that a registry will know how to create.
Nested within this element will be other elements describing the constructors,
attributes, operations, and notifications associated with this MBean.  See
the comments in the DTD for detailed information about the valid attributes
and their meanings.</p>

<p>A simple example configuration file might include the following components
(abstracted from the real definitions found in Tomcat 4.1's use of Modeler):
</p>
<pre>

  &lt;?xml version="1.0"?&gt;
  &lt;!DOCTYPE mbeans-descriptors PUBLIC
   "-//Apache Software Foundation//DTD Model MBeans Configuration File"
   "http://jakarta.apache.org/commons/dtds/mbeans-descriptors.dtd"&gt;

  &lt;mbeans-descriptors&gt;

    &lt;!-- ... other MBean definitions ... --&gt;

    &lt;mbean         name="Group"
              className="org.apache.catalina.mbeans.GroupMBean"
            description="Group from a user database"
                 domain="Users"
                  group="Group"
                   type="org.apache.catalina.Group"&gt;

      &lt;attribute   name="description"
            description="Description of this group"
                   type="java.lang.String"/&gt;

      &lt;attribute   name="groupname"
            description="Group name of this group"
                   type="java.lang.String"/&gt;

      &lt;attribute   name="roles"
            description="MBean Names of roles for this group"
                   type="java.lang.String[]"
              writeable="false"/&gt;

      &lt;attribute   name="users"
            description="MBean Names of user members of this group"
                   type="java.lang.String[]"
              writeable="false"/&gt;

      &lt;operation   name="addRole"
            description="Add a new authorized role for this group"
                 impact="ACTION"
             returnType="void"&gt;
        &lt;parameter name="role"
            description="Role to be added"
                   type="java.lang.String"/&gt;
      &lt;/operation&gt;

      &lt;operation   name="removeRole"
            description="Remove an old authorized role for this group"
                 impact="ACTION"
             returnType="void"&gt;
        &lt;parameter name="role"
            description="Role to be removed"
                   type="java.lang.String"/&gt;
      &lt;/operation&gt;

      &lt;operation   name="removeRoles"
            description="Remove all authorized roles for this group"
                 impact="ACTION"
             returnType="void"&gt;
      &lt;/operation&gt;

    &lt;/mbean&gt;

    &lt;!-- ... other MBean definitions ... --&gt;

  &lt;/mbeans-descriptors&gt;

</pre>

<p>This MBean represents an instance of <em>org.apache.catalina.Group</em>,
which is an entity representing a group of users (with a shared set of security
roles that all users in the group inherit) in a user database.  This MBean
advertises support for four attributes (description, groupname, roles, and
users) that roughly correspond to JavaBean properties.  By default, attributes
are assumed to have read/write access.  For this particular MBean, the roles
and users attributes are read-only (<code>writeable="false"</code>).  Finally,
this MBean supports three operations (addRole, removeRole, and
removeRoles) that roughly correspond to JavaBean methods on the underlying
component.</p>

<p>In general, <em>Modeler</em> provides a standard ModelMBean implementation
that simply passes on JMX calls on attributes and operations directly through
to the managed component that the ModelMBean is associated with.  For special
case requirements, you can define a subclass of
<a href="BaseModelMBean.html">BaseModelMBean</a> that provides override
methods for one or more of these attributes (i.e. the property getter and/or
setter methods) and operations (i.e. direct method calls).

<p>For this particular MBean, a custom BaseModelMBean implementation subclass
is described (<code>org.apache.catalina.mbeans.GroupMBean</code>) is
configured.  It was necessary in this particular case because several of the
underlying Catalina component's methods deal with internal objects or arrays of
objects, rather than just the Strings and primitives that are supported by all
JMX clients.  Thus, the following method on the <code>Group</code> interface:
</p>
<pre>
    public void addRole(Role role);
</pre>
<p>is represented, in the MBean, by an <code>addRole</code> method that takes
a String argument representing the role name of the required role.  The MBean's
implementation class acts as an adapter, and looks up the required Role
object (by name) before calling the <code>addRole</code> method on the
underlying <code>Group</code> instance within the Server.</p>


<h3>3.  Create Modeler Registry at Startup Time</h3>

<p>The metadata information, and the corresponding Model MBean factory, is
represented at runtime in an instance of <a href="Registry.html">Registry</a>
whose contents are initialized from the configuration file prepared as was
described above.  Typically, such a file will be included in the JAR file
containing the MBean implementation classes themselves, and loaded as follows:
</p>
<pre>
    URL url= this.getClass().getResource
      ("/com/mycompany/mypackage/mbeans-descriptors.xml");
    Registry registry = Registry.getRegistry();
    registry.loadMetadata(url);
</pre>

<p>Besides using the configuration file, it is possible to configure the
registry metadata by hand, using the <code>addManagedBean()</code> and
<code>removeManagedBean()</code> methods.  However, most users will find
the standard support for loading a configuration file to be convenient
and sufficient.</p>

<p>Modeler will also look for a mbeans-descriptors.xml in the same package
with the class beeing registered and in its parent. If no metadata is found,
modeler will use a number of simple patterns, similar with the ones used by 
ant, to determine a reasonable metadata</p>

<p>In a future version we should also support xdoclet-based generation of the
descriptors</p>


<h3>4.  Instantiate Model MBeans As Needed</h3>

<p>When your server application needs to instantiate a new MBean and register
it with the corresponding <code>MBeanServer</code>, it can execute code like
this:</p>

<pre>
  Group group = ... managed component instance ...;

  MBeanServer mserver = registry.getMBeanServer();

  String oname="myDomain:type=Group,name=myGroup";

  registry.registerComponent( group, oname, "Group" );
</pre>

<p>After the Model MBean has been created and registered, it is accessible to
JMX clients through the standard JMX client APIs.
</p></div>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev Package</li>
<li><a href="../../../../org/apache/commons/modeler/ant/package-summary.html">Next Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/commons/modeler/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright (c) 2001-2003 - Apache Software Foundation</small></p>
</body>
</html>