[jboss-cvs] JBossAS SVN: r73467 - in projects/jboss-man/tags: 2.0.0.Beta13 and 8 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Sat May 17 11:31:22 EDT 2008
Author: scott.stark at jboss.org
Date: 2008-05-17 11:31:22 -0400 (Sat, 17 May 2008)
New Revision: 73467
Added:
projects/jboss-man/tags/2.0.0.Beta13/
projects/jboss-man/tags/2.0.0.Beta13/build/pom.xml
projects/jboss-man/tags/2.0.0.Beta13/managed/pom.xml
projects/jboss-man/tags/2.0.0.Beta13/managed/src/main/org/jboss/managed/api/ManagedDeployment.java
projects/jboss-man/tags/2.0.0.Beta13/managed/src/main/org/jboss/managed/api/annotation/ManagementDeployment.java
projects/jboss-man/tags/2.0.0.Beta13/managed/src/main/org/jboss/managed/api/annotation/ManagementParameter.java
projects/jboss-man/tags/2.0.0.Beta13/managed/src/main/org/jboss/managed/plugins/factory/AbstractManagedObjectFactory.java
projects/jboss-man/tags/2.0.0.Beta13/managed/src/tests/org/jboss/test/managed/factory/support/deployment/
projects/jboss-man/tags/2.0.0.Beta13/managed/src/tests/org/jboss/test/managed/factory/test/ManagementDeploymentUnitTestCase.java
projects/jboss-man/tags/2.0.0.Beta13/metatype/pom.xml
projects/jboss-man/tags/2.0.0.Beta13/pom.xml
Removed:
projects/jboss-man/tags/2.0.0.Beta13/build/pom.xml
projects/jboss-man/tags/2.0.0.Beta13/managed/pom.xml
projects/jboss-man/tags/2.0.0.Beta13/managed/src/main/org/jboss/managed/api/ManagedDeployment.java
projects/jboss-man/tags/2.0.0.Beta13/managed/src/main/org/jboss/managed/api/annotation/ManagementDeployment.java
projects/jboss-man/tags/2.0.0.Beta13/managed/src/main/org/jboss/managed/api/annotation/ManagementParameter.java
projects/jboss-man/tags/2.0.0.Beta13/managed/src/main/org/jboss/managed/plugins/factory/AbstractManagedObjectFactory.java
projects/jboss-man/tags/2.0.0.Beta13/metatype/pom.xml
projects/jboss-man/tags/2.0.0.Beta13/pom.xml
Log:
[maven-release-plugin] copy for tag 2.0.0.Beta13
Copied: projects/jboss-man/tags/2.0.0.Beta13 (from rev 73452, projects/jboss-man/trunk)
Deleted: projects/jboss-man/tags/2.0.0.Beta13/build/pom.xml
===================================================================
--- projects/jboss-man/trunk/build/pom.xml 2008-05-16 17:46:20 UTC (rev 73452)
+++ projects/jboss-man/tags/2.0.0.Beta13/build/pom.xml 2008-05-17 15:31:22 UTC (rev 73467)
@@ -1,251 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- This pom functions as a default configuration. The subproject
- poms each inherit configuration from this one.
-
- When adding version information for an artifact please do the following
- - add a version property for the specific version
- - add a dependency in the dependencyManagement section which refers to
- the property
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-parent</artifactId>
- <version>3</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.man</groupId>
- <artifactId>jboss-man</artifactId>
- <version>2.0.0-SNAPSHOT</version>
- <packaging>pom</packaging>
- <name>JBoss Managed Build</name>
- <url>http://www.jboss.com/products/jbossmc</url>
- <description>
- JBoss Managed
- </description>
- <scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/jboss-man/trunk/</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/jboss-man/trunk/</developerConnection>
- <url>http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/projects/jboss-man/trunk/</url>
- </scm>
-
- <properties>
- <version.jboss.common.core>2.2.4.GA</version.jboss.common.core>
- <version.jboss.common.logging.spi>2.0.4.GA</version.jboss.common.logging.spi>
- <version.jboss.common.logging.log4j>2.0.4.GA</version.jboss.common.logging.log4j>
- <version.org.jboss.reflect>2.0.0.Beta12</version.org.jboss.reflect>
- <version.org.jboss.test>1.0.5.GA</version.org.jboss.test>
- <version.junit>4.4</version.junit>
- </properties>
-
- <build>
- <sourceDirectory>src/main</sourceDirectory>
- <testSourceDirectory>src/tests</testSourceDirectory>
- <outputDirectory>${microcontainer.outputDirectory}</outputDirectory>
- <testOutputDirectory>${microcontainer.testOutputDirectory}</testOutputDirectory>
- <finalName>${artifactId}</finalName>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- <showDeprecation>true</showDeprecation>
- <showWarnings>true</showWarnings>
- <optimize>true</optimize>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jboss-deploy-plugin</artifactId>
- <version>1.6</version>
- <executions>
- <execution>
- <goals>
- <goal>jboss-deploy</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <jbossDeployRoot>${jboss.repository.root}</jbossDeployRoot>
- </configuration>
- </plugin>
- </plugins>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <id>make-assembly</id>
- <phase>package</phase>
- <goals>
- <goal>attached</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-idea-plugin</artifactId>
- <configuration>
- <downloadSources>true</downloadSources>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <version>2.2</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.4.1</version>
- <configuration>
- <redirectTestOutputToFile>true</redirectTestOutputToFile>
- <includes>
- <include>org/jboss/test/**/*TestCase.java</include>
- </includes>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
- <repositories>
- <repository>
- <id>repository.jboss.org</id>
- <name>JBoss Repository</name>
- <layout>default</layout>
- <url>http://repository.jboss.org/maven2/</url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
- <repository>
- <id>snapshots.jboss.org</id>
- <name>JBoss Snapshots Repository</name>
- <layout>default</layout>
- <url>http://snapshots.jboss.org/maven2/</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- <releases>
- <enabled>false</enabled>
- </releases>
- </repository>
- </repositories>
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-project-info-reports-plugin</artifactId>
- <reportSets>
- <reportSet>
- <reports>
- <report>dependencies</report>
- <report>issue-tracking</report>
- <report>license</report>
- <report>scm</report>
- </reports>
- </reportSet>
- </reportSets>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>findbugs-maven-plugin</artifactId>
- <version>1.0.0</version>
- </plugin>
- </plugins>
- </reporting>
- <dependencyManagement>
- <!-- The parent pom manages the inter-dependencies of the modules. -->
- <dependencies>
- <dependency>
- <groupId>org.jboss.man</groupId>
- <artifactId>jboss-managed</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.man</groupId>
- <artifactId>jboss-metatype</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-common-core</artifactId>
- <version>${version.jboss.common.core}</version>
- </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-common-logging-spi</artifactId>
- <version>${version.jboss.common.logging.spi}</version>
- </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-common-logging-log4j</artifactId>
- <version>${version.jboss.common.logging.log4j}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-reflect</artifactId>
- <version>${version.org.jboss.reflect}</version>
- </dependency>
- <!-- test dependencies -->
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-test</artifactId>
- <version>${version.org.jboss.test}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${version.junit}</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
- <profiles>
- <profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <properties>
- <microcontainer.outputDirectory>target/classes</microcontainer.outputDirectory>
- <microcontainer.testOutputDirectory>target/tests-classes</microcontainer.testOutputDirectory>
- </properties>
- </profile>
- <profile>
- <id>eclipse</id>
- <build>
- <defaultGoal>process-test-resources</defaultGoal>
- <plugins>
- <plugin>
- <artifactId>maven-eclipse-plugin</artifactId>
- <executions>
- <execution>
- <id>eclipse</id>
- <phase>process-test-resources</phase>
- <goals>
- <goal>eclipse</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <downloadSources>true</downloadSources>
- <buildOutputDirectory>${microcontainer.outputDirectory}</buildOutputDirectory>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <properties>
- <microcontainer.outputDirectory>eclipse-target/classes</microcontainer.outputDirectory>
- <microcontainer.testOutputDirectory>eclipse-target/tests-classes</microcontainer.testOutputDirectory>
- </properties>
- </profile>
- </profiles>
-</project>
Copied: projects/jboss-man/tags/2.0.0.Beta13/build/pom.xml (from rev 73465, projects/jboss-man/trunk/build/pom.xml)
===================================================================
--- projects/jboss-man/tags/2.0.0.Beta13/build/pom.xml (rev 0)
+++ projects/jboss-man/tags/2.0.0.Beta13/build/pom.xml 2008-05-17 15:31:22 UTC (rev 73467)
@@ -0,0 +1,251 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ This pom functions as a default configuration. The subproject
+ poms each inherit configuration from this one.
+
+ When adding version information for an artifact please do the following
+ - add a version property for the specific version
+ - add a dependency in the dependencyManagement section which refers to
+ the property
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-parent</artifactId>
+ <version>3</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.man</groupId>
+ <artifactId>jboss-man</artifactId>
+ <version>2.0.0.Beta13</version>
+ <packaging>pom</packaging>
+ <name>JBoss Managed Build</name>
+ <url>http://www.jboss.com/products/jbossmc</url>
+ <description>
+ JBoss Managed
+ </description>
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/jboss-man/tags/2.0.0.Beta13</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/jboss-man/tags/2.0.0.Beta13</developerConnection>
+ <url>http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/projects/jboss-man/tags/2.0.0.Beta13</url>
+ </scm>
+
+ <properties>
+ <version.jboss.common.core>2.2.4.GA</version.jboss.common.core>
+ <version.jboss.common.logging.spi>2.0.4.GA</version.jboss.common.logging.spi>
+ <version.jboss.common.logging.log4j>2.0.4.GA</version.jboss.common.logging.log4j>
+ <version.org.jboss.reflect>2.0.0.Beta12</version.org.jboss.reflect>
+ <version.org.jboss.test>1.0.5.GA</version.org.jboss.test>
+ <version.junit>4.4</version.junit>
+ </properties>
+
+ <build>
+ <sourceDirectory>src/main</sourceDirectory>
+ <testSourceDirectory>src/tests</testSourceDirectory>
+ <outputDirectory>${microcontainer.outputDirectory}</outputDirectory>
+ <testOutputDirectory>${microcontainer.testOutputDirectory}</testOutputDirectory>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ <showDeprecation>true</showDeprecation>
+ <showWarnings>true</showWarnings>
+ <optimize>true</optimize>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jboss-deploy-plugin</artifactId>
+ <version>1.6</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>jboss-deploy</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <jbossDeployRoot>${jboss.repository.root}</jbossDeployRoot>
+ </configuration>
+ </plugin>
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attached</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-idea-plugin</artifactId>
+ <configuration>
+ <downloadSources>true</downloadSources>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.1</version>
+ <configuration>
+ <redirectTestOutputToFile>true</redirectTestOutputToFile>
+ <includes>
+ <include>org/jboss/test/**/*TestCase.java</include>
+ </includes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+ <repositories>
+ <repository>
+ <id>repository.jboss.org</id>
+ <name>JBoss Repository</name>
+ <layout>default</layout>
+ <url>http://repository.jboss.org/maven2/</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ <repository>
+ <id>snapshots.jboss.org</id>
+ <name>JBoss Snapshots Repository</name>
+ <layout>default</layout>
+ <url>http://snapshots.jboss.org/maven2/</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ </repository>
+ </repositories>
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-project-info-reports-plugin</artifactId>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>dependencies</report>
+ <report>issue-tracking</report>
+ <report>license</report>
+ <report>scm</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>findbugs-maven-plugin</artifactId>
+ <version>1.0.0</version>
+ </plugin>
+ </plugins>
+ </reporting>
+ <dependencyManagement>
+ <!-- The parent pom manages the inter-dependencies of the modules. -->
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.man</groupId>
+ <artifactId>jboss-managed</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.man</groupId>
+ <artifactId>jboss-metatype</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ <version>${version.jboss.common.core}</version>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-common-logging-spi</artifactId>
+ <version>${version.jboss.common.logging.spi}</version>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-common-logging-log4j</artifactId>
+ <version>${version.jboss.common.logging.log4j}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-reflect</artifactId>
+ <version>${version.org.jboss.reflect}</version>
+ </dependency>
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-test</artifactId>
+ <version>${version.org.jboss.test}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${version.junit}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <properties>
+ <microcontainer.outputDirectory>target/classes</microcontainer.outputDirectory>
+ <microcontainer.testOutputDirectory>target/tests-classes</microcontainer.testOutputDirectory>
+ </properties>
+ </profile>
+ <profile>
+ <id>eclipse</id>
+ <build>
+ <defaultGoal>process-test-resources</defaultGoal>
+ <plugins>
+ <plugin>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>eclipse</id>
+ <phase>process-test-resources</phase>
+ <goals>
+ <goal>eclipse</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <downloadSources>true</downloadSources>
+ <buildOutputDirectory>${microcontainer.outputDirectory}</buildOutputDirectory>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <properties>
+ <microcontainer.outputDirectory>eclipse-target/classes</microcontainer.outputDirectory>
+ <microcontainer.testOutputDirectory>eclipse-target/tests-classes</microcontainer.testOutputDirectory>
+ </properties>
+ </profile>
+ </profiles>
+</project>
Deleted: projects/jboss-man/tags/2.0.0.Beta13/managed/pom.xml
===================================================================
--- projects/jboss-man/trunk/managed/pom.xml 2008-05-16 17:46:20 UTC (rev 73452)
+++ projects/jboss-man/tags/2.0.0.Beta13/managed/pom.xml 2008-05-17 15:31:22 UTC (rev 73467)
@@ -1,94 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <groupId>org.jboss.man</groupId>
- <artifactId>jboss-man</artifactId>
- <version>2.0.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>jboss-managed</artifactId>
- <packaging>jar</packaging>
- <name>JBoss Managed</name>
- <url>http://www.jboss.com/products/jbossmc</url>
- <description>JBoss Managed</description>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <configuration>
- <descriptors>
- <descriptor>src/assembly/api.xml</descriptor>
- <descriptor>src/assembly/plugins.xml</descriptor>
- </descriptors>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <!-- Do not add version information here, use ../build/pom.xml instead -->
- <dependencies>
- <!-- Global dependencies -->
- <dependency>
- <groupId>org.jboss.man</groupId>
- <artifactId>jboss-metatype</artifactId>
- </dependency>
- <!-- Test dependencies -->
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-common-logging-log4j</artifactId>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>jboss</groupId>
- <artifactId>jboss-common-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>jboss</groupId>
- <artifactId>jboss-common-logging-spi</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-test</artifactId>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-common-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>jboss</groupId>
- <artifactId>jboss-common-logging-spi</artifactId>
- </exclusion>
- <exclusion>
- <groupId>jboss</groupId>
- <artifactId>jboss-common-logging-log4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>jboss.profiler.jvmti</groupId>
- <artifactId>jboss-profiler-jvmti</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant-junit</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
Copied: projects/jboss-man/tags/2.0.0.Beta13/managed/pom.xml (from rev 73465, projects/jboss-man/trunk/managed/pom.xml)
===================================================================
--- projects/jboss-man/tags/2.0.0.Beta13/managed/pom.xml (rev 0)
+++ projects/jboss-man/tags/2.0.0.Beta13/managed/pom.xml 2008-05-17 15:31:22 UTC (rev 73467)
@@ -0,0 +1,94 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.jboss.man</groupId>
+ <artifactId>jboss-man</artifactId>
+ <version>2.0.0.Beta13</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>jboss-managed</artifactId>
+ <packaging>jar</packaging>
+ <name>JBoss Managed</name>
+ <url>http://www.jboss.com/products/jbossmc</url>
+ <description>JBoss Managed</description>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptors>
+ <descriptor>src/assembly/api.xml</descriptor>
+ <descriptor>src/assembly/plugins.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <!-- Do not add version information here, use ../build/pom.xml instead -->
+ <dependencies>
+ <!-- Global dependencies -->
+ <dependency>
+ <groupId>org.jboss.man</groupId>
+ <artifactId>jboss-metatype</artifactId>
+ </dependency>
+ <!-- Test dependencies -->
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-common-logging-log4j</artifactId>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-common-logging-spi</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-test</artifactId>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-common-logging-spi</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-common-logging-log4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>jboss.profiler.jvmti</groupId>
+ <artifactId>jboss-profiler-jvmti</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant-junit</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
Deleted: projects/jboss-man/tags/2.0.0.Beta13/managed/src/main/org/jboss/managed/api/ManagedDeployment.java
===================================================================
--- projects/jboss-man/trunk/managed/src/main/org/jboss/managed/api/ManagedDeployment.java 2008-05-16 17:46:20 UTC (rev 73452)
+++ projects/jboss-man/tags/2.0.0.Beta13/managed/src/main/org/jboss/managed/api/ManagedDeployment.java 2008-05-17 15:31:22 UTC (rev 73467)
@@ -1,163 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2007, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * 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.
- *
- * This software 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.
- */
-package org.jboss.managed.api;
-
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.jboss.managed.api.ManagedProperty;
-
-/**
- * A collection of ManagedComponent and structural information
- * about a deployment.
- *
- * @author Scott.Stark at jboss.org
- * @version $Revision$
- */
-public interface ManagedDeployment
-{
- /** The class of deployment */
- public enum DeploymentPhase {
- /** A deployment loaded during the server bootstrap phase */
- BOOTSTRAP,
- /** An mc/service deployment for a Deployer to be loaded after the BOOTSTRAP phase */
- DEPLOYER,
- /** Any deployment content to be loaded after the DEPLOYER phase */
- APPLICATION
- };
-
- /**
- * Get the full name of the associated DeploymentUnit.
- * @return full name of the DeploymentUnit
- */
- public String getName();
- /**
- * Get the simple name (x.ear) for the deployment
- * @return simple name of the deployment
- */
- public String getSimpleName();
- /**
- * Get the phase this deployment is associated with
- * @return the phase
- */
- public DeploymentPhase getDeploymentPhase();
- /**
- * Add a deployment/module type
- * @param type
- * @return true if the type was added, false if it already exists
- */
- public boolean addType(String type);
- /**
- * Get the deployment/module types.
- * @return deployment types
- */
- public Set<String> getTypes();
- /**
- * Get the deployment/module types.
- * @param types
- */
- public void setTypes(Set<String> types);
-
- /**
- * Get the managed property names
- *
- * @return the property names
- */
- public Set<String> getPropertyNames();
- /**
- * Get a property
- *
- * @param name the name
- * @return the property
- */
- public ManagedProperty getProperty(String name);
-
- /**
- * Get the properties
- *
- * @return the properties
- */
- public Map<String, ManagedProperty> getProperties();
-
- /**
- * Get the managed object names
- *
- * @return the property names
- */
- public Set<String> getManagedObjectNames();
- public Map<String, ManagedObject> getManagedObjects();
- public ManagedObject getManagedObject(String name);
-
- /**
- *
- * @return the parent
- */
- public ManagedDeployment getParent();
-
- public ManagedComponent getComponent(String name);
-
- /**
- * Get the ManagedComponents for the deployment module.
- * @return ManagedComponents for the deployment module.
- */
- public Map<String, ManagedComponent> getComponents();
- /**
- * Get the nested deployment modules.
- * @return nested deployment modules.
- */
- public List<ManagedDeployment> getChildren();
-
- /**
- * Get the DeploymentTemplate names for components
- * that can be added to this deployment.
- * @return the template names
- */
- public Set<String> getComponentTemplateNames();
-
- /**
- * Add a component to this deployment
- * @param name the name
- * @param comp the component
- */
- public void addComponent(String name, ManagedComponent comp);
- /**
- *
- * @param name the name
- * @return true when it was removed
- */
- public boolean removeComponent(String name);
-
- /**
- * Get the DeploymentTemplate names for deployments
- * that can be added to this deployment.
- * @return the template names
- */
- public Set<String> getDeploymentTemplateNames();
- /**
- * Add a deployment
- * @param deplymentBaseName
- * @param info
- * @return the deployment
- */
- public ManagedDeployment addModule(String deplymentBaseName, DeploymentTemplateInfo info);
-}
Copied: projects/jboss-man/tags/2.0.0.Beta13/managed/src/main/org/jboss/managed/api/ManagedDeployment.java (from rev 73454, projects/jboss-man/trunk/managed/src/main/org/jboss/managed/api/ManagedDeployment.java)
===================================================================
--- projects/jboss-man/tags/2.0.0.Beta13/managed/src/main/org/jboss/managed/api/ManagedDeployment.java (rev 0)
+++ projects/jboss-man/tags/2.0.0.Beta13/managed/src/main/org/jboss/managed/api/ManagedDeployment.java 2008-05-17 15:31:22 UTC (rev 73467)
@@ -0,0 +1,165 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * 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.
+ *
+ * This software 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.
+ */
+package org.jboss.managed.api;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.managed.api.ManagedProperty;
+
+/**
+ * A collection of ManagedComponent and structural information
+ * about a deployment.
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public interface ManagedDeployment
+{
+ /** The phase of deployment */
+ public enum DeploymentPhase {
+ /** A deployment loaded during the server bootstrap phase */
+ BOOTSTRAP,
+ /** An mc/service deployment for a Deployer to be loaded after the BOOTSTRAP phase */
+ DEPLOYER,
+ /** Any deployment content to be loaded after the DEPLOYER phase */
+ APPLICATION,
+ /** Any deployment content to be loaded across a 'cluster' after the APPLICATION phase */
+ APPLICATION_CLUSTERED
+ };
+
+ /**
+ * Get the full name of the associated DeploymentUnit.
+ * @return full name of the DeploymentUnit
+ */
+ public String getName();
+ /**
+ * Get the simple name (x.ear) for the deployment
+ * @return simple name of the deployment
+ */
+ public String getSimpleName();
+ /**
+ * Get the phase this deployment is associated with
+ * @return the phase
+ */
+ public DeploymentPhase getDeploymentPhase();
+ /**
+ * Add a deployment/module type
+ * @param type
+ * @return true if the type was added, false if it already exists
+ */
+ public boolean addType(String type);
+ /**
+ * Get the deployment/module types.
+ * @return deployment types
+ */
+ public Set<String> getTypes();
+ /**
+ * Get the deployment/module types.
+ * @param types
+ */
+ public void setTypes(Set<String> types);
+
+ /**
+ * Get the managed property names
+ *
+ * @return the property names
+ */
+ public Set<String> getPropertyNames();
+ /**
+ * Get a property
+ *
+ * @param name the name
+ * @return the property
+ */
+ public ManagedProperty getProperty(String name);
+
+ /**
+ * Get the properties
+ *
+ * @return the properties
+ */
+ public Map<String, ManagedProperty> getProperties();
+
+ /**
+ * Get the managed object names
+ *
+ * @return the property names
+ */
+ public Set<String> getManagedObjectNames();
+ public Map<String, ManagedObject> getManagedObjects();
+ public ManagedObject getManagedObject(String name);
+
+ /**
+ *
+ * @return the parent
+ */
+ public ManagedDeployment getParent();
+
+ public ManagedComponent getComponent(String name);
+
+ /**
+ * Get the ManagedComponents for the deployment module.
+ * @return ManagedComponents for the deployment module.
+ */
+ public Map<String, ManagedComponent> getComponents();
+ /**
+ * Get the nested deployment modules.
+ * @return nested deployment modules.
+ */
+ public List<ManagedDeployment> getChildren();
+
+ /**
+ * Get the DeploymentTemplate names for components
+ * that can be added to this deployment.
+ * @return the template names
+ */
+ public Set<String> getComponentTemplateNames();
+
+ /**
+ * Add a component to this deployment
+ * @param name the name
+ * @param comp the component
+ */
+ public void addComponent(String name, ManagedComponent comp);
+ /**
+ *
+ * @param name the name
+ * @return true when it was removed
+ */
+ public boolean removeComponent(String name);
+
+ /**
+ * Get the DeploymentTemplate names for deployments
+ * that can be added to this deployment.
+ * @return the template names
+ */
+ public Set<String> getDeploymentTemplateNames();
+ /**
+ * Add a deployment
+ * @param deplymentBaseName
+ * @param info
+ * @return the deployment
+ */
+ public ManagedDeployment addModule(String deplymentBaseName, DeploymentTemplateInfo info);
+}
Deleted: projects/jboss-man/tags/2.0.0.Beta13/managed/src/main/org/jboss/managed/api/annotation/ManagementDeployment.java
===================================================================
--- projects/jboss-man/trunk/managed/src/main/org/jboss/managed/api/annotation/ManagementDeployment.java 2008-05-16 17:46:20 UTC (rev 73452)
+++ projects/jboss-man/tags/2.0.0.Beta13/managed/src/main/org/jboss/managed/api/annotation/ManagementDeployment.java 2008-05-17 15:31:22 UTC (rev 73467)
@@ -1,59 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * 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.
- *
- * This software 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.
- */
-package org.jboss.managed.api.annotation;
-
-import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
-
-/**
- * An annotation identifying a managed deployment
- *
- * @author Scott.Stark at jboss.org
- * @version $Revision$
- */
-public @interface ManagementDeployment
-{
- /**
- * Get the simple name (x.ear) for the deployment. Generally
- * this is taken from the DeploymentUnit.simpleName.
- * @return simple name of the deployment
- */
- String simpleName() default ManagementConstants.GENERATED;
-
- /**
- * A description of the managed deployment
- * @return description of the managed deployment
- */
- String description() default ManagementConstants.GENERATED;
-
- /**
- * The phase the deployment belongs to
- * @return the phase of the deployment
- */
- DeploymentPhase phase() default DeploymentPhase.APPLICATION;
-
- /**
- * Get the deployment/module types.
- * @return deployment types
- */
- String[] types() default {};
-
-}
Copied: projects/jboss-man/tags/2.0.0.Beta13/managed/src/main/org/jboss/managed/api/annotation/ManagementDeployment.java (from rev 73460, projects/jboss-man/trunk/managed/src/main/org/jboss/managed/api/annotation/ManagementDeployment.java)
===================================================================
--- projects/jboss-man/tags/2.0.0.Beta13/managed/src/main/org/jboss/managed/api/annotation/ManagementDeployment.java (rev 0)
+++ projects/jboss-man/tags/2.0.0.Beta13/managed/src/main/org/jboss/managed/api/annotation/ManagementDeployment.java 2008-05-17 15:31:22 UTC (rev 73467)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * 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.
+ *
+ * This software 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.
+ */
+package org.jboss.managed.api.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
+
+/**
+ * An annotation identifying a managed deployment
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+ at Inherited
+ at Target({ElementType.TYPE})
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface ManagementDeployment
+{
+ /**
+ * Get the simple name (x.ear) for the deployment. Generally
+ * this is taken from the DeploymentUnit.simpleName.
+ * @return simple name of the deployment
+ */
+ String simpleName() default ManagementConstants.GENERATED;
+
+ /**
+ * A description of the managed deployment
+ * @return description of the managed deployment
+ */
+ String description() default ManagementConstants.GENERATED;
+
+ /**
+ * The phase the deployment belongs to
+ * @return the phase of the deployment
+ */
+ DeploymentPhase phase() default DeploymentPhase.APPLICATION;
+
+ /**
+ * Get the deployment/module types.
+ * @return deployment types
+ */
+ String[] types() default {};
+
+}
Deleted: projects/jboss-man/tags/2.0.0.Beta13/managed/src/main/org/jboss/managed/api/annotation/ManagementParameter.java
===================================================================
--- projects/jboss-man/trunk/managed/src/main/org/jboss/managed/api/annotation/ManagementParameter.java 2008-05-16 17:46:20 UTC (rev 73452)
+++ projects/jboss-man/tags/2.0.0.Beta13/managed/src/main/org/jboss/managed/api/annotation/ManagementParameter.java 2008-05-17 15:31:22 UTC (rev 73467)
@@ -1,58 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2007, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * 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.
- *
- * This software 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.
- */
-package org.jboss.managed.api.annotation;
-
-import org.jboss.managed.spi.factory.ManagedParameterConstraintsPopulator;
-import org.jboss.managed.spi.factory.ManagedParameterConstraintsPopulatorFactory;
-
-/**
- * Annotation for documenting a ManagementOperation parameter.
- *
- * @author Scott.Stark at jboss.org
- * @version $Revision$
- */
-public @interface ManagementParameter
-{
- /** The parameter name */
- String name() default AnnotationDefaults.EMPTY_STRING;
- /** The parameter description */
- String description() default AnnotationDefaults.EMPTY_STRING;
-
- /** The constraints, allowed values populator factory */
- Class<? extends ManagedParameterConstraintsPopulatorFactory> constraintsFactory()
- default NULL_CONSTRAINTS.class;
-
- /**
- * Used in {@link ManagementParameter#constraintsFactory()} to
- * signal that the factory be inferred from the type
- * of the property.
- */
- public static final class NULL_CONSTRAINTS
- implements ManagedParameterConstraintsPopulatorFactory
- {
- public ManagedParameterConstraintsPopulator newInstance()
- {
- return null;
- }
- }
-
-}
Copied: projects/jboss-man/tags/2.0.0.Beta13/managed/src/main/org/jboss/managed/api/annotation/ManagementParameter.java (from rev 73459, projects/jboss-man/trunk/managed/src/main/org/jboss/managed/api/annotation/ManagementParameter.java)
===================================================================
--- projects/jboss-man/tags/2.0.0.Beta13/managed/src/main/org/jboss/managed/api/annotation/ManagementParameter.java (rev 0)
+++ projects/jboss-man/tags/2.0.0.Beta13/managed/src/main/org/jboss/managed/api/annotation/ManagementParameter.java 2008-05-17 15:31:22 UTC (rev 73467)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * 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.
+ *
+ * This software 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.
+ */
+package org.jboss.managed.api.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.jboss.managed.spi.factory.ManagedParameterConstraintsPopulator;
+import org.jboss.managed.spi.factory.ManagedParameterConstraintsPopulatorFactory;
+
+/**
+ * Annotation for documenting a ManagementOperation parameter.
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface ManagementParameter
+{
+ /** The parameter name */
+ String name() default AnnotationDefaults.EMPTY_STRING;
+ /** The parameter description */
+ String description() default AnnotationDefaults.EMPTY_STRING;
+
+ /** The constraints, allowed values populator factory */
+ Class<? extends ManagedParameterConstraintsPopulatorFactory> constraintsFactory()
+ default NULL_CONSTRAINTS.class;
+
+ /**
+ * Used in {@link ManagementParameter#constraintsFactory()} to
+ * signal that the factory be inferred from the type
+ * of the property.
+ */
+ public static final class NULL_CONSTRAINTS
+ implements ManagedParameterConstraintsPopulatorFactory
+ {
+ public ManagedParameterConstraintsPopulator newInstance()
+ {
+ return null;
+ }
+ }
+
+}
Deleted: projects/jboss-man/tags/2.0.0.Beta13/managed/src/main/org/jboss/managed/plugins/factory/AbstractManagedObjectFactory.java
===================================================================
--- projects/jboss-man/trunk/managed/src/main/org/jboss/managed/plugins/factory/AbstractManagedObjectFactory.java 2008-05-16 17:46:20 UTC (rev 73452)
+++ projects/jboss-man/tags/2.0.0.Beta13/managed/src/main/org/jboss/managed/plugins/factory/AbstractManagedObjectFactory.java 2008-05-17 15:31:22 UTC (rev 73467)
@@ -1,965 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2007, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* 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.
-*
-* This software 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.
-*/
-package org.jboss.managed.plugins.factory;
-
-import java.io.Serializable;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.UndeclaredThrowableException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.WeakHashMap;
-
-import org.jboss.beans.info.spi.BeanInfo;
-import org.jboss.beans.info.spi.PropertyInfo;
-import org.jboss.config.spi.Configuration;
-import org.jboss.logging.Logger;
-import org.jboss.managed.api.Fields;
-import org.jboss.managed.api.ManagedObject;
-import org.jboss.managed.api.ManagedOperation;
-import org.jboss.managed.api.ManagedParameter;
-import org.jboss.managed.api.ManagedProperty;
-import org.jboss.managed.api.ManagedOperation.Impact;
-import org.jboss.managed.api.annotation.AnnotationDefaults;
-import org.jboss.managed.api.annotation.ManagementComponent;
-import org.jboss.managed.api.annotation.ManagementConstants;
-import org.jboss.managed.api.annotation.ManagementObject;
-import org.jboss.managed.api.annotation.ManagementObjectID;
-import org.jboss.managed.api.annotation.ManagementObjectRef;
-import org.jboss.managed.api.annotation.ManagementOperation;
-import org.jboss.managed.api.annotation.ManagementParameter;
-import org.jboss.managed.api.annotation.ManagementProperties;
-import org.jboss.managed.api.annotation.ManagementProperty;
-import org.jboss.managed.api.annotation.ManagementRuntimeRef;
-import org.jboss.managed.api.factory.ManagedObjectFactory;
-import org.jboss.managed.plugins.DefaultFieldsImpl;
-import org.jboss.managed.plugins.ManagedObjectImpl;
-import org.jboss.managed.plugins.ManagedOperationImpl;
-import org.jboss.managed.plugins.ManagedParameterImpl;
-import org.jboss.managed.plugins.WritethroughManagedPropertyImpl;
-import org.jboss.managed.spi.factory.InstanceClassFactory;
-import org.jboss.managed.spi.factory.ManagedObjectBuilder;
-import org.jboss.managed.spi.factory.ManagedObjectPopulator;
-import org.jboss.managed.spi.factory.ManagedParameterConstraintsPopulator;
-import org.jboss.managed.spi.factory.ManagedParameterConstraintsPopulatorFactory;
-import org.jboss.managed.spi.factory.ManagedPropertyConstraintsPopulator;
-import org.jboss.managed.spi.factory.ManagedPropertyConstraintsPopulatorFactory;
-import org.jboss.managed.spi.factory.RuntimeComponentNameTransformer;
-import org.jboss.metatype.api.types.ArrayMetaType;
-import org.jboss.metatype.api.types.CollectionMetaType;
-import org.jboss.metatype.api.types.GenericMetaType;
-import org.jboss.metatype.api.types.MetaType;
-import org.jboss.metatype.api.types.MetaTypeFactory;
-import org.jboss.metatype.api.values.ArrayValueSupport;
-import org.jboss.metatype.api.values.CollectionValueSupport;
-import org.jboss.metatype.api.values.GenericValueSupport;
-import org.jboss.metatype.api.values.MetaValue;
-import org.jboss.metatype.api.values.MetaValueFactory;
-import org.jboss.metatype.api.values.SimpleValue;
-import org.jboss.reflect.spi.ClassInfo;
-import org.jboss.reflect.spi.MethodInfo;
-import org.jboss.reflect.spi.ParameterInfo;
-import org.jboss.reflect.spi.TypeInfo;
-
-/**
- * AbstractManagedObjectFactory.
- *
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @author Scott.Stark at jboss.org
- * @version $Revision: 1.1 $
- */
-public class AbstractManagedObjectFactory extends ManagedObjectFactory
- implements ManagedObjectBuilder, InstanceClassFactory<Serializable>, ManagedObjectPopulator<Serializable>
-{
- private static final Logger log = Logger.getLogger(AbstractManagedObjectFactory.class);
-
- /** The configuration */
- private static final Configuration configuration = PropertyConfigurationAccess.getConfiguration();
-
- /** The managed object meta type */
- public static final GenericMetaType MANAGED_OBJECT_META_TYPE = new GenericMetaType(ManagedObject.class.getName(), ManagedObject.class.getName());
-
- /** The meta type factory */
- private MetaTypeFactory metaTypeFactory = MetaTypeFactory.getInstance();
-
- /** The meta value factory */
- private MetaValueFactory metaValueFactory = MetaValueFactory.getInstance();
-
- /** The managed object builders */
- private Map<Class<?>, ManagedObjectBuilder> builders = new WeakHashMap<Class<?>, ManagedObjectBuilder>();
-
- /** The instance to class factories */
- private Map<Class<?>, InstanceClassFactory<? extends Serializable>> instanceFactories = new WeakHashMap<Class<?>, InstanceClassFactory<? extends Serializable>>();
-
- /** The instance to name transformers */
- private Map<TypeInfo, RuntimeComponentNameTransformer> transformers = new WeakHashMap<TypeInfo, RuntimeComponentNameTransformer>();
-
- /**
- * Create a ManagedProperty by looking to the factory for ctor(Fields)
- * @param factory - the ManagedProperty implementation class
- * @param fields - the fields to pass to the ctor
- * @return the managed property if successful, null otherwise
- */
- public static ManagedProperty createManagedProperty(Class<? extends ManagedProperty> factory, Fields fields)
- {
- ManagedProperty property = null;
- try
- {
- Class<?>[] sig = {Fields.class};
- Constructor<? extends ManagedProperty> ctor = factory.getConstructor(sig);
- Object[] args = {fields};
- property = ctor.newInstance(args);
- }
- catch(Exception e)
- {
- log.debug("Failed to create ManagedProperty", e);
- }
- return property;
- }
-
- @Override
- public <T extends Serializable> ManagedObject createManagedObject(Class<T> clazz)
- {
- if (clazz == null)
- throw new IllegalArgumentException("Null class");
-
- ManagedObject result = createSkeletonManagedObject(clazz);
- ManagedObjectPopulator<Serializable> populator = getPopulator(clazz);
- populator.createObject(result, clazz);
-
- return result;
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public ManagedObject initManagedObject(Serializable object, String name, String nameType)
- {
- if (object == null)
- throw new IllegalArgumentException("Null object");
-
- Class<? extends Serializable> clazz = object.getClass();
- InstanceClassFactory icf = getInstanceClassFactory(clazz);
- Class<? extends Serializable> moClass;
- try
- {
- moClass = icf.getManagedObjectClass(object);
- }
- catch(ClassNotFoundException e)
- {
- return null;
- }
- ManagedObject result = createSkeletonManagedObject(moClass);
- if (result == null )
- {
- log.debug("Null ManagedObject created for: "+moClass);
- return null;
- }
- ManagedObjectPopulator<Serializable> populator = getPopulator(moClass);
- populator.populateManagedObject(result, object);
-
- return result;
- }
-
- @Override
- public void setBuilder(Class<?> clazz, ManagedObjectBuilder builder)
- {
- synchronized (builders)
- {
- if (builder == null)
- builders.remove(clazz);
- else
- builders.put(clazz, builder);
- }
- }
-
- @Override
- public <T extends Serializable> void setInstanceClassFactory(Class<T> clazz, InstanceClassFactory<T> factory)
- {
- synchronized (instanceFactories)
- {
- if (factory == null)
- instanceFactories.remove(clazz);
- else
- instanceFactories.put(clazz, factory);
- }
- }
-
- public void setNameTransformers(Class<?> clazz, RuntimeComponentNameTransformer transformer)
- {
- TypeInfo type = configuration.getTypeInfo(clazz);
- setNameTransformers(type, transformer);
- }
-
- public void setNameTransformers(TypeInfo type, RuntimeComponentNameTransformer transformer)
- {
- synchronized (transformers)
- {
- if (transformer == null)
- transformers.remove(type);
- else
- transformers.put(type, transformer);
- }
- }
-
- /**
- * Default InstanceClassFactory implementation simply returns the
- * instance class.
- */
- public Class<? extends Serializable> getManagedObjectClass(Serializable instance)
- {
- return instance.getClass();
- }
-
- /**
- * Create a skeleton managed object
- *
- * @param <T> the type
- * @param clazz the clazz
- * @return the skeleton managed object, null if clazz is not
- * marked as a ManagementObject.
- * {@linkplain ManagementObject}
- */
- protected <T extends Serializable> ManagedObject createSkeletonManagedObject(Class<T> clazz)
- {
- if (clazz == null)
- throw new IllegalArgumentException("Null class");
-
- ManagedObjectBuilder builder = getBuilder(clazz);
- return builder.buildManagedObject(clazz);
- }
-
- /**
- * The ManagedObjectBuilder.buildManagedObject implementation. This is based
- * on the org.jboss.managed.api.annotation.* package annotations.
- * @param clazz the attachment class
- * @return the ManagementObject if clazz is properly annotated, null if
- * it does not have a ManagementObject annotation.
- */
- @SuppressWarnings("unchecked")
- public ManagedObject buildManagedObject(Class<? extends Serializable> clazz)
- {
- boolean trace = log.isTraceEnabled();
- BeanInfo beanInfo = configuration.getBeanInfo(clazz);
- ClassInfo classInfo = beanInfo.getClassInfo();
-
- ManagementObject managementObject = classInfo.getUnderlyingAnnotation(ManagementObject.class);
- if( managementObject == null )
- {
- if (trace)
- log.trace("No ManagementObject annotation, skipping ManagedObject for class: "+clazz);
- // Skip the ManagedObject creation
- return null;
- }
-
- HashMap<String, Annotation> moAnnotations = new HashMap<String, Annotation>();
- moAnnotations.put(ManagementObject.class.getName(), managementObject);
- ManagementObjectID moID = classInfo.getUnderlyingAnnotation(ManagementObjectID.class);
- if (moID != null)
- moAnnotations.put(ManagementObjectID.class.getName(), moID);
-
- // Process the ManagementObject fields
- boolean isRuntime = managementObject.isRuntime();
- String name = classInfo.getName();
- String nameType = null;
- String attachmentName = classInfo.getName();
- Class<? extends Fields> moFieldsFactory = null;
- Class<? extends ManagedPropertyConstraintsPopulatorFactory> moConstraintsFactory = null;
- Class<? extends ManagedProperty> moPropertyFactory = null;
- if (managementObject != null)
- {
- name = managementObject.name();
- if (name.length() == 0 || name.equals(ManagementConstants.GENERATED))
- name = classInfo.getName();
- nameType = managementObject.type();
- if (nameType.length() == 0)
- nameType = null;
- attachmentName = managementObject.attachmentName();
- if (attachmentName.length() == 0)
- attachmentName = classInfo.getName();
- // Check for a component specification
- ManagementComponent mc = managementObject.componentType();
- if (mc.equals(AnnotationDefaults.COMP_TYPE) == false)
- moAnnotations.put(ManagementComponent.class.getName(), mc);
- // ManagementObject level default factory classes
- moFieldsFactory = managementObject.fieldsFactory();
- moConstraintsFactory = managementObject.constraintsFactory();
- moPropertyFactory = managementObject.propertyFactory();
- }
-
- if (trace)
- {
- log.trace("Building MangedObject(name="+name+",nameType="+nameType
- +",attachmentName="+attachmentName+",isRuntime="+isRuntime+")");
- }
-
- ManagementProperties propertyType = ManagementProperties.ALL;
- if (managementObject != null)
- propertyType = managementObject.properties();
-
- // Build the ManagedProperties
- Set<ManagedProperty> properties = new HashSet<ManagedProperty>();
-
- Set<PropertyInfo> propertyInfos = beanInfo.getProperties();
- if (propertyInfos != null && propertyInfos.isEmpty() == false)
- {
- for (PropertyInfo propertyInfo : propertyInfos)
- {
- // Ignore the "class" property
- if ("class".equals(propertyInfo.getName()))
- continue;
-
- ManagementProperty managementProperty = propertyInfo.getUnderlyingAnnotation(ManagementProperty.class);
- ManagementObjectID id = propertyInfo.getUnderlyingAnnotation(ManagementObjectID.class);
- ManagementObjectRef ref = propertyInfo.getUnderlyingAnnotation(ManagementObjectRef.class);
- ManagementRuntimeRef runtimeRef = propertyInfo.getUnderlyingAnnotation(ManagementRuntimeRef.class);
- HashMap<String, Annotation> propAnnotations = new HashMap<String, Annotation>();
- if (managementProperty != null)
- propAnnotations.put(ManagementProperty.class.getName(), managementProperty);
- if (id != null)
- {
- propAnnotations.put(ManagementObjectID.class.getName(), id);
- // This overrides the MO nameType
- nameType = id.type();
- }
- if (ref != null)
- propAnnotations.put(ManagementObjectRef.class.getName(), ref);
- if (runtimeRef != null)
- propAnnotations.put(ManagementRuntimeRef.class.getName(), runtimeRef);
-
- // Check for a simple property
- boolean includeProperty = (propertyType == ManagementProperties.ALL);
- if (managementProperty != null)
- includeProperty = (managementProperty.ignored() == false);
-
- if (includeProperty)
- {
- Fields fields = null;
- if (managementProperty != null)
- {
- Class<? extends Fields> factory = moFieldsFactory;
- if (factory == ManagementProperty.NULL_FIELDS_FACTORY.class)
- factory = managementProperty.fieldsFactory();
- if (factory != ManagementProperty.NULL_FIELDS_FACTORY.class)
- {
- try
- {
- fields = factory.newInstance();
- }
- catch (Exception e)
- {
- log.debug("Failed to created Fields", e);
- }
- }
- }
- if (fields == null)
- fields = new DefaultFieldsImpl();
-
- if( propertyInfo instanceof Serializable )
- {
- Serializable info = Serializable.class.cast(propertyInfo);
- fields.setField(Fields.PROPERTY_INFO, info);
- }
-
- String propertyName = propertyInfo.getName();
- if (managementProperty != null)
- propertyName = managementProperty.name();
- if( propertyName.length() == 0 )
- propertyName = propertyInfo.getName();
- fields.setField(Fields.NAME, propertyName);
-
- // This should probably always the the propertyInfo name?
- String mappedName = propertyInfo.getName();
- if (managementProperty != null)
- mappedName = managementProperty.mappedName();
- if( mappedName.length() == 0 )
- mappedName = propertyInfo.getName();
- fields.setField(Fields.MAPPED_NAME, mappedName);
-
- String description = ManagementConstants.GENERATED;
- if (managementProperty != null)
- description = managementProperty.description();
- if (description.equals(ManagementConstants.GENERATED))
- description = propertyName;
- fields.setField(Fields.DESCRIPTION, description);
-
- if (trace)
- {
- log.trace("Building MangedProperty(name="+propertyName
- +",mappedName="+mappedName
- +") ,annotations="+propAnnotations);
- }
-
- boolean mandatory = false;
- if (managementProperty != null)
- mandatory = managementProperty.mandatory();
- if (mandatory)
- fields.setField(Fields.MANDATORY, Boolean.TRUE);
-
- boolean managed = false;
- if (managementProperty != null)
- managed = managementProperty.managed();
-
- MetaType metaType;
- if (managed)
- {
- TypeInfo typeInfo = propertyInfo.getType();
- if(typeInfo.isArray())
- metaType = new ArrayMetaType(1, MANAGED_OBJECT_META_TYPE);
- else if (typeInfo.isCollection())
- metaType = new CollectionMetaType(typeInfo.getName(), MANAGED_OBJECT_META_TYPE);
- else
- metaType = MANAGED_OBJECT_META_TYPE;
- }
- else
- {
- metaType = metaTypeFactory.resolve(propertyInfo.getType());
- }
- fields.setField(Fields.META_TYPE, metaType);
- if (propAnnotations.isEmpty() == false)
- fields.setField(Fields.ANNOTATIONS, propAnnotations);
-
- // Delegate others (legal values, min/max etc.) to the constraints factory
- try
- {
- Class<? extends ManagedPropertyConstraintsPopulatorFactory> factoryClass = moConstraintsFactory;
- if (factoryClass == ManagementProperty.NULL_CONSTRAINTS.class)
- {
- if (managementProperty != null)
- factoryClass = managementProperty.constraintsFactory();
- }
- ManagedPropertyConstraintsPopulatorFactory factory = factoryClass.newInstance();
- ManagedPropertyConstraintsPopulator populator = factory.newInstance();
- if (populator != null)
- populator.populateManagedProperty(clazz, propertyInfo, fields);
- }
- catch(Exception e)
- {
- log.debug("Failed to populate constraints for: "+propertyInfo, e);
- }
-
- ManagedProperty property = null;
- if (managementProperty != null)
- {
- Class<? extends ManagedProperty> factory = moPropertyFactory;
- if (factory == ManagementProperty.NULL_PROPERTY_FACTORY.class)
- factory = managementProperty.propertyFactory();
- if (factory != ManagementProperty.NULL_PROPERTY_FACTORY.class)
- property = getManagedProperty(factory, fields);
- }
- // we should have write-through by default
- // use factory to change this default behavior
- if (property == null)
- property = createDefaultManagedProperty(fields);
- properties.add(property);
- }
- else if (trace)
- log.trace("Ignoring property: " + propertyInfo);
- }
- }
-
- /* TODO: Operations. In general the bean metadata does not contain
- operation information.
- */
- Set<ManagedOperation> operations = new HashSet<ManagedOperation>();
-
- Set<MethodInfo> methodInfos = beanInfo.getMethods();
- if (methodInfos != null && methodInfos.isEmpty() == false)
- {
- for (MethodInfo methodInfo : methodInfos)
- {
- ManagementOperation managementOp = methodInfo.getUnderlyingAnnotation(ManagementOperation.class);
- if (managementOp == null)
- continue;
-
- ManagedOperation op = getManagedOperation(methodInfo, managementOp);
- operations.add(op);
- }
- }
-
- ManagedObjectImpl result = new ManagedObjectImpl(name, properties);
- result.setAnnotations(moAnnotations);
- if (nameType != null)
- result.setNameType(nameType);
- if (attachmentName != null)
- result.setAttachmentName(attachmentName);
- if (operations.size() > 0 )
- result.setOperations(operations);
- for (ManagedProperty property : properties)
- property.setManagedObject(result);
- return result;
- }
-
- /**
- * Create default MangedProperty instance.
- * Override this method for different default.
- *
- * @param fields the fields
- * @return new ManagedProperty instance
- */
- protected ManagedProperty createDefaultManagedProperty(Fields fields)
- {
- return new WritethroughManagedPropertyImpl(fields, metaValueFactory, this);
- }
-
- public void createObject(ManagedObject managedObject, Class<? extends Serializable> clazz)
- {
- if (managedObject == null)
- throw new IllegalArgumentException("Null managed object");
-
- if (managedObject instanceof ManagedObjectImpl == false)
- throw new IllegalStateException("Unable to create object " + managedObject.getClass().getName());
-
- ManagedObjectImpl managedObjectImpl = (ManagedObjectImpl) managedObject;
- Serializable object = createUnderlyingObject(managedObjectImpl, clazz);
- populateManagedObject(managedObject, object);
- }
-
- public void populateManagedObject(ManagedObject managedObject, Serializable object)
- {
- if (managedObject instanceof ManagedObjectImpl == false)
- throw new IllegalStateException("Unable to populate managed object " + managedObject.getClass().getName());
-
- ManagedObjectImpl managedObjectImpl = (ManagedObjectImpl) managedObject;
- managedObjectImpl.setAttachment(object);
- populateValues(managedObjectImpl, object);
- }
-
- /**
- * Create the underlying object
- *
- * @param managedObject the managed object
- * @param clazz the class
- * @return the object
- */
- protected Serializable createUnderlyingObject(ManagedObjectImpl managedObject, Class<? extends Serializable> clazz)
- {
- BeanInfo beanInfo = configuration.getBeanInfo(clazz);
- try
- {
- Object result = beanInfo.newInstance();
- return Serializable.class.cast(result);
- }
- catch (Throwable t)
- {
- throw new RuntimeException("Unable to create new object for " + managedObject + " clazz=" + clazz, t);
- }
- }
-
- /**
- * Populate the values
- *
- * @param managedObject the managed object
- * @param object the object
- */
- @SuppressWarnings("unchecked")
- protected void populateValues(ManagedObjectImpl managedObject, Serializable object)
- {
- InstanceClassFactory icf = getInstanceClassFactory(object.getClass());
- Class moClass;
- try
- {
- moClass = icf.getManagedObjectClass(object);
- }
- catch(ClassNotFoundException e)
- {
- throw new IllegalStateException(e);
- }
- BeanInfo beanInfo = configuration.getBeanInfo(moClass);
-
- Object componentName = null;
- Map<String, ManagedProperty> properties = managedObject.getProperties();
- if (properties != null && properties.size() > 0)
- {
- for (ManagedProperty property : properties.values())
- {
- MetaValue value = icf.getValue(beanInfo, property, object);
- if (value != null)
- property.setField(Fields.VALUE, value);
- /* Need to look for a ManagementObjectID at the property level which
- defines the ManagedObject id name from the property value.
- */
- Map<String, Annotation> annotations = property.getAnnotations();
- if (annotations == null)
- continue;
- ManagementObjectID id = (ManagementObjectID) annotations.get(ManagementObjectID.class.getName());
- if (id != null)
- {
- if (value == null || value.getMetaType().isSimple() == false)
- {
- log.warn("Cannot create String name from non-Simple property: "
- +property+", value="+value);
- continue;
- }
- SimpleValue svalue = (SimpleValue) value;
- String name = "" + svalue.getValue();
- managedObject.setName(name);
- }
- ManagementRuntimeRef runtimeRef = (ManagementRuntimeRef) annotations.get(ManagementRuntimeRef.class.getName());
- if (runtimeRef != null)
- {
- componentName = icf.getComponentName(beanInfo, property, object, value);
- // let's try this as well
- if (componentName == null && icf != this)
- componentName = getComponentName(beanInfo, property, object, value);
- }
- }
- }
- if (componentName == null)
- componentName = icf.getComponentName(null, null, object, null);
- // set it, even if it's null
- managedObject.setComponentName(componentName);
- }
-
- /**
- * Get the property name.
- *
- * @param property managed property
- * @return property name
- */
- protected String getPropertyName(ManagedProperty property)
- {
- // First look to the mapped name
- String name = property.getMappedName();
- if (name == null)
- property.getName();
- return name;
- }
-
- public Object getComponentName(BeanInfo beanInfo, ManagedProperty property, Serializable object, MetaValue value)
- {
- if (beanInfo != null && property != null && value != null)
- {
- String name = getPropertyName(property);
- PropertyInfo propertyInfo = beanInfo.getProperty(name);
-
- ManagementRuntimeRef componentRef = propertyInfo.getUnderlyingAnnotation(ManagementRuntimeRef.class);
- if (componentRef != null)
- {
- Object original = metaValueFactory.unwrap(value, propertyInfo.getType());
- try
- {
- Class<? extends RuntimeComponentNameTransformer> tClass = componentRef.transformer();
- RuntimeComponentNameTransformer transformer;
- if (tClass != ManagementRuntimeRef.DEFAULT_NAME_TRANSFORMER.class)
- transformer = getComponentNameTransformer(configuration.getTypeInfo(tClass));
- else
- transformer = getComponentNameTransformer(propertyInfo.getType());
-
- return (transformer != null) ? transformer.transform(original) : original;
- }
- catch (Throwable t)
- {
- throw new UndeclaredThrowableException(t);
- }
- }
- }
- return null;
- }
-
- /**
- * Get a value
- *
- * @param beanInfo the bean info
- * @param property the property
- * @param object the object
- * @return the meta value
- */
- @SuppressWarnings("unchecked")
- public MetaValue getValue(BeanInfo beanInfo, ManagedProperty property, Serializable object)
- {
- String name = getPropertyName(property);
- PropertyInfo propertyInfo = beanInfo.getProperty(name);
-
- Object value;
- try
- {
- value = propertyInfo.get(object);
- }
- catch (RuntimeException e)
- {
- throw e;
- }
- catch (Error e)
- {
- throw e;
- }
- catch (Throwable t)
- {
- throw new RuntimeException("Error getting property " + name + " for " + object.getClass().getName(), t);
- }
-
- if (value == null)
- return null;
-
- MetaType propertyType = property.getMetaType();
- if (MANAGED_OBJECT_META_TYPE == propertyType)
- {
- if (value instanceof Serializable == false)
- throw new IllegalStateException("Object is not serializable: " + value.getClass().getName());
- // Look for a ManagementObjectRef
- ManagementObjectRef ref = (ManagementObjectRef) property.getAnnotations().get(ManagementObjectRef.class.getName());
- String moName = (ref != null ? ref.name() : value.getClass().getName());
- String moNameType = (ref != null ? ref.type() : "");
- ManagedObject mo = initManagedObject((Serializable) value, moName, moNameType);
- return new GenericValueSupport(MANAGED_OBJECT_META_TYPE, mo);
- }
- else if (propertyType.isArray())
- {
- ArrayMetaType arrayType = ArrayMetaType.class.cast(propertyType);
- if (MANAGED_OBJECT_META_TYPE == arrayType.getElementType())
- {
- Collection<?> cvalue = getAsCollection(value);
- // todo - AJ: changed some generics by best guess
- ArrayMetaType moType = new ArrayMetaType(1, MANAGED_OBJECT_META_TYPE);
- ArrayValueSupport moArrayValue = new ArrayValueSupport(moType);
- List<GenericValueSupport> tmp = new ArrayList<GenericValueSupport>();
- for(Object element : cvalue)
- {
- ManagedObject mo = initManagedObject((Serializable) element, null, null);
- tmp.add(new GenericValueSupport(MANAGED_OBJECT_META_TYPE, mo));
- }
- GenericValueSupport[] mos = new GenericValueSupport[tmp.size()];
- moArrayValue.setValue(tmp.toArray(mos));
- return moArrayValue;
- }
- }
- else if (propertyType.isCollection())
- {
- CollectionMetaType collectionType = CollectionMetaType.class.cast(propertyType);
- if (MANAGED_OBJECT_META_TYPE == collectionType.getElementType())
- {
- Collection<?> cvalue = getAsCollection(value);
- List<GenericValueSupport> tmp = new ArrayList<GenericValueSupport>();
- for(Object element : cvalue)
- {
- ManagedObject mo = initManagedObject((Serializable) element, null, null);
- tmp.add(new GenericValueSupport(MANAGED_OBJECT_META_TYPE, mo));
- }
- GenericValueSupport[] mos = new GenericValueSupport[tmp.size()];
- CollectionMetaType moType = new CollectionMetaType(propertyType.getClassName(), MANAGED_OBJECT_META_TYPE);
- return new CollectionValueSupport(moType, tmp.toArray(mos));
- }
- }
-
- return metaValueFactory.create(value, propertyInfo.getType());
- }
-
- /**
- * Set a value
- *
- * @param beanInfo the bean info
- * @param property the property
- * @param object the object
- * @param value the meta value
- */
- public void setValue(BeanInfo beanInfo, ManagedProperty property, Serializable object, MetaValue value)
- {
- String name = getPropertyName(property);
- PropertyInfo propertyInfo = beanInfo.getProperty(name);
-
- Object plainValue = metaValueFactory.unwrap(value, propertyInfo.getType());
- try
- {
- propertyInfo.set(object, plainValue);
- }
- catch (Throwable t)
- {
- throw new UndeclaredThrowableException(t);
- }
- }
-
- /**
- *
- * @param methodInfo
- * @param opAnnotation
- * @return the managed operation
- */
- protected ManagedOperation getManagedOperation(MethodInfo methodInfo, ManagementOperation opAnnotation)
- {
- String name = methodInfo.getName();
- String description = opAnnotation.description();
- Impact impact = opAnnotation.impact();
- ManagementParameter[] params = opAnnotation.params();
- ParameterInfo[] paramInfo = methodInfo.getParameters();
- TypeInfo returnInfo = methodInfo.getReturnType();
- MetaType returnType = metaTypeFactory.resolve(returnInfo);
- ArrayList<ManagedParameter> mparams = new ArrayList<ManagedParameter>();
- Class<? extends ManagedParameterConstraintsPopulatorFactory> opConstraintsFactor = opAnnotation.constraintsFactory();
-
- if( paramInfo != null )
- {
- for(int i = 0; i < paramInfo.length; i ++)
- {
- ParameterInfo pinfo = paramInfo[i];
- String pname = pinfo.getName();
- String pdescription = null;
- ManagementParameter mpa = null;
- // Look to ManagementParameter for info
- if (i < params.length)
- {
- mpa = params[i];
- if (mpa.name().equals(AnnotationDefaults.EMPTY_STRING) == false)
- pname = mpa.name();
- if (mpa.description().equals(AnnotationDefaults.EMPTY_STRING) == false)
- pdescription = mpa.description();
- }
- // Generate a name if there is none
- if (pname == null)
- pname = "arg#" + i;
- Fields fields = new DefaultFieldsImpl(pname);
- if (pdescription != null)
- fields.setField(Fields.DESCRIPTION, pdescription);
- MetaType metaType = metaTypeFactory.resolve(pinfo.getParameterType());
- fields.setField(Fields.META_TYPE, metaType);
- // Delegate others (legal values, min/max etc.) to the constraints factory
- try
- {
- Class<? extends ManagedParameterConstraintsPopulatorFactory> factoryClass = opConstraintsFactor;
- if (factoryClass == ManagementParameter.NULL_CONSTRAINTS.class)
- {
- if (mpa != null)
- factoryClass = mpa.constraintsFactory();
- }
- ManagedParameterConstraintsPopulatorFactory factory = factoryClass.newInstance();
- ManagedParameterConstraintsPopulator populator = factory.newInstance();
- if (populator != null)
- populator.populateManagedParameter(name, pinfo, fields);
- }
- catch(Exception e)
- {
- log.debug("Failed to populate constraints for: "+pinfo, e);
- }
-
- ManagedParameterImpl mp = new ManagedParameterImpl(fields);
- mparams.add(mp);
- }
- }
- ManagedParameter[] parameters = new ManagedParameter[mparams.size()];
- mparams.toArray(parameters);
-
- return new ManagedOperationImpl(name, description, impact, parameters, returnType);
- }
-
- /**
- * Get the builder for a class
- *
- * @param clazz the class
- * @return the builder
- */
- protected ManagedObjectBuilder getBuilder(Class<?> clazz)
- {
- synchronized (builders)
- {
- ManagedObjectBuilder builder = builders.get(clazz);
- if (builder != null)
- return builder;
- }
- return this;
- }
-
- /**
- * Get the instance factory for a class
- *
- * @param clazz the class
- * @return the InstanceClassFactory
- */
- @SuppressWarnings("unchecked")
- public <T extends Serializable> InstanceClassFactory<T> getInstanceClassFactory(Class<T> clazz)
- {
- synchronized (instanceFactories)
- {
- InstanceClassFactory factory = instanceFactories.get(clazz);
- if (factory != null)
- return factory;
- }
- return (InstanceClassFactory<T>)this;
- }
-
- /**
- * Get component name transformer.
- *
- * @param type the type info
- * @return transformer instance
- * @throws Throwable for any error
- */
- protected RuntimeComponentNameTransformer getComponentNameTransformer(TypeInfo type) throws Throwable
- {
- synchronized(transformers)
- {
- RuntimeComponentNameTransformer transformer = transformers.get(type);
- if (transformer != null)
- return transformer;
-
- TypeInfo rcntType = configuration.getTypeInfo(RuntimeComponentNameTransformer.class);
- if (rcntType.isAssignableFrom(type))
- {
- BeanInfo beanInfo = configuration.getBeanInfo(type);
- RuntimeComponentNameTransformer newTransformer = (RuntimeComponentNameTransformer)beanInfo.newInstance();
- transformers.put(type, newTransformer);
- return newTransformer;
- }
-
- return null;
- }
- }
-
- /**
- * Get the populator for a class
- *
- * @param clazz the class
- * @return the populator
- */
- @SuppressWarnings("unchecked")
- protected ManagedObjectPopulator<Serializable> getPopulator(Class<?> clazz)
- {
- ManagedObjectBuilder builder = getBuilder(clazz);
- if (builder instanceof ManagedObjectPopulator)
- return (ManagedObjectPopulator) builder;
- return this;
- }
-
- protected Collection<?> getAsCollection(Object value)
- {
- if( value.getClass().isArray() )
- return Arrays.asList(value);
- else if (value instanceof Collection)
- return Collection.class.cast(value);
- return null;
- }
-
- /**
- * Look for ctor(Fields)
- * @param factory - the ManagedProperty implementation class
- * @param fields - the fields to pass to the ctor
- * @return the managed property
- */
- protected ManagedProperty getManagedProperty(Class<? extends ManagedProperty> factory, Fields fields)
- {
- return createManagedProperty(factory, fields);
- }
-}
Copied: projects/jboss-man/tags/2.0.0.Beta13/managed/src/main/org/jboss/managed/plugins/factory/AbstractManagedObjectFactory.java (from rev 73453, projects/jboss-man/trunk/managed/src/main/org/jboss/managed/plugins/factory/AbstractManagedObjectFactory.java)
===================================================================
--- projects/jboss-man/tags/2.0.0.Beta13/managed/src/main/org/jboss/managed/plugins/factory/AbstractManagedObjectFactory.java (rev 0)
+++ projects/jboss-man/tags/2.0.0.Beta13/managed/src/main/org/jboss/managed/plugins/factory/AbstractManagedObjectFactory.java 2008-05-17 15:31:22 UTC (rev 73467)
@@ -0,0 +1,969 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2007, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* 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.
+*
+* This software 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.
+*/
+package org.jboss.managed.plugins.factory;
+
+import java.io.Serializable;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.UndeclaredThrowableException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.WeakHashMap;
+
+import org.jboss.beans.info.spi.BeanInfo;
+import org.jboss.beans.info.spi.PropertyInfo;
+import org.jboss.config.spi.Configuration;
+import org.jboss.logging.Logger;
+import org.jboss.managed.api.Fields;
+import org.jboss.managed.api.ManagedObject;
+import org.jboss.managed.api.ManagedOperation;
+import org.jboss.managed.api.ManagedParameter;
+import org.jboss.managed.api.ManagedProperty;
+import org.jboss.managed.api.ManagedOperation.Impact;
+import org.jboss.managed.api.annotation.AnnotationDefaults;
+import org.jboss.managed.api.annotation.ManagementComponent;
+import org.jboss.managed.api.annotation.ManagementConstants;
+import org.jboss.managed.api.annotation.ManagementDeployment;
+import org.jboss.managed.api.annotation.ManagementObject;
+import org.jboss.managed.api.annotation.ManagementObjectID;
+import org.jboss.managed.api.annotation.ManagementObjectRef;
+import org.jboss.managed.api.annotation.ManagementOperation;
+import org.jboss.managed.api.annotation.ManagementParameter;
+import org.jboss.managed.api.annotation.ManagementProperties;
+import org.jboss.managed.api.annotation.ManagementProperty;
+import org.jboss.managed.api.annotation.ManagementRuntimeRef;
+import org.jboss.managed.api.factory.ManagedObjectFactory;
+import org.jboss.managed.plugins.DefaultFieldsImpl;
+import org.jboss.managed.plugins.ManagedObjectImpl;
+import org.jboss.managed.plugins.ManagedOperationImpl;
+import org.jboss.managed.plugins.ManagedParameterImpl;
+import org.jboss.managed.plugins.WritethroughManagedPropertyImpl;
+import org.jboss.managed.spi.factory.InstanceClassFactory;
+import org.jboss.managed.spi.factory.ManagedObjectBuilder;
+import org.jboss.managed.spi.factory.ManagedObjectPopulator;
+import org.jboss.managed.spi.factory.ManagedParameterConstraintsPopulator;
+import org.jboss.managed.spi.factory.ManagedParameterConstraintsPopulatorFactory;
+import org.jboss.managed.spi.factory.ManagedPropertyConstraintsPopulator;
+import org.jboss.managed.spi.factory.ManagedPropertyConstraintsPopulatorFactory;
+import org.jboss.managed.spi.factory.RuntimeComponentNameTransformer;
+import org.jboss.metatype.api.types.ArrayMetaType;
+import org.jboss.metatype.api.types.CollectionMetaType;
+import org.jboss.metatype.api.types.GenericMetaType;
+import org.jboss.metatype.api.types.MetaType;
+import org.jboss.metatype.api.types.MetaTypeFactory;
+import org.jboss.metatype.api.values.ArrayValueSupport;
+import org.jboss.metatype.api.values.CollectionValueSupport;
+import org.jboss.metatype.api.values.GenericValueSupport;
+import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.metatype.api.values.MetaValueFactory;
+import org.jboss.metatype.api.values.SimpleValue;
+import org.jboss.reflect.spi.ClassInfo;
+import org.jboss.reflect.spi.MethodInfo;
+import org.jboss.reflect.spi.ParameterInfo;
+import org.jboss.reflect.spi.TypeInfo;
+
+/**
+ * AbstractManagedObjectFactory.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @author Scott.Stark at jboss.org
+ * @version $Revision: 1.1 $
+ */
+public class AbstractManagedObjectFactory extends ManagedObjectFactory
+ implements ManagedObjectBuilder, InstanceClassFactory<Serializable>, ManagedObjectPopulator<Serializable>
+{
+ private static final Logger log = Logger.getLogger(AbstractManagedObjectFactory.class);
+
+ /** The configuration */
+ private static final Configuration configuration = PropertyConfigurationAccess.getConfiguration();
+
+ /** The managed object meta type */
+ public static final GenericMetaType MANAGED_OBJECT_META_TYPE = new GenericMetaType(ManagedObject.class.getName(), ManagedObject.class.getName());
+
+ /** The meta type factory */
+ private MetaTypeFactory metaTypeFactory = MetaTypeFactory.getInstance();
+
+ /** The meta value factory */
+ private MetaValueFactory metaValueFactory = MetaValueFactory.getInstance();
+
+ /** The managed object builders */
+ private Map<Class<?>, ManagedObjectBuilder> builders = new WeakHashMap<Class<?>, ManagedObjectBuilder>();
+
+ /** The instance to class factories */
+ private Map<Class<?>, InstanceClassFactory<? extends Serializable>> instanceFactories = new WeakHashMap<Class<?>, InstanceClassFactory<? extends Serializable>>();
+
+ /** The instance to name transformers */
+ private Map<TypeInfo, RuntimeComponentNameTransformer> transformers = new WeakHashMap<TypeInfo, RuntimeComponentNameTransformer>();
+
+ /**
+ * Create a ManagedProperty by looking to the factory for ctor(Fields)
+ * @param factory - the ManagedProperty implementation class
+ * @param fields - the fields to pass to the ctor
+ * @return the managed property if successful, null otherwise
+ */
+ public static ManagedProperty createManagedProperty(Class<? extends ManagedProperty> factory, Fields fields)
+ {
+ ManagedProperty property = null;
+ try
+ {
+ Class<?>[] sig = {Fields.class};
+ Constructor<? extends ManagedProperty> ctor = factory.getConstructor(sig);
+ Object[] args = {fields};
+ property = ctor.newInstance(args);
+ }
+ catch(Exception e)
+ {
+ log.debug("Failed to create ManagedProperty", e);
+ }
+ return property;
+ }
+
+ @Override
+ public <T extends Serializable> ManagedObject createManagedObject(Class<T> clazz)
+ {
+ if (clazz == null)
+ throw new IllegalArgumentException("Null class");
+
+ ManagedObject result = createSkeletonManagedObject(clazz);
+ ManagedObjectPopulator<Serializable> populator = getPopulator(clazz);
+ populator.createObject(result, clazz);
+
+ return result;
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public ManagedObject initManagedObject(Serializable object, String name, String nameType)
+ {
+ if (object == null)
+ throw new IllegalArgumentException("Null object");
+
+ Class<? extends Serializable> clazz = object.getClass();
+ InstanceClassFactory icf = getInstanceClassFactory(clazz);
+ Class<? extends Serializable> moClass;
+ try
+ {
+ moClass = icf.getManagedObjectClass(object);
+ }
+ catch(ClassNotFoundException e)
+ {
+ return null;
+ }
+ ManagedObject result = createSkeletonManagedObject(moClass);
+ if (result == null )
+ {
+ log.debug("Null ManagedObject created for: "+moClass);
+ return null;
+ }
+ ManagedObjectPopulator<Serializable> populator = getPopulator(moClass);
+ populator.populateManagedObject(result, object);
+
+ return result;
+ }
+
+ @Override
+ public void setBuilder(Class<?> clazz, ManagedObjectBuilder builder)
+ {
+ synchronized (builders)
+ {
+ if (builder == null)
+ builders.remove(clazz);
+ else
+ builders.put(clazz, builder);
+ }
+ }
+
+ @Override
+ public <T extends Serializable> void setInstanceClassFactory(Class<T> clazz, InstanceClassFactory<T> factory)
+ {
+ synchronized (instanceFactories)
+ {
+ if (factory == null)
+ instanceFactories.remove(clazz);
+ else
+ instanceFactories.put(clazz, factory);
+ }
+ }
+
+ public void setNameTransformers(Class<?> clazz, RuntimeComponentNameTransformer transformer)
+ {
+ TypeInfo type = configuration.getTypeInfo(clazz);
+ setNameTransformers(type, transformer);
+ }
+
+ public void setNameTransformers(TypeInfo type, RuntimeComponentNameTransformer transformer)
+ {
+ synchronized (transformers)
+ {
+ if (transformer == null)
+ transformers.remove(type);
+ else
+ transformers.put(type, transformer);
+ }
+ }
+
+ /**
+ * Default InstanceClassFactory implementation simply returns the
+ * instance class.
+ */
+ public Class<? extends Serializable> getManagedObjectClass(Serializable instance)
+ {
+ return instance.getClass();
+ }
+
+ /**
+ * Create a skeleton managed object
+ *
+ * @param <T> the type
+ * @param clazz the clazz
+ * @return the skeleton managed object, null if clazz is not
+ * marked as a ManagementObject.
+ * {@linkplain ManagementObject}
+ */
+ protected <T extends Serializable> ManagedObject createSkeletonManagedObject(Class<T> clazz)
+ {
+ if (clazz == null)
+ throw new IllegalArgumentException("Null class");
+
+ ManagedObjectBuilder builder = getBuilder(clazz);
+ return builder.buildManagedObject(clazz);
+ }
+
+ /**
+ * The ManagedObjectBuilder.buildManagedObject implementation. This is based
+ * on the org.jboss.managed.api.annotation.* package annotations.
+ * @param clazz the attachment class
+ * @return the ManagementObject if clazz is properly annotated, null if
+ * it does not have a ManagementObject annotation.
+ */
+ @SuppressWarnings("unchecked")
+ public ManagedObject buildManagedObject(Class<? extends Serializable> clazz)
+ {
+ boolean trace = log.isTraceEnabled();
+ BeanInfo beanInfo = configuration.getBeanInfo(clazz);
+ ClassInfo classInfo = beanInfo.getClassInfo();
+
+ ManagementObject managementObject = classInfo.getUnderlyingAnnotation(ManagementObject.class);
+ if( managementObject == null )
+ {
+ if (trace)
+ log.trace("No ManagementObject annotation, skipping ManagedObject for class: "+clazz);
+ // Skip the ManagedObject creation
+ return null;
+ }
+
+ HashMap<String, Annotation> moAnnotations = new HashMap<String, Annotation>();
+ moAnnotations.put(ManagementObject.class.getName(), managementObject);
+ ManagementDeployment mnagementDeployment = classInfo.getUnderlyingAnnotation(ManagementDeployment.class);
+ if(mnagementDeployment != null)
+ moAnnotations.put(ManagementDeployment.class.getName(), mnagementDeployment);
+ ManagementObjectID moID = classInfo.getUnderlyingAnnotation(ManagementObjectID.class);
+ if (moID != null)
+ moAnnotations.put(ManagementObjectID.class.getName(), moID);
+
+ // Process the ManagementObject fields
+ boolean isRuntime = managementObject.isRuntime();
+ String name = classInfo.getName();
+ String nameType = null;
+ String attachmentName = classInfo.getName();
+ Class<? extends Fields> moFieldsFactory = null;
+ Class<? extends ManagedPropertyConstraintsPopulatorFactory> moConstraintsFactory = null;
+ Class<? extends ManagedProperty> moPropertyFactory = null;
+ if (managementObject != null)
+ {
+ name = managementObject.name();
+ if (name.length() == 0 || name.equals(ManagementConstants.GENERATED))
+ name = classInfo.getName();
+ nameType = managementObject.type();
+ if (nameType.length() == 0)
+ nameType = null;
+ attachmentName = managementObject.attachmentName();
+ if (attachmentName.length() == 0)
+ attachmentName = classInfo.getName();
+ // Check for a component specification
+ ManagementComponent mc = managementObject.componentType();
+ if (mc.equals(AnnotationDefaults.COMP_TYPE) == false)
+ moAnnotations.put(ManagementComponent.class.getName(), mc);
+ // ManagementObject level default factory classes
+ moFieldsFactory = managementObject.fieldsFactory();
+ moConstraintsFactory = managementObject.constraintsFactory();
+ moPropertyFactory = managementObject.propertyFactory();
+ }
+
+ if (trace)
+ {
+ log.trace("Building MangedObject(name="+name+",nameType="+nameType
+ +",attachmentName="+attachmentName+",isRuntime="+isRuntime+")");
+ }
+
+ ManagementProperties propertyType = ManagementProperties.ALL;
+ if (managementObject != null)
+ propertyType = managementObject.properties();
+
+ // Build the ManagedProperties
+ Set<ManagedProperty> properties = new HashSet<ManagedProperty>();
+
+ Set<PropertyInfo> propertyInfos = beanInfo.getProperties();
+ if (propertyInfos != null && propertyInfos.isEmpty() == false)
+ {
+ for (PropertyInfo propertyInfo : propertyInfos)
+ {
+ // Ignore the "class" property
+ if ("class".equals(propertyInfo.getName()))
+ continue;
+
+ ManagementProperty managementProperty = propertyInfo.getUnderlyingAnnotation(ManagementProperty.class);
+ ManagementObjectID id = propertyInfo.getUnderlyingAnnotation(ManagementObjectID.class);
+ ManagementObjectRef ref = propertyInfo.getUnderlyingAnnotation(ManagementObjectRef.class);
+ ManagementRuntimeRef runtimeRef = propertyInfo.getUnderlyingAnnotation(ManagementRuntimeRef.class);
+ HashMap<String, Annotation> propAnnotations = new HashMap<String, Annotation>();
+ if (managementProperty != null)
+ propAnnotations.put(ManagementProperty.class.getName(), managementProperty);
+ if (id != null)
+ {
+ propAnnotations.put(ManagementObjectID.class.getName(), id);
+ // This overrides the MO nameType
+ nameType = id.type();
+ }
+ if (ref != null)
+ propAnnotations.put(ManagementObjectRef.class.getName(), ref);
+ if (runtimeRef != null)
+ propAnnotations.put(ManagementRuntimeRef.class.getName(), runtimeRef);
+
+ // Check for a simple property
+ boolean includeProperty = (propertyType == ManagementProperties.ALL);
+ if (managementProperty != null)
+ includeProperty = (managementProperty.ignored() == false);
+
+ if (includeProperty)
+ {
+ Fields fields = null;
+ if (managementProperty != null)
+ {
+ Class<? extends Fields> factory = moFieldsFactory;
+ if (factory == ManagementProperty.NULL_FIELDS_FACTORY.class)
+ factory = managementProperty.fieldsFactory();
+ if (factory != ManagementProperty.NULL_FIELDS_FACTORY.class)
+ {
+ try
+ {
+ fields = factory.newInstance();
+ }
+ catch (Exception e)
+ {
+ log.debug("Failed to created Fields", e);
+ }
+ }
+ }
+ if (fields == null)
+ fields = new DefaultFieldsImpl();
+
+ if( propertyInfo instanceof Serializable )
+ {
+ Serializable info = Serializable.class.cast(propertyInfo);
+ fields.setField(Fields.PROPERTY_INFO, info);
+ }
+
+ String propertyName = propertyInfo.getName();
+ if (managementProperty != null)
+ propertyName = managementProperty.name();
+ if( propertyName.length() == 0 )
+ propertyName = propertyInfo.getName();
+ fields.setField(Fields.NAME, propertyName);
+
+ // This should probably always the the propertyInfo name?
+ String mappedName = propertyInfo.getName();
+ if (managementProperty != null)
+ mappedName = managementProperty.mappedName();
+ if( mappedName.length() == 0 )
+ mappedName = propertyInfo.getName();
+ fields.setField(Fields.MAPPED_NAME, mappedName);
+
+ String description = ManagementConstants.GENERATED;
+ if (managementProperty != null)
+ description = managementProperty.description();
+ if (description.equals(ManagementConstants.GENERATED))
+ description = propertyName;
+ fields.setField(Fields.DESCRIPTION, description);
+
+ if (trace)
+ {
+ log.trace("Building MangedProperty(name="+propertyName
+ +",mappedName="+mappedName
+ +") ,annotations="+propAnnotations);
+ }
+
+ boolean mandatory = false;
+ if (managementProperty != null)
+ mandatory = managementProperty.mandatory();
+ if (mandatory)
+ fields.setField(Fields.MANDATORY, Boolean.TRUE);
+
+ boolean managed = false;
+ if (managementProperty != null)
+ managed = managementProperty.managed();
+
+ MetaType metaType;
+ if (managed)
+ {
+ TypeInfo typeInfo = propertyInfo.getType();
+ if(typeInfo.isArray())
+ metaType = new ArrayMetaType(1, MANAGED_OBJECT_META_TYPE);
+ else if (typeInfo.isCollection())
+ metaType = new CollectionMetaType(typeInfo.getName(), MANAGED_OBJECT_META_TYPE);
+ else
+ metaType = MANAGED_OBJECT_META_TYPE;
+ }
+ else
+ {
+ metaType = metaTypeFactory.resolve(propertyInfo.getType());
+ }
+ fields.setField(Fields.META_TYPE, metaType);
+ if (propAnnotations.isEmpty() == false)
+ fields.setField(Fields.ANNOTATIONS, propAnnotations);
+
+ // Delegate others (legal values, min/max etc.) to the constraints factory
+ try
+ {
+ Class<? extends ManagedPropertyConstraintsPopulatorFactory> factoryClass = moConstraintsFactory;
+ if (factoryClass == ManagementProperty.NULL_CONSTRAINTS.class)
+ {
+ if (managementProperty != null)
+ factoryClass = managementProperty.constraintsFactory();
+ }
+ ManagedPropertyConstraintsPopulatorFactory factory = factoryClass.newInstance();
+ ManagedPropertyConstraintsPopulator populator = factory.newInstance();
+ if (populator != null)
+ populator.populateManagedProperty(clazz, propertyInfo, fields);
+ }
+ catch(Exception e)
+ {
+ log.debug("Failed to populate constraints for: "+propertyInfo, e);
+ }
+
+ ManagedProperty property = null;
+ if (managementProperty != null)
+ {
+ Class<? extends ManagedProperty> factory = moPropertyFactory;
+ if (factory == ManagementProperty.NULL_PROPERTY_FACTORY.class)
+ factory = managementProperty.propertyFactory();
+ if (factory != ManagementProperty.NULL_PROPERTY_FACTORY.class)
+ property = getManagedProperty(factory, fields);
+ }
+ // we should have write-through by default
+ // use factory to change this default behavior
+ if (property == null)
+ property = createDefaultManagedProperty(fields);
+ properties.add(property);
+ }
+ else if (trace)
+ log.trace("Ignoring property: " + propertyInfo);
+ }
+ }
+
+ /* TODO: Operations. In general the bean metadata does not contain
+ operation information.
+ */
+ Set<ManagedOperation> operations = new HashSet<ManagedOperation>();
+
+ Set<MethodInfo> methodInfos = beanInfo.getMethods();
+ if (methodInfos != null && methodInfos.isEmpty() == false)
+ {
+ for (MethodInfo methodInfo : methodInfos)
+ {
+ ManagementOperation managementOp = methodInfo.getUnderlyingAnnotation(ManagementOperation.class);
+ if (managementOp == null)
+ continue;
+
+ ManagedOperation op = getManagedOperation(methodInfo, managementOp);
+ operations.add(op);
+ }
+ }
+
+ ManagedObjectImpl result = new ManagedObjectImpl(name, properties);
+ result.setAnnotations(moAnnotations);
+ if (nameType != null)
+ result.setNameType(nameType);
+ if (attachmentName != null)
+ result.setAttachmentName(attachmentName);
+ if (operations.size() > 0 )
+ result.setOperations(operations);
+ for (ManagedProperty property : properties)
+ property.setManagedObject(result);
+ return result;
+ }
+
+ /**
+ * Create default MangedProperty instance.
+ * Override this method for different default.
+ *
+ * @param fields the fields
+ * @return new ManagedProperty instance
+ */
+ protected ManagedProperty createDefaultManagedProperty(Fields fields)
+ {
+ return new WritethroughManagedPropertyImpl(fields, metaValueFactory, this);
+ }
+
+ public void createObject(ManagedObject managedObject, Class<? extends Serializable> clazz)
+ {
+ if (managedObject == null)
+ throw new IllegalArgumentException("Null managed object");
+
+ if (managedObject instanceof ManagedObjectImpl == false)
+ throw new IllegalStateException("Unable to create object " + managedObject.getClass().getName());
+
+ ManagedObjectImpl managedObjectImpl = (ManagedObjectImpl) managedObject;
+ Serializable object = createUnderlyingObject(managedObjectImpl, clazz);
+ populateManagedObject(managedObject, object);
+ }
+
+ public void populateManagedObject(ManagedObject managedObject, Serializable object)
+ {
+ if (managedObject instanceof ManagedObjectImpl == false)
+ throw new IllegalStateException("Unable to populate managed object " + managedObject.getClass().getName());
+
+ ManagedObjectImpl managedObjectImpl = (ManagedObjectImpl) managedObject;
+ managedObjectImpl.setAttachment(object);
+ populateValues(managedObjectImpl, object);
+ }
+
+ /**
+ * Create the underlying object
+ *
+ * @param managedObject the managed object
+ * @param clazz the class
+ * @return the object
+ */
+ protected Serializable createUnderlyingObject(ManagedObjectImpl managedObject, Class<? extends Serializable> clazz)
+ {
+ BeanInfo beanInfo = configuration.getBeanInfo(clazz);
+ try
+ {
+ Object result = beanInfo.newInstance();
+ return Serializable.class.cast(result);
+ }
+ catch (Throwable t)
+ {
+ throw new RuntimeException("Unable to create new object for " + managedObject + " clazz=" + clazz, t);
+ }
+ }
+
+ /**
+ * Populate the values
+ *
+ * @param managedObject the managed object
+ * @param object the object
+ */
+ @SuppressWarnings("unchecked")
+ protected void populateValues(ManagedObjectImpl managedObject, Serializable object)
+ {
+ InstanceClassFactory icf = getInstanceClassFactory(object.getClass());
+ Class moClass;
+ try
+ {
+ moClass = icf.getManagedObjectClass(object);
+ }
+ catch(ClassNotFoundException e)
+ {
+ throw new IllegalStateException(e);
+ }
+ BeanInfo beanInfo = configuration.getBeanInfo(moClass);
+
+ Object componentName = null;
+ Map<String, ManagedProperty> properties = managedObject.getProperties();
+ if (properties != null && properties.size() > 0)
+ {
+ for (ManagedProperty property : properties.values())
+ {
+ MetaValue value = icf.getValue(beanInfo, property, object);
+ if (value != null)
+ property.setField(Fields.VALUE, value);
+ /* Need to look for a ManagementObjectID at the property level which
+ defines the ManagedObject id name from the property value.
+ */
+ Map<String, Annotation> annotations = property.getAnnotations();
+ if (annotations == null)
+ continue;
+ ManagementObjectID id = (ManagementObjectID) annotations.get(ManagementObjectID.class.getName());
+ if (id != null)
+ {
+ if (value == null || value.getMetaType().isSimple() == false)
+ {
+ log.warn("Cannot create String name from non-Simple property: "
+ +property+", value="+value);
+ continue;
+ }
+ SimpleValue svalue = (SimpleValue) value;
+ String name = "" + svalue.getValue();
+ managedObject.setName(name);
+ }
+ ManagementRuntimeRef runtimeRef = (ManagementRuntimeRef) annotations.get(ManagementRuntimeRef.class.getName());
+ if (runtimeRef != null)
+ {
+ componentName = icf.getComponentName(beanInfo, property, object, value);
+ // let's try this as well
+ if (componentName == null && icf != this)
+ componentName = getComponentName(beanInfo, property, object, value);
+ }
+ }
+ }
+ if (componentName == null)
+ componentName = icf.getComponentName(null, null, object, null);
+ // set it, even if it's null
+ managedObject.setComponentName(componentName);
+ }
+
+ /**
+ * Get the property name.
+ *
+ * @param property managed property
+ * @return property name
+ */
+ protected String getPropertyName(ManagedProperty property)
+ {
+ // First look to the mapped name
+ String name = property.getMappedName();
+ if (name == null)
+ property.getName();
+ return name;
+ }
+
+ public Object getComponentName(BeanInfo beanInfo, ManagedProperty property, Serializable object, MetaValue value)
+ {
+ if (beanInfo != null && property != null && value != null)
+ {
+ String name = getPropertyName(property);
+ PropertyInfo propertyInfo = beanInfo.getProperty(name);
+
+ ManagementRuntimeRef componentRef = propertyInfo.getUnderlyingAnnotation(ManagementRuntimeRef.class);
+ if (componentRef != null)
+ {
+ Object original = metaValueFactory.unwrap(value, propertyInfo.getType());
+ try
+ {
+ Class<? extends RuntimeComponentNameTransformer> tClass = componentRef.transformer();
+ RuntimeComponentNameTransformer transformer;
+ if (tClass != ManagementRuntimeRef.DEFAULT_NAME_TRANSFORMER.class)
+ transformer = getComponentNameTransformer(configuration.getTypeInfo(tClass));
+ else
+ transformer = getComponentNameTransformer(propertyInfo.getType());
+
+ return (transformer != null) ? transformer.transform(original) : original;
+ }
+ catch (Throwable t)
+ {
+ throw new UndeclaredThrowableException(t);
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Get a value
+ *
+ * @param beanInfo the bean info
+ * @param property the property
+ * @param object the object
+ * @return the meta value
+ */
+ @SuppressWarnings("unchecked")
+ public MetaValue getValue(BeanInfo beanInfo, ManagedProperty property, Serializable object)
+ {
+ String name = getPropertyName(property);
+ PropertyInfo propertyInfo = beanInfo.getProperty(name);
+
+ Object value;
+ try
+ {
+ value = propertyInfo.get(object);
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (Error e)
+ {
+ throw e;
+ }
+ catch (Throwable t)
+ {
+ throw new RuntimeException("Error getting property " + name + " for " + object.getClass().getName(), t);
+ }
+
+ if (value == null)
+ return null;
+
+ MetaType propertyType = property.getMetaType();
+ if (MANAGED_OBJECT_META_TYPE == propertyType)
+ {
+ if (value instanceof Serializable == false)
+ throw new IllegalStateException("Object is not serializable: " + value.getClass().getName());
+ // Look for a ManagementObjectRef
+ ManagementObjectRef ref = (ManagementObjectRef) property.getAnnotations().get(ManagementObjectRef.class.getName());
+ String moName = (ref != null ? ref.name() : value.getClass().getName());
+ String moNameType = (ref != null ? ref.type() : "");
+ ManagedObject mo = initManagedObject((Serializable) value, moName, moNameType);
+ return new GenericValueSupport(MANAGED_OBJECT_META_TYPE, mo);
+ }
+ else if (propertyType.isArray())
+ {
+ ArrayMetaType arrayType = ArrayMetaType.class.cast(propertyType);
+ if (MANAGED_OBJECT_META_TYPE == arrayType.getElementType())
+ {
+ Collection<?> cvalue = getAsCollection(value);
+ // todo - AJ: changed some generics by best guess
+ ArrayMetaType moType = new ArrayMetaType(1, MANAGED_OBJECT_META_TYPE);
+ ArrayValueSupport moArrayValue = new ArrayValueSupport(moType);
+ List<GenericValueSupport> tmp = new ArrayList<GenericValueSupport>();
+ for(Object element : cvalue)
+ {
+ ManagedObject mo = initManagedObject((Serializable) element, null, null);
+ tmp.add(new GenericValueSupport(MANAGED_OBJECT_META_TYPE, mo));
+ }
+ GenericValueSupport[] mos = new GenericValueSupport[tmp.size()];
+ moArrayValue.setValue(tmp.toArray(mos));
+ return moArrayValue;
+ }
+ }
+ else if (propertyType.isCollection())
+ {
+ CollectionMetaType collectionType = CollectionMetaType.class.cast(propertyType);
+ if (MANAGED_OBJECT_META_TYPE == collectionType.getElementType())
+ {
+ Collection<?> cvalue = getAsCollection(value);
+ List<GenericValueSupport> tmp = new ArrayList<GenericValueSupport>();
+ for(Object element : cvalue)
+ {
+ ManagedObject mo = initManagedObject((Serializable) element, null, null);
+ tmp.add(new GenericValueSupport(MANAGED_OBJECT_META_TYPE, mo));
+ }
+ GenericValueSupport[] mos = new GenericValueSupport[tmp.size()];
+ CollectionMetaType moType = new CollectionMetaType(propertyType.getClassName(), MANAGED_OBJECT_META_TYPE);
+ return new CollectionValueSupport(moType, tmp.toArray(mos));
+ }
+ }
+
+ return metaValueFactory.create(value, propertyInfo.getType());
+ }
+
+ /**
+ * Set a value
+ *
+ * @param beanInfo the bean info
+ * @param property the property
+ * @param object the object
+ * @param value the meta value
+ */
+ public void setValue(BeanInfo beanInfo, ManagedProperty property, Serializable object, MetaValue value)
+ {
+ String name = getPropertyName(property);
+ PropertyInfo propertyInfo = beanInfo.getProperty(name);
+
+ Object plainValue = metaValueFactory.unwrap(value, propertyInfo.getType());
+ try
+ {
+ propertyInfo.set(object, plainValue);
+ }
+ catch (Throwable t)
+ {
+ throw new UndeclaredThrowableException(t);
+ }
+ }
+
+ /**
+ *
+ * @param methodInfo
+ * @param opAnnotation
+ * @return the managed operation
+ */
+ protected ManagedOperation getManagedOperation(MethodInfo methodInfo, ManagementOperation opAnnotation)
+ {
+ String name = methodInfo.getName();
+ String description = opAnnotation.description();
+ Impact impact = opAnnotation.impact();
+ ManagementParameter[] params = opAnnotation.params();
+ ParameterInfo[] paramInfo = methodInfo.getParameters();
+ TypeInfo returnInfo = methodInfo.getReturnType();
+ MetaType returnType = metaTypeFactory.resolve(returnInfo);
+ ArrayList<ManagedParameter> mparams = new ArrayList<ManagedParameter>();
+ Class<? extends ManagedParameterConstraintsPopulatorFactory> opConstraintsFactor = opAnnotation.constraintsFactory();
+
+ if( paramInfo != null )
+ {
+ for(int i = 0; i < paramInfo.length; i ++)
+ {
+ ParameterInfo pinfo = paramInfo[i];
+ String pname = pinfo.getName();
+ String pdescription = null;
+ ManagementParameter mpa = null;
+ // Look to ManagementParameter for info
+ if (i < params.length)
+ {
+ mpa = params[i];
+ if (mpa.name().equals(AnnotationDefaults.EMPTY_STRING) == false)
+ pname = mpa.name();
+ if (mpa.description().equals(AnnotationDefaults.EMPTY_STRING) == false)
+ pdescription = mpa.description();
+ }
+ // Generate a name if there is none
+ if (pname == null)
+ pname = "arg#" + i;
+ Fields fields = new DefaultFieldsImpl(pname);
+ if (pdescription != null)
+ fields.setField(Fields.DESCRIPTION, pdescription);
+ MetaType metaType = metaTypeFactory.resolve(pinfo.getParameterType());
+ fields.setField(Fields.META_TYPE, metaType);
+ // Delegate others (legal values, min/max etc.) to the constraints factory
+ try
+ {
+ Class<? extends ManagedParameterConstraintsPopulatorFactory> factoryClass = opConstraintsFactor;
+ if (factoryClass == ManagementParameter.NULL_CONSTRAINTS.class)
+ {
+ if (mpa != null)
+ factoryClass = mpa.constraintsFactory();
+ }
+ ManagedParameterConstraintsPopulatorFactory factory = factoryClass.newInstance();
+ ManagedParameterConstraintsPopulator populator = factory.newInstance();
+ if (populator != null)
+ populator.populateManagedParameter(name, pinfo, fields);
+ }
+ catch(Exception e)
+ {
+ log.debug("Failed to populate constraints for: "+pinfo, e);
+ }
+
+ ManagedParameterImpl mp = new ManagedParameterImpl(fields);
+ mparams.add(mp);
+ }
+ }
+ ManagedParameter[] parameters = new ManagedParameter[mparams.size()];
+ mparams.toArray(parameters);
+
+ return new ManagedOperationImpl(name, description, impact, parameters, returnType);
+ }
+
+ /**
+ * Get the builder for a class
+ *
+ * @param clazz the class
+ * @return the builder
+ */
+ protected ManagedObjectBuilder getBuilder(Class<?> clazz)
+ {
+ synchronized (builders)
+ {
+ ManagedObjectBuilder builder = builders.get(clazz);
+ if (builder != null)
+ return builder;
+ }
+ return this;
+ }
+
+ /**
+ * Get the instance factory for a class
+ *
+ * @param clazz the class
+ * @return the InstanceClassFactory
+ */
+ @SuppressWarnings("unchecked")
+ public <T extends Serializable> InstanceClassFactory<T> getInstanceClassFactory(Class<T> clazz)
+ {
+ synchronized (instanceFactories)
+ {
+ InstanceClassFactory factory = instanceFactories.get(clazz);
+ if (factory != null)
+ return factory;
+ }
+ return (InstanceClassFactory<T>)this;
+ }
+
+ /**
+ * Get component name transformer.
+ *
+ * @param type the type info
+ * @return transformer instance
+ * @throws Throwable for any error
+ */
+ protected RuntimeComponentNameTransformer getComponentNameTransformer(TypeInfo type) throws Throwable
+ {
+ synchronized(transformers)
+ {
+ RuntimeComponentNameTransformer transformer = transformers.get(type);
+ if (transformer != null)
+ return transformer;
+
+ TypeInfo rcntType = configuration.getTypeInfo(RuntimeComponentNameTransformer.class);
+ if (rcntType.isAssignableFrom(type))
+ {
+ BeanInfo beanInfo = configuration.getBeanInfo(type);
+ RuntimeComponentNameTransformer newTransformer = (RuntimeComponentNameTransformer)beanInfo.newInstance();
+ transformers.put(type, newTransformer);
+ return newTransformer;
+ }
+
+ return null;
+ }
+ }
+
+ /**
+ * Get the populator for a class
+ *
+ * @param clazz the class
+ * @return the populator
+ */
+ @SuppressWarnings("unchecked")
+ protected ManagedObjectPopulator<Serializable> getPopulator(Class<?> clazz)
+ {
+ ManagedObjectBuilder builder = getBuilder(clazz);
+ if (builder instanceof ManagedObjectPopulator)
+ return (ManagedObjectPopulator) builder;
+ return this;
+ }
+
+ protected Collection<?> getAsCollection(Object value)
+ {
+ if( value.getClass().isArray() )
+ return Arrays.asList(value);
+ else if (value instanceof Collection)
+ return Collection.class.cast(value);
+ return null;
+ }
+
+ /**
+ * Look for ctor(Fields)
+ * @param factory - the ManagedProperty implementation class
+ * @param fields - the fields to pass to the ctor
+ * @return the managed property
+ */
+ protected ManagedProperty getManagedProperty(Class<? extends ManagedProperty> factory, Fields fields)
+ {
+ return createManagedProperty(factory, fields);
+ }
+}
Copied: projects/jboss-man/tags/2.0.0.Beta13/managed/src/tests/org/jboss/test/managed/factory/support/deployment (from rev 73461, projects/jboss-man/trunk/managed/src/tests/org/jboss/test/managed/factory/support/deployment)
Copied: projects/jboss-man/tags/2.0.0.Beta13/managed/src/tests/org/jboss/test/managed/factory/test/ManagementDeploymentUnitTestCase.java (from rev 73461, projects/jboss-man/trunk/managed/src/tests/org/jboss/test/managed/factory/test/ManagementDeploymentUnitTestCase.java)
===================================================================
--- projects/jboss-man/tags/2.0.0.Beta13/managed/src/tests/org/jboss/test/managed/factory/test/ManagementDeploymentUnitTestCase.java (rev 0)
+++ projects/jboss-man/tags/2.0.0.Beta13/managed/src/tests/org/jboss/test/managed/factory/test/ManagementDeploymentUnitTestCase.java 2008-05-17 15:31:22 UTC (rev 73467)
@@ -0,0 +1,68 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* 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.
+*
+* This software 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.
+*/
+package org.jboss.test.managed.factory.test;
+
+import java.lang.annotation.Annotation;
+import java.util.Map;
+
+import org.jboss.managed.api.ManagedObject;
+import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
+import org.jboss.managed.api.annotation.ManagementDeployment;
+import org.jboss.test.managed.factory.AbstractManagedObjectFactoryTest;
+import org.jboss.test.managed.factory.support.deployment.JmsDestinations;
+
+/**
+ * ManagementDeployment tests
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision: 1.1 $
+ */
+public class ManagementDeploymentUnitTestCase extends AbstractManagedObjectFactoryTest
+{
+
+ public ManagementDeploymentUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ /**
+ * Test that the ManagementDeployment annotation shows up on the root
+ * ManagedObject
+ */
+ public void testManagementDeploymentonMO()
+ {
+ getLog().info("JmsDestinations.CS: "+JmsDestinations.class.getProtectionDomain().getCodeSource());
+ Annotation[] reflectAnnotations = JmsDestinations.class.getAnnotations();
+ assertEquals(2, reflectAnnotations.length);
+ JmsDestinations destinations = new JmsDestinations();
+ ManagedObject mo = initManagedObject(destinations);
+ assertNotNull(mo);
+ Map<String, Annotation> annotations = mo.getAnnotations();
+ getLog().info(annotations);
+ ManagementDeployment mda = (ManagementDeployment) annotations.get(ManagementDeployment.class.getName());
+ assertNotNull(mda);
+ assertEquals(DeploymentPhase.APPLICATION, mda.phase());
+ assertEquals(1, mda.types().length);
+ assertEquals("jms", mda.types()[0]);
+ }
+
+}
Deleted: projects/jboss-man/tags/2.0.0.Beta13/metatype/pom.xml
===================================================================
--- projects/jboss-man/trunk/metatype/pom.xml 2008-05-16 17:46:20 UTC (rev 73452)
+++ projects/jboss-man/tags/2.0.0.Beta13/metatype/pom.xml 2008-05-17 15:31:22 UTC (rev 73467)
@@ -1,128 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <groupId>org.jboss.man</groupId>
- <artifactId>jboss-man</artifactId>
- <version>2.0.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>jboss-metatype</artifactId>
- <packaging>jar</packaging>
- <name>JBoss Metatype</name>
- <url>http://www.jboss.com/products/jbossmc</url>
- <description>JBoss Metatype</description>
- <!-- Do not add version information here, use ../build/pom.xml instead -->
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <testFailureIgnore>true</testFailureIgnore>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <!-- Global dependencies -->
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-reflect</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-common-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>jboss</groupId>
- <artifactId>jboss-common-logging-spi</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-common-logging-spi</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-common-core</artifactId>
- <exclusions>
- <exclusion>
- <groupId>jboss</groupId>
- <artifactId>jboss-common-logging-spi</artifactId>
- </exclusion>
- <exclusion>
- <groupId>apache-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- </exclusion>
- <exclusion>
- <groupId>apache-slide</groupId>
- <artifactId>webdavlib</artifactId>
- </exclusion>
- <exclusion>
- <groupId>apache-xerces</groupId>
- <artifactId>xml-apis</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <!-- Test dependencies -->
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-common-logging-log4j</artifactId>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>jboss</groupId>
- <artifactId>jboss-common-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>jboss</groupId>
- <artifactId>jboss-common-logging-spi</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-test</artifactId>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-common-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>jboss</groupId>
- <artifactId>jboss-common-logging-spi</artifactId>
- </exclusion>
- <exclusion>
- <groupId>jboss</groupId>
- <artifactId>jboss-common-logging-log4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>jboss.profiler.jvmti</groupId>
- <artifactId>jboss-profiler-jvmti</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant-junit</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
Copied: projects/jboss-man/tags/2.0.0.Beta13/metatype/pom.xml (from rev 73465, projects/jboss-man/trunk/metatype/pom.xml)
===================================================================
--- projects/jboss-man/tags/2.0.0.Beta13/metatype/pom.xml (rev 0)
+++ projects/jboss-man/tags/2.0.0.Beta13/metatype/pom.xml 2008-05-17 15:31:22 UTC (rev 73467)
@@ -0,0 +1,128 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.jboss.man</groupId>
+ <artifactId>jboss-man</artifactId>
+ <version>2.0.0.Beta13</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>jboss-metatype</artifactId>
+ <packaging>jar</packaging>
+ <name>JBoss Metatype</name>
+ <url>http://www.jboss.com/products/jbossmc</url>
+ <description>JBoss Metatype</description>
+ <!-- Do not add version information here, use ../build/pom.xml instead -->
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <testFailureIgnore>true</testFailureIgnore>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <!-- Global dependencies -->
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-reflect</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-common-logging-spi</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-common-logging-spi</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-common-logging-spi</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>apache-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>apache-slide</groupId>
+ <artifactId>webdavlib</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>apache-xerces</groupId>
+ <artifactId>xml-apis</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <!-- Test dependencies -->
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-common-logging-log4j</artifactId>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-common-logging-spi</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-test</artifactId>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-common-logging-spi</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-common-logging-log4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>jboss.profiler.jvmti</groupId>
+ <artifactId>jboss-profiler-jvmti</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant-junit</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
Deleted: projects/jboss-man/tags/2.0.0.Beta13/pom.xml
===================================================================
--- projects/jboss-man/trunk/pom.xml 2008-05-16 17:46:20 UTC (rev 73452)
+++ projects/jboss-man/tags/2.0.0.Beta13/pom.xml 2008-05-17 15:31:22 UTC (rev 73467)
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- The parent maven for the managed project
-
- This pom aggregates the subproject pom
-
- To build this project maven 2 should be installed and in the system path. From the command line
- run "mvn" from the build directory and "install" will be used as the default goal. In order to use
- the "deploy" goal, the mvn.cvs.root should be specified in settings.xml.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-parent</artifactId>
- <version>3</version>
- </parent>
- <groupId>org.jboss.man</groupId>
- <artifactId>jboss-man-aggregator</artifactId>
- <version>2.0.0-SNAPSHOT</version>
- <packaging>pom</packaging>
- <name>JBoss Managed Aggregator</name>
- <url>http://www.jboss.com/products/jbossmc</url>
- <description>
- JBoss Managed
- </description>
- <scm>
- <connection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/jboss-man/trunk</connection>
- </scm>
-
- <modules>
- <module>build</module>
- <module>metatype</module>
- <module>managed</module>
- </modules>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-release-plugin</artifactId>
- <version>2.0-beta-7</version>
- <configuration>
- <tagBase>https://svn.jboss.org/repos/jbossas/projects/jboss-man/tags</tagBase>
- <autoVersionSubmodules>true</autoVersionSubmodules>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>eclipse</id>
- <build>
- <defaultGoal>process-test-resources</defaultGoal>
- </build>
- </profile>
- </profiles>
-
-</project>
Copied: projects/jboss-man/tags/2.0.0.Beta13/pom.xml (from rev 73465, projects/jboss-man/trunk/pom.xml)
===================================================================
--- projects/jboss-man/tags/2.0.0.Beta13/pom.xml (rev 0)
+++ projects/jboss-man/tags/2.0.0.Beta13/pom.xml 2008-05-17 15:31:22 UTC (rev 73467)
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ The parent maven for the managed project
+
+ This pom aggregates the subproject pom
+
+ To build this project maven 2 should be installed and in the system path. From the command line
+ run "mvn" from the build directory and "install" will be used as the default goal. In order to use
+ the "deploy" goal, the mvn.cvs.root should be specified in settings.xml.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-parent</artifactId>
+ <version>3</version>
+ </parent>
+ <groupId>org.jboss.man</groupId>
+ <artifactId>jboss-man-aggregator</artifactId>
+ <version>2.0.0.Beta13</version>
+ <packaging>pom</packaging>
+ <name>JBoss Managed Aggregator</name>
+ <url>http://www.jboss.com/products/jbossmc</url>
+ <description>
+ JBoss Managed
+ </description>
+ <scm>
+ <connection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/jboss-man/tags/2.0.0.Beta13</connection>
+ </scm>
+
+ <modules>
+ <module>build</module>
+ <module>metatype</module>
+ <module>managed</module>
+ </modules>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+ <version>2.0-beta-7</version>
+ <configuration>
+ <tagBase>https://svn.jboss.org/repos/jbossas/projects/jboss-man/tags</tagBase>
+ <autoVersionSubmodules>true</autoVersionSubmodules>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>eclipse</id>
+ <build>
+ <defaultGoal>process-test-resources</defaultGoal>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
More information about the jboss-cvs-commits
mailing list