Skip to content

Commit

Permalink
Snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
dmlloyd committed Sep 17, 2012
1 parent 5eb09d9 commit b04890d
Show file tree
Hide file tree
Showing 24 changed files with 656 additions and 20 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ target/
*.ipr
*.iws
*.iml
.idea
41 changes: 41 additions & 0 deletions example/src/main/java/example1/BootTimePropertyType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* 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 example1;

import org.jboss.mgmt.annotation.AttributeType;
import org.jboss.mgmt.annotation.xml.XmlRender;

import static org.jboss.mgmt.annotation.xml.XmlRender.As.ELEMENT;

/**
* @author <a href="mailto:david.lloyd@redhat.com">David M. Lloyd</a>
*/
@AttributeType
@XmlRender(as = ELEMENT)
public interface BootTimePropertyType extends PropertyType {
String getName();

String getValue();

boolean isBootTime();
}
57 changes: 56 additions & 1 deletion example/src/main/java/example1/DomainResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,64 @@

package example1;

import java.util.List;
import java.util.Map;
import org.jboss.mgmt.Resource;
import org.jboss.mgmt.annotation.Attribute;
import org.jboss.mgmt.annotation.ModelRoot;
import org.jboss.mgmt.annotation.SubResource;

/**
* @author <a href="mailto:david.lloyd@redhat.com">David M. Lloyd</a>
*/
public interface DomainResource {
@ModelRoot(name = "domain")
public interface DomainResource extends Resource {

@Attribute
Map<String, BootTimePropertyType> getProperties();

@SubResource
List<String> getPathNames();

PathResource getPath(String name);

@SubResource
List<String> getProfileNames();

ProfileResource getProfile(String name);

@SubResource
List<String> getInterfaceNames();

// InterfaceResource getInterface(String name);

@SubResource
List<String> getSocketBindingGroupNames();

// SocketBindingGroup getSocketBindingGroup(String name);

@SubResource
List<String> getDeploymentNames();

// DomainDeployment getDeployment(String name);

@SubResource
List<String> getServerGroupNames();

// ServerGroup getServerGroup(String name);

@SubResource
List<String> getManagementClientContextNames();

// ManagementClientContext getManagementClientContext(String name);

@SubResource
List<String> getJvmNames();

// Jvm getJvm(String name);

@SubResource
List<String> getServers();

DomainServerResource getServer(String name);
}
6 changes: 2 additions & 4 deletions example/src/main/java/example1/DomainServerResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,12 @@

package example1;

import org.jboss.mgmt.Access;
import org.jboss.mgmt.Attribute;
import org.jboss.mgmt.ResourceType;
import org.jboss.mgmt.annotation.Access;
import org.jboss.mgmt.annotation.Attribute;

/**
* @author <a href="mailto:david.lloyd@redhat.com">David M. Lloyd</a>
*/
@ResourceType
public interface DomainServerResource extends ServerResource {

@Attribute(access = Access.READ_ONLY)
Expand Down
8 changes: 3 additions & 5 deletions example/src/main/java/example1/FileHandlerResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,13 @@

package example1;

import org.jboss.mgmt.Attribute;
import org.jboss.mgmt.AttributeType;
import org.jboss.mgmt.Reference;
import org.jboss.mgmt.ResourceType;
import org.jboss.mgmt.annotation.Attribute;
import org.jboss.mgmt.annotation.AttributeType;
import org.jboss.mgmt.annotation.Reference;

/**
* @author <a href="mailto:david.lloyd@redhat.com">David M. Lloyd</a>
*/
@ResourceType
public interface FileHandlerResource extends HandlerResource {

@AttributeType
Expand Down
6 changes: 6 additions & 0 deletions example/src/main/java/example1/LoggingSubsystemResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,18 @@
import org.jboss.mgmt.annotation.ModelRoot;
import org.jboss.mgmt.annotation.Provides;
import org.jboss.mgmt.annotation.SubResource;
import org.jboss.mgmt.annotation.xml.Mapping;
import org.jboss.mgmt.annotation.xml.XmlVersionMapping;

/**
* @author <a href="mailto:david.lloyd@redhat.com">David M. Lloyd</a>
*/
@Provides("logging")
@ModelRoot(name = "logging")
@XmlVersionMapping({
@Mapping(xmlns = "ext:core.logging:1.0", version = "1.0"),
@Mapping(xmlns = "ext:core.logging:1.1", version = "1.1")
})
public interface LoggingSubsystemResource extends SubsystemResource {

@SubResource
Expand Down
39 changes: 39 additions & 0 deletions example/src/main/java/example1/PropertyType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* 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 example1;

import org.jboss.mgmt.annotation.AttributeType;
import org.jboss.mgmt.annotation.xml.XmlRender;

import static org.jboss.mgmt.annotation.xml.XmlRender.As.ELEMENT;

/**
* @author <a href="mailto:david.lloyd@redhat.com">David M. Lloyd</a>
*/
@AttributeType
@XmlRender(as = ELEMENT)
public interface PropertyType {
String getName();

String getValue();
}
3 changes: 0 additions & 3 deletions example/src/main/java/example1/StandaloneServerResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,9 @@

package example1;

import org.jboss.mgmt.ResourceType;

/**
* @author <a href="mailto:david.lloyd@redhat.com">David M. Lloyd</a>
*/
@ResourceType
public interface StandaloneServerResource extends ServerResource {

// inline resource, cannot have conflicting attribute names
Expand Down
5 changes: 3 additions & 2 deletions tool/src/main/java/org/jboss/mgmt/annotation/Description.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.SOURCE;

/**
* A description for a resource.
* A description for a resource or attribute.
*/
@Target(TYPE)
@Target({TYPE, METHOD})
@Retention(SOURCE)
public @interface Description {
String value();
Expand Down
1 change: 0 additions & 1 deletion tool/src/main/java/org/jboss/mgmt/annotation/Listener.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,5 @@
public @interface Listener {
Class<?> value();


RuntimeMode[] modes();
}
34 changes: 34 additions & 0 deletions tool/src/main/java/org/jboss/mgmt/annotation/OperationHook.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* 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.mgmt.annotation;

/**
* @author <a href="mailto:david.lloyd@redhat.com">David M. Lloyd</a>
*/
public @interface OperationHook {
String operationName();

String[] versions() default {};


}
40 changes: 40 additions & 0 deletions tool/src/main/java/org/jboss/mgmt/annotation/OperationHooks.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* 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.mgmt.annotation;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.SOURCE;

/**
* Define operation hook classes. The class methods will be examined for the actual hooks.
*
* @author <a href="mailto:david.lloyd@redhat.com">David M. Lloyd</a>
*/
@Retention(SOURCE)
@Target(TYPE)
public @interface OperationHooks {
Class<?>[] value();
}
2 changes: 2 additions & 0 deletions tool/src/main/java/org/jboss/mgmt/annotation/xml/Mapping.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@
String xmlns();

String version();

String[] additionalXmlns() default {};
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,6 @@ enum As {
}

As as();

boolean wrapperElement() default true;
}
Loading

0 comments on commit b04890d

Please sign in to comment.