From ee57a36ba20db30f9bf18df9fff6c8793b2b9912 Mon Sep 17 00:00:00 2001 From: Zhen Tang Date: Wed, 26 Jun 2013 00:06:05 +0800 Subject: [PATCH] Plugin annotations and abstract classes added. --- .../agent/plugin/AbstractControlFunction.java | 5 +++++ .../bench4q/agent/plugin/AbstractFunction.java | 5 +++++ .../org/bench4q/agent/plugin/AbstractPlugin.java | 5 +++++ .../agent/plugin/AbstractSampleFunction.java | 5 +++++ .../agent/plugin/AbstractTestFunction.java | 5 +++++ .../agent/plugin/AbstractTimerFunction.java | 5 +++++ .../agent/plugin/annotation/Function.java | 16 ++++++++++++++++ .../agent/plugin/annotation/FunctionType.java | 5 +++++ .../agent/plugin/annotation/Parameter.java | 7 +++++++ .../bench4q/agent/plugin/annotation/Plugin.java | 11 +++++++++++ 10 files changed, 69 insertions(+) create mode 100644 src/main/java/org/bench4q/agent/plugin/AbstractControlFunction.java create mode 100644 src/main/java/org/bench4q/agent/plugin/AbstractFunction.java create mode 100644 src/main/java/org/bench4q/agent/plugin/AbstractPlugin.java create mode 100644 src/main/java/org/bench4q/agent/plugin/AbstractSampleFunction.java create mode 100644 src/main/java/org/bench4q/agent/plugin/AbstractTestFunction.java create mode 100644 src/main/java/org/bench4q/agent/plugin/AbstractTimerFunction.java create mode 100644 src/main/java/org/bench4q/agent/plugin/annotation/Function.java create mode 100644 src/main/java/org/bench4q/agent/plugin/annotation/FunctionType.java create mode 100644 src/main/java/org/bench4q/agent/plugin/annotation/Parameter.java create mode 100644 src/main/java/org/bench4q/agent/plugin/annotation/Plugin.java diff --git a/src/main/java/org/bench4q/agent/plugin/AbstractControlFunction.java b/src/main/java/org/bench4q/agent/plugin/AbstractControlFunction.java new file mode 100644 index 00000000..c6f2905a --- /dev/null +++ b/src/main/java/org/bench4q/agent/plugin/AbstractControlFunction.java @@ -0,0 +1,5 @@ +package org.bench4q.agent.plugin; + +public abstract class AbstractControlFunction extends AbstractFunction { + +} diff --git a/src/main/java/org/bench4q/agent/plugin/AbstractFunction.java b/src/main/java/org/bench4q/agent/plugin/AbstractFunction.java new file mode 100644 index 00000000..ee495bf7 --- /dev/null +++ b/src/main/java/org/bench4q/agent/plugin/AbstractFunction.java @@ -0,0 +1,5 @@ +package org.bench4q.agent.plugin; + +public abstract class AbstractFunction { + +} diff --git a/src/main/java/org/bench4q/agent/plugin/AbstractPlugin.java b/src/main/java/org/bench4q/agent/plugin/AbstractPlugin.java new file mode 100644 index 00000000..7eb211a7 --- /dev/null +++ b/src/main/java/org/bench4q/agent/plugin/AbstractPlugin.java @@ -0,0 +1,5 @@ +package org.bench4q.agent.plugin; + +public abstract class AbstractPlugin { + +} diff --git a/src/main/java/org/bench4q/agent/plugin/AbstractSampleFunction.java b/src/main/java/org/bench4q/agent/plugin/AbstractSampleFunction.java new file mode 100644 index 00000000..11f31483 --- /dev/null +++ b/src/main/java/org/bench4q/agent/plugin/AbstractSampleFunction.java @@ -0,0 +1,5 @@ +package org.bench4q.agent.plugin; + +public abstract class AbstractSampleFunction extends AbstractFunction { + +} diff --git a/src/main/java/org/bench4q/agent/plugin/AbstractTestFunction.java b/src/main/java/org/bench4q/agent/plugin/AbstractTestFunction.java new file mode 100644 index 00000000..391f8167 --- /dev/null +++ b/src/main/java/org/bench4q/agent/plugin/AbstractTestFunction.java @@ -0,0 +1,5 @@ +package org.bench4q.agent.plugin; + +public abstract class AbstractTestFunction extends AbstractFunction { + +} diff --git a/src/main/java/org/bench4q/agent/plugin/AbstractTimerFunction.java b/src/main/java/org/bench4q/agent/plugin/AbstractTimerFunction.java new file mode 100644 index 00000000..0a7b4a88 --- /dev/null +++ b/src/main/java/org/bench4q/agent/plugin/AbstractTimerFunction.java @@ -0,0 +1,5 @@ +package org.bench4q.agent.plugin; + +public abstract class AbstractTimerFunction extends AbstractFunction { + +} diff --git a/src/main/java/org/bench4q/agent/plugin/annotation/Function.java b/src/main/java/org/bench4q/agent/plugin/annotation/Function.java new file mode 100644 index 00000000..e5c38e17 --- /dev/null +++ b/src/main/java/org/bench4q/agent/plugin/annotation/Function.java @@ -0,0 +1,16 @@ +package org.bench4q.agent.plugin.annotation; + +public @interface Function { + + String name(); + + Class plugin(); + + int number(); + + FunctionType functionType(); + + Parameter[] parameters(); + + String help(); +} \ No newline at end of file diff --git a/src/main/java/org/bench4q/agent/plugin/annotation/FunctionType.java b/src/main/java/org/bench4q/agent/plugin/annotation/FunctionType.java new file mode 100644 index 00000000..0aaa9413 --- /dev/null +++ b/src/main/java/org/bench4q/agent/plugin/annotation/FunctionType.java @@ -0,0 +1,5 @@ +package org.bench4q.agent.plugin.annotation; + +public enum FunctionType { + Sample, Test, Timer, Control +} diff --git a/src/main/java/org/bench4q/agent/plugin/annotation/Parameter.java b/src/main/java/org/bench4q/agent/plugin/annotation/Parameter.java new file mode 100644 index 00000000..7dc3d69c --- /dev/null +++ b/src/main/java/org/bench4q/agent/plugin/annotation/Parameter.java @@ -0,0 +1,7 @@ +package org.bench4q.agent.plugin.annotation; + +public @interface Parameter { + String name(); + + String type(); +} diff --git a/src/main/java/org/bench4q/agent/plugin/annotation/Plugin.java b/src/main/java/org/bench4q/agent/plugin/annotation/Plugin.java new file mode 100644 index 00000000..a0cdb5e5 --- /dev/null +++ b/src/main/java/org/bench4q/agent/plugin/annotation/Plugin.java @@ -0,0 +1,11 @@ +package org.bench4q.agent.plugin.annotation; + +public @interface Plugin { + String id(); + + String name(); + + Parameter[] parameters(); + + String help(); +}