Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
/target
/test-output
/.settings
/.idea
*.iml
23 changes: 13 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,18 @@
</build>

<distributionManagement>
<repository>
<id>elibom</id>
<url>http://repository.elibom.net/nexus/content/repositories/releases</url>
</repository>

<snapshotRepository>
<id>elibom</id>
<url>http://repository.elibom.net/nexus/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>releases</id>
<name>Internal Releases</name>
<url>http://maven.polarislabs.com/content/repositories/releases/</url>
<layout>default</layout>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>Internal Snapshots</name>
<url>http://maven.polarislabs.com/content/repositories/snapshots/</url>
<layout>default</layout>
</snapshotRepository>
</distributionManagement>

</project>
</project>
19 changes: 19 additions & 0 deletions src/main/java/net/gescobar/jmx/annotation/DescriptorFields.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package net.gescobar.jmx.annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.PARAMETER, ElementType.TYPE})
public @interface DescriptorFields {
/**
* Key-value pairs
*
* @return
*/
String[] value();
}
17 changes: 8 additions & 9 deletions src/main/java/net/gescobar/jmx/annotation/Impact.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,23 @@
import javax.management.MBeanOperationInfo;

/**
* An enum that maps to <code>impact</code> options of the <code>MBeanOperationInfo</code>.
*
* An enum that maps to
* <code>impact</code> options of the
* <code>MBeanOperationInfo</code>.
*
* @author German Escobar
*/
public enum Impact {

ACTION(MBeanOperationInfo.ACTION),

ACTION(MBeanOperationInfo.ACTION),
INFO(MBeanOperationInfo.INFO),

ACTION_INFO(MBeanOperationInfo.ACTION_INFO),

UNKNOWN(MBeanOperationInfo.UNKNOWN);

private int code;

private Impact(int code) {
this.code = code;
this.code = code;
}

public int getCode() {
Expand Down
16 changes: 16 additions & 0 deletions src/main/java/net/gescobar/jmx/impl/AbstractInstanceResolver.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package net.gescobar.jmx.impl;

/**
* Abstraction to allow for lazy-resolution of proxy targets.
*
* @author bvarner
*/
public abstract class AbstractInstanceResolver {

/**
* Return an object to have methods or attributes invoked upon it.
*
* @return
*/
public abstract Object resolve();
}
28 changes: 28 additions & 0 deletions src/main/java/net/gescobar/jmx/impl/InstanceResolver.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package net.gescobar.jmx.impl;

/**
* A generic AbstractInstanceResolver which resolve the same object every time.
*
* @author bvarner
*/
public class InstanceResolver extends AbstractInstanceResolver {

private Object target;

/**
* Creates a new InstanceResolver which returns the given object.
*/
public InstanceResolver(Object obj) {
this.target = obj;
}

/**
* Returns the object this InstanceResolver was constructed to wrap
*
* @return
*/
@Override
public Object resolve() {
return target;
}
}
Loading