1 <?xml version='1.0' encoding='UTF-8'?>
   2 <!--   
   3    Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
   4    
   5    DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   6    
   7    The contents of this file are subject to the terms of either the Universal Permissive License 
   8    v 1.0 as shown at http://oss.oracle.com/licenses/upl
   9    
  10    or the following license:
  11    
  12    Redistribution and use in source and binary forms, with or without modification, are permitted
  13    provided that the following conditions are met:
  14    
  15    1. Redistributions of source code must retain the above copyright notice, this list of conditions
  16    and the following disclaimer.
  17    
  18    2. Redistributions in binary form must reproduce the above copyright notice, this list of
  19    conditions and the following disclaimer in the documentation and/or other materials provided with
  20    the distribution.
  21    
  22    3. Neither the name of the copyright holder nor the names of its contributors may be used to
  23    endorse or promote products derived from this software without specific prior written permission.
  24    
  25    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
  26    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  27    FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  28    CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  29    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  30    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  31    WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
  32    WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  33 -->
  34 <schema targetNamespace="org.openjdk.jmc.ui.common" xmlns="http://www.w3.org/2001/XMLSchema">
  35 <annotation>
  36       <appInfo>
  37          <meta.schema plugin="org.openjdk.jmc.ui.common" id="labelingRules" name="Labeling Rules"/>
  38       </appInfo>
  39       <documentation>
  40          Provides rules on how create labels.
  41       </documentation>
  42    </annotation>
  43 
  44    <element name="extension">
  45       <annotation>
  46          <appInfo>
  47             <meta.element />
  48          </appInfo>
  49       </annotation>
  50       <complexType>
  51          <sequence minOccurs="1" maxOccurs="unbounded">
  52             <element ref="rule"/>
  53          </sequence>
  54          <attribute name="point" type="string" use="required">
  55             <annotation>
  56                <documentation>
  57                   
  58                </documentation>
  59             </annotation>
  60          </attribute>
  61          <attribute name="id" type="string">
  62             <annotation>
  63                <documentation>
  64                   
  65                </documentation>
  66             </annotation>
  67          </attribute>
  68          <attribute name="name" type="string">
  69             <annotation>
  70                <documentation>
  71                   
  72                </documentation>
  73                <appInfo>
  74                   <meta.attribute translatable="true"/>
  75                </appInfo>
  76             </annotation>
  77          </attribute>
  78       </complexType>
  79    </element>
  80 
  81    <element name="rule">
  82       <complexType>
  83          <attribute name="name" type="string" use="required">
  84             <annotation>
  85                <documentation>
  86                   The user friendly name that identifies the rule. For instance used in error messages.
  87                </documentation>
  88             </annotation>
  89          </attribute>
  90          <attribute name="match" type="string" use="required">
  91             <annotation>
  92                <documentation>
  93                   The matching expression for enabling this visualizer. Matching expressions are evaluated by expanding all variables and then matching the regular expression on the right of the equals sign with the string gathered from the connection descriptor on the left.
  94 
  95 Example:
  96 {PID}{Name} = {ThisPID}.*org.eclipse.equinox.launcher_.*
  97 
  98 Would match if the class name appended to the pid would match the regular expression starting with the PID of the process running MissionControl then following by something containing the string .*org.eclipse.equinox.launcher_.*. In other words, it would match if we were connected to ourselves AND running Eclipse.
  99 
 100 These are well known variables:
 101 Name  Comment  Example
 102 ThisPID  Contains the PID of the JVM currently running Mission Control  4711
 103 PID  Contains the PID of the JVM represented by the connection descriptor.  4712
 104 JDK  Contains the JDK level.  1.5
 105 Name  The name of the class running in the JVM.  org.openjdk.jmc.rcp.start.MCMain
 106                </documentation>
 107             </annotation>
 108          </attribute>
 109          <attribute name="format" type="string" use="required">
 110             <annotation>
 111                <documentation>
 112                   The formatting expression deciding how to visualize the name of the ConnectionDescriptor. The same variables as the ones in the matching expression can be used.
 113 
 114 Example:
 115 This Mission Control ({PID})
 116 
 117 The expression above would print This Mission Control followed by the PID, for example &quot;This Mission Control (3412)&quot;.
 118                </documentation>
 119             </annotation>
 120          </attribute>
 121          <attribute name="priority" type="string" use="default" value="500">
 122             <annotation>
 123                <documentation>
 124                   The priority decides in what order the rules are applied.  The higher the value, the higher the priority. The default value is 500. The default catch-it-all-rule will have a priority of 0.
 125                </documentation>
 126             </annotation>
 127          </attribute>
 128          <attribute name="icon" type="string">
 129             <annotation>
 130                <documentation>
 131                   Optional icon resource to use when visualizing the connection descriptor.
 132                </documentation>
 133                <appInfo>
 134                   <meta.attribute kind="resource"/>
 135                </appInfo>
 136             </annotation>
 137          </attribute>
 138       </complexType>
 139    </element>
 140 
 141    <annotation>
 142       <appInfo>
 143          <meta.section type="since"/>
 144       </appInfo>
 145       <documentation>
 146          5.2.0
 147       </documentation>
 148    </annotation>
 149 
 150    <annotation>
 151       <appInfo>
 152          <meta.section type="examples"/>
 153       </appInfo>
 154       <documentation>
 155          &lt;extension
 156          point=&quot;org.openjdk.jmc.ui.descriptor.visualizer&quot;&gt;
 157       &lt;visualizer
 158         name=&quot;JMC in Eclipse&quot;
 159    format=&quot;{StrDebug}{StrJVMType} The JVM Running Mission Control&quot;
 160             icon=&quot;appicons/Eclipse.png&quot;
 161             match=&quot;{PID}{Name}={ThisPID}.*org.eclipse.equinox.launcher_.*&quot;
 162             priority=&quot;910&quot;&gt;
 163       &lt;/visualizer&gt;
 164 &lt;/extension&gt;
 165       </documentation>
 166    </annotation>
 167 
 168 
 169    <annotation>
 170       <appInfo>
 171          <meta.section type="implementation"/>
 172       </appInfo>
 173       <documentation>
 174          Implementation note: should we ever grow beyond the capabilities of this, we can always add an optional class attribute taking an 
 175 
 176 interface IConnectionDescriptorVisualizer {
 177 boolean match(IConnectionDescriptor);
 178 String format(IConnectionDescriptor);
 179 Image getIcon();
 180 }
 181 
 182 To which all the important decisions are delegated.
 183       </documentation>
 184    </annotation>
 185 
 186    <annotation>
 187       <appInfo>
 188          <meta.section type="copyright"/>
 189       </appInfo>
 190       <documentation>
 191          Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
 192       </documentation>
 193    </annotation>
 194 
 195 </schema>