JMX Code Generation Module

Public Targets

TargetDescription
gen.jmxgenerate jmx code

Source: jmx.xml

				<?xml version="1.0" encoding="UTF-8"?>
<project name="jmx">
	<description>
  + ==\_/============J=A=V=A=G=E=N===A=N=T===M=O=D=U=L=E=S================= +
  +  \(_)/                                                                  +
  +  -(_)-                JMX Code Generation Module                        +
  +  /(_)\                                                                  +
  + ======================================================================= +
  +    Copyright (c) 2002-2005 Outsource Cafe, Inc.  All rights reserved.   +
  + ======================================================================= +
  +
  + JMX code generation support. This file defines a macro that wraps 
  + jmxdoclet XDoclet task and a default 'jmxdoclet' target. 
  + Files to process are determined by the 'jmx.include' naming
  + pattern properties.  The default naming pattern is '**/jmx/*.java'.
  +
  + Public targets: 
  +   gen.jmx - generate jmx code
  +
  + Prerequisite imports: 
  +   props-maven.xml, props-global.xml, classpath.xml
  +
  + Optional properties:
  +   jmx.include - patternset to identify JMX source
  +
  + Todo:
  +   uptodate target
  +
  + developer: RichardEasterling@OutsourceCafe.com
  + ======================================================================= +
  + Licensed under the Apache License, Version 2.0 (the "License");
  + you may not use this file except in compliance with the License.
  + You may obtain a copy of the License at
  +
  +   http://www.apache.org/licenses/LICENSE-2.0
  +
  + Unless required by applicable law or agreed to in writing, software
  + distributed under the License is distributed on an "AS IS" BASIS,
  + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  + See the License for the specific language governing permissions and
  + limitations under the License.
  + =J=A=M===========================================J=A=V=A=G=E=N=.=C=O=M= +
	</description>
	<taskdef name="jmxdoclet" classname="xdoclet.modules.jmx.JMXDocletTask" classpathref="xdoclet.classpath"></taskdef>
	<!-- =================================================================== -->
	<!-- Public target -->
	<!-- =================================================================== -->
	<target name="gen.jmx" depends="jmxdoclet" description="generate jmx code"></target>
	<!-- ===================================================================== -->
	<!-- patternset to identify JMX source -->
	<!-- ===================================================================== -->
	<property name="jmx.build.dir" location="${build.dir}/jmx"></property>
	<property name="jmx.dist.name" value="${module.name}-${module.version}.sar"></property>
	<property name="jmx.include" value="**/jmx/*.java"></property>
	<property name="jmx.move" value="**/jmx/*"></property>
	<!-- ===================================================================== -->
	<!-- sanity checks -->
	<!-- ===================================================================== -->
	<fail unless="CLASSPATH.PRESENT" message="classpath.xml must be imported before jmx.xml in build file.  Regeneration of classpath.xml required when upgrading to JAM 2.1. Type: maven javagen:classpath"></fail>
	<fail unless="PROPS-GLOBAL.PRESENT" message="props-global.xml must be imported before jmx.xml in build file."></fail>
	<!-- ===================================================================== -->
	<!-- build JBoss sar distribution -->
	<!-- ===================================================================== -->
	<target name="dist.jmx">
		<mkdir dir="${jmx.build.dir}"></mkdir>
		<move todir="${jmx.build.dir}" includeemptydirs="false" failonerror="false">
			<fileset dir="${build.classes.dir}">
				<include name="${jmx.move}"></include>
			</fileset>
		</move>
		<delete file="${dist.dir}/${jmx.dist.name}"></delete>
		<mkdir dir="${dist.dir}"></mkdir>
		<jar jarfile="${dist.dir}/${jmx.dist.name}">
			<fileset dir="${jmx.build.dir}" includes="**"></fileset>
		</jar>
	</target>
	<!-- ===================================================================== -->
	<!-- default jmx.macro invocation -->
	<!-- ===================================================================== -->
	<target name="jmxdoclet">
		<jmx.macro>
			<fileset.tag>
				<fileset dir="${src.java.dir}">
					<include name="${jmx.include}"></include>
				</fileset>
				<fileset dir="${gen.java.dir}">
					<include name="${jmx.include}"></include>
				</fileset>
			</fileset.tag>
			<subtask.tag>
				<!-- 
				<mx4jdescription/>
	        <jbossxmldoc/>
				-->
			</subtask.tag>
		</jmx.macro>
	</target>
	<!-- =================================================================== -->
	<!-- jmx macro wrapping jmxdoclet -->
	<!-- =================================================================== -->
	<macrodef name="jmx.macro">
		<attribute name="servicefile" default="jboss"></attribute>
		<attribute name="java.dir" default="${xdoclet.build.java.dir}"></attribute>
		<attribute name="metainf.dir" default="${jmx.build.dir}/META-INF"></attribute>
		<attribute name="merge.dir" default="${xdoclet.merge.dir}"></attribute>
		<element name="fileset.tag" optional="no"></element>
		<element name="subtask.tag" optional="yes"></element>
		<sequential>
			<echo>JMX.MACRO</echo>
			<mkdir dir="@{java.dir}"></mkdir>
			<mkdir dir="@{metainf.dir}"></mkdir>
			<jmxdoclet destdir="@{java.dir}" mergeDir="@{merge.dir}">
				<fileset.tag></fileset.tag>
				<mbeaninterface></mbeaninterface>
				<mlet destdir="@{metainf.dir}"></mlet>
				<jbossxmbean destdir="@{java.dir}"></jbossxmbean>
				<jbossxmlservicetemplate servicefile="@{servicefile}" destdir="@{metainf.dir}"></jbossxmlservicetemplate>
				<subtask.tag></subtask.tag>
			</jmxdoclet>
		</sequential>
	</macrodef>
</project>