Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

few examples

threads are still WIP
  • Loading branch information...
commit 3f5a002ff8f19df6a0fc58d26147562b38361297 1 parent 7e92f66
@ctomc ctomc authored committed
View
26 examples/threads/pom.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>jboss-mgmt</artifactId>
+ <groupId>org.jboss.mgmt</groupId>
+ <version>1.0.0.Beta1-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>jboss-as-threads</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.mgmt</groupId>
+ <artifactId>jboss-mgmt-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.mgmt</groupId>
+ <artifactId>jboss-mgmt-tool</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+</project>
View
29 examples/threads/src/main/java/org/jboss/as/threads/ThreadFactoryResource.java
@@ -0,0 +1,29 @@
+package org.jboss.as.threads;
+
+import org.jboss.mgmt.Resource;
+import org.jboss.mgmt.annotation.Attribute;
+import org.jboss.mgmt.annotation.Required;
+import org.jboss.mgmt.annotation.XmlName;
+import org.jboss.mgmt.annotation.XmlRender;
+
+/**
+ * @author <a href="mailto:tomaz.cerar@redhat.com">Tomaz Cerar</a> (c) 2012 Red Hat Inc.
+ */
+@XmlName("thread-factory")
+public interface ThreadFactoryResource extends Resource {
+ @XmlRender(as = XmlRender.As.ATTRIBUTE)
+ @Attribute(allowExpression = false)
+ @Required(false)
+ String getGroupName();
+
+ @Attribute
+ @Required(false)
+ @XmlRender(as = XmlRender.As.ATTRIBUTE)
+ String getThreadNamePattern();
+
+ @Required(false)
+ @XmlRender(as = XmlRender.As.ATTRIBUTE)
+ @Attribute(/*validators = {IntRangeValidator.class}*/)
+ int getPriority();
+
+}
View
29 examples/threads/src/main/java/org/jboss/as/threads/ThreadsSubsystemResource.java
@@ -0,0 +1,29 @@
+package org.jboss.as.threads;
+
+import java.util.List;
+
+import org.jboss.mgmt.Resource;
+import org.jboss.mgmt.annotation.Provides;
+import org.jboss.mgmt.annotation.RootResource;
+import org.jboss.mgmt.annotation.SubResource;
+import org.jboss.mgmt.annotation.XmlName;
+
+/**
+ * @author <a href="mailto:tomaz.cerar@redhat.com">Tomaz Cerar</a> (c) 2012 Red Hat Inc.
+ */
+@Threads_1_0
+@Provides("threads")
+@XmlName("subsystem")
+@RootResource(
+ type = "subsystem",
+ name = "threads"
+)
+public interface ThreadsSubsystemResource extends Resource {
+
+ @SubResource
+ //Map<String, ThreadFactoryResource> getThreadFactoryNames();
+ //List<String> getThreadFactoryNames();
+ ThreadFactoryResource getThreadFactory(String name);
+
+ List<String> getThreadFactoryNames();
+}
View
46 examples/threads/src/main/java/org/jboss/as/threads/Threads_1_0.java
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.as.threads;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.SOURCE;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import org.jboss.mgmt.annotation.Schema;
+
+/**
+ * @author <a href="mailto:tomaz.cerar@redhat.com">Tomaz Cerar</a> (c) 2012 Red Hat Inc.
+ */
+@Schema(
+ schemaLocation = "http://www.jboss.org/schema/jbossas/jboss-as-threads_1_0.xsd",
+ compatibilityNamespaces = { "urn:jboss:xts:1.0" },
+ kind = Schema.Kind.EXTENSION,
+ namespace = "core.xts",
+ version = "1.0"
+)
+@Retention(SOURCE)
+@Target(TYPE)
+public @interface Threads_1_0 {
+}
View
26 examples/xts/pom.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>jboss-mgmt</artifactId>
+ <groupId>org.jboss.mgmt</groupId>
+ <version>1.0.0.Beta1-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>jboss-as-xts</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.mgmt</groupId>
+ <artifactId>jboss-mgmt-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.mgmt</groupId>
+ <artifactId>jboss-mgmt-tool</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+</project>
View
25 examples/xts/src/main/java/org/jboss/as/xts/XTSSubsystemResource.java
@@ -0,0 +1,25 @@
+package org.jboss.as.xts;
+
+
+import org.jboss.mgmt.Resource;
+import org.jboss.mgmt.annotation.Attribute;
+import org.jboss.mgmt.annotation.Provides;
+import org.jboss.mgmt.annotation.RootResource;
+import org.jboss.mgmt.annotation.XmlName;
+
+/**
+ * @author <a href="mailto:tomaz.cerar@redhat.com">Tomaz Cerar</a> (c) 2012 Red Hat Inc.
+ */
+@XTS_1_0
+@Provides("xts")
+@XmlName("subsystem")
+@RootResource(
+ type = "subsystem",
+ name = "xts"
+)
+public interface XTSSubsystemResource extends Resource {
+
+ @Attribute
+ //@XmlRender(as = XmlRender.As.ATTRIBUTE) //todo this breaks annotation processor
+ String getEnvironmentUrl();
+}
View
46 examples/xts/src/main/java/org/jboss/as/xts/XTS_1_0.java
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.as.xts;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.SOURCE;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import org.jboss.mgmt.annotation.Schema;
+
+/**
+ * @author <a href="mailto:tomaz.cerar@redhat.com">Tomaz Cerar</a> (c) 2012 Red Hat Inc.
+ */
+@Schema(
+ schemaLocation = "http://www.jboss.org/schema/jbossas/jboss-as-xts_1_0.xsd",
+ compatibilityNamespaces = { "urn:jboss:xts:1.0" },
+ kind = Schema.Kind.EXTENSION,
+ namespace = "core.xts",
+ version = "1.0"
+)
+@Retention(SOURCE)
+@Target(TYPE)
+public @interface XTS_1_0 {
+}
View
3  pom.xml
@@ -47,6 +47,8 @@
<modules>
<module>api</module>
<module>tool</module>
+ <module>examples/xts</module>
+ <module>examples/threads</module>
<module>example</module>
</modules>
@@ -56,7 +58,6 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>${version.compiler.plugin}</version>
<configuration>
- <fork>false</fork>
<showWarnings>true</showWarnings>
<compilerArguments>
<!--<XprintRounds />-->
View
2  tool/src/main/java/org/jboss/mgmt/annotation/Attribute.java
@@ -72,7 +72,7 @@
*
* @return {@code true} to allow expressions, {@code false} otherwise
*/
- boolean expression() default false;
+ boolean allowExpression() default true;
Class<? extends AttributeValidator>[] validators() default {};
}
View
2  tool/src/main/java/org/jboss/mgmt/annotation/XmlRender.java
@@ -43,4 +43,6 @@
As as();
boolean wrapperElement() default true;
+
+ String wrapperElementName() default "";
}
Please sign in to comment.
Something went wrong with that request. Please try again.