<?xml version="1.0" encoding="UTF-8" ?>

	<!--
		/* * ModeShape (http://www.modeshape.org) * See the COPYRIGHT.txt file
		distributed with this work for information * regarding copyright
		ownership. Some portions may be licensed * to Red Hat, Inc. under one
		or more contributor license agreements. * See the AUTHORS.txt file in
		the distribution for a full listing of * individual contributors. * *
		ModeShape is free software. Unless otherwise indicated, all code in *
		ModeShape is licensed to you under the terms of the GNU Lesser General
		Public License as * published by the Free Software Foundation; either
		version 2.1 of * the License, or (at your option) any later version. *
		* ModeShape is distributed in the hope that it will be useful, * but
		WITHOUT ANY WARRANTY; without even the implied warranty of *
		MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
		Lesser General Public License for more details. * * You should have
		received a copy of the GNU Lesser General Public * License along with
		this software; if not, write to the Free * Software Foundation, Inc.,
		51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the
		FSF site: http://www.fsf.org. */
	-->

<plugin name="ModeShapePlugin" displayName="ModeShape Plugin"
	package="org.modeshape.rhq.plugin" version="1.0.1"
	description="Supports management and monitoring of ModeShape"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:xmlns:rhq-plugin"
	xmlns:c="urn:xmlns:rhq-configuration">

	<depends plugin="JBossAS5" useClasses="true" />

	<server name="ModeShape Engine" description="ModeShape JCR Engine"
		class="EngineComponent" discovery="EngineDiscoveryComponent"
		singleton="true">

		<runs-inside>
			<parent-resource-type name="JBossAS Server"
				plugin="JBossAS5" />
		</runs-inside>

		<operation name="restart" displayName="Start/restart"
			description="Start the engine or restart if it's already running">
		</operation>

		<operation name="shutdown" displayName="Shutdown"
			description="Shutdown the engine">
		</operation>

		<service name="Repositories" description="ModeShape Repositories"
			class="RepositoryComponent" discovery="RepositoryDiscoveryComponent">
			
			<metric displayName="Total Active Sessions" defaultOn="true"
                displayType="detail" category="utilization" property="getActiveSessions"
                description="The number of JCR sessions that are currently active" />
			
			<resource-configuration>
                <c:list-property name="propertyList" displayName="Properties"
                    description="Properties for this sequencer" readOnly="true">
                    <c:map-property name="map" description="Properties for this sequencer"
                        readOnly="true">
                        <c:simple-property name="label" displayName="Name"
                            description="The name of this property" required="false"
                            readOnly="true" />
                        <c:simple-property name="value" displayName="Value"
                            description="The value of this property" required="false"
                            readOnly="true" />
                      </c:map-property>
                </c:list-property>
            </resource-configuration>
		</service>

		<service name="Sequencing Service" description="ModeShape Sequencing Service"
			singleton="true" class="SequencingServiceComponent" discovery="SequencingServiceDiscoveryComponent">

			<metric displayName="Number Of Nodes Sequenced" defaultOn="true"
				displayType="detail" category="throughput" property="getNodesSequencedCount"
				description="The number of nodes sequenced" />

			<metric displayName="Number Of Nodes Skipped" defaultOn="true"
				displayType="detail" category="throughput" property="getNodesSkippedCount"
				description="The number of nodes that were skipped because no sequencers applied" />

		</service>

		<service name="Sequencers" description="Sequencers deployed to this ModeShape instance"
			class="SequencerComponent" discovery="SequencerDiscoveryComponent">

			<resource-configuration>
				<c:list-property name="propertyList" displayName="Properties"
					description="Properties for this sequencer" readOnly="true">
					<c:map-property name="map" description="Properties for this sequencer"
						readOnly="true">
						<c:simple-property name="label" displayName="Name"
							description="The name of this property" required="false"
							readOnly="true" />
						<c:simple-property name="value" displayName="Value"
							description="The value of this property" required="false"
							readOnly="true" />
						<c:simple-property name="description"
							displayName="Description" description="The description of this property"
							required="false" readOnly="true" />
					</c:map-property>
				</c:list-property>
			</resource-configuration>

		</service>

		<service name="Connectors" description="Connectors for repository"
			class="ConnectorComponent" discovery="ConnectorDiscoveryComponent">

			<operation name="pingConnector" displayName="Ping"
				description="Ping the connector to test availability">
				<results>
					<c:simple-property displayName="Connector Available" name="operationResult" type="boolean" description="yes if ping was successsful" />
				</results>
			</operation>
			
			<metric displayName="Total Connections in Use" defaultOn="true"
                displayType="detail" category="utilization" property="getInUseConnections"
                description="The number of connections in use" />
                
            <resource-configuration>
				<c:list-property name="connectorPropertyList"
					displayName="Connector Properties" description="Properties for this connector"
					readOnly="true">
					<c:map-property name="map" description="Properties for this connector"
						readOnly="true">
						<c:simple-property name="label" displayName="Name"
							description="The name of this property" required="false"
							readOnly="true" />
						<c:simple-property name="value" displayName="Value"
							description="The value of this property" required="false"
							readOnly="true" />
						<c:simple-property name="description"
							displayName="Description" description="The description of this property"
							required="false" readOnly="true" />
					</c:map-property>
				</c:list-property>
				<c:list-property name="connectionpoolPropertyList"
					displayName="Connection Pool Properties" description="Properties for this connector's connection pool"
					readOnly="true">
					<c:map-property name="map"
						description="Properties for this connector's connection pool"
						readOnly="true">
						<c:simple-property name="label" displayName="Name"
							description="The name of this property" required="false"
							readOnly="true" />
						<c:simple-property name="value" displayName="Value"
							description="The value of this property" required="false"
							readOnly="true" />
						<c:simple-property name="description"
							displayName="Description" description="The description of this property"
							required="false" readOnly="true" />
					</c:map-property>
				</c:list-property>
			</resource-configuration>

		</service>

	</server>

</plugin>