You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltaspike.apache.org by gp...@apache.org on 2013/04/01 00:05:03 UTC
[5/8] git commit: DELTASPIKE-337 unified package
org.apache.deltaspike.core.api.jmx
DELTASPIKE-337 unified package org.apache.deltaspike.core.api.jmx
Project: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/commit/a2bebb4f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/tree/a2bebb4f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/diff/a2bebb4f
Branch: refs/heads/master
Commit: a2bebb4f856056a21d8b1495ae3cc484039633f8
Parents: fa8ff54
Author: gpetracek <gp...@apache.org>
Authored: Sun Mar 31 23:47:12 2013 +0200
Committer: gpetracek <gp...@apache.org>
Committed: Sun Mar 31 23:47:12 2013 +0200
----------------------------------------------------------------------
.../apache/deltaspike/core/api/jmx/JmxManaged.java | 46 +++++++++++
.../org/apache/deltaspike/core/api/jmx/MBean.java | 61 +++++++++++++++
.../deltaspike/core/api/jmx/NotificationInfo.java | 45 +++++++++++
.../core/api/jmx/annotation/JmxManaged.java | 46 -----------
.../deltaspike/core/api/jmx/annotation/MBean.java | 61 ---------------
.../core/api/jmx/annotation/NotificationInfo.java | 45 -----------
.../core/impl/jmx/BroadcasterProducer.java | 2 +-
.../core/impl/jmx/DynamicMBeanWrapper.java | 6 +-
.../deltaspike/core/impl/jmx/MBeanExtension.java | 2 +-
.../deltaspike/test/core/impl/jmx/MyMBean.java | 4 +-
10 files changed, 159 insertions(+), 159 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/a2bebb4f/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/jmx/JmxManaged.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/jmx/JmxManaged.java b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/jmx/JmxManaged.java
new file mode 100644
index 0000000..82a79aa
--- /dev/null
+++ b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/jmx/JmxManaged.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.deltaspike.core.api.jmx;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * This annotation can be used either on a field or a method.
+ *
+ * Used on a method it describes a JMX operation with an optional description.
+ *
+ * Used on a field it describes a JMX attribute. This attribute is readable
+ * if a getter on this field is available and writable is a setter is found.
+ */
+@Retention(RUNTIME)
+@Target({ FIELD, METHOD })
+@Documented
+public @interface JmxManaged
+{
+ /**
+ * @return the description either of the operation or the attribute exported through JMX.
+ */
+ String description() default "";
+}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/a2bebb4f/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/jmx/MBean.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/jmx/MBean.java b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/jmx/MBean.java
new file mode 100644
index 0000000..f96de28
--- /dev/null
+++ b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/jmx/MBean.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.deltaspike.core.api.jmx;
+
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * This annotation marks a CDI managed bean as exported through JMX.
+ */
+@Retention(RUNTIME)
+@Target(TYPE)
+@Inherited
+public @interface MBean
+{
+ /**
+ * @return the category to use if no objectName was specified. Default is "org.apache.deltaspike"
+ * and can be overriden either directly by the value or by a key used to resolve a value using
+ * {@see org.apache.deltaspike.core.api.config.ConfigResolver}. It is a key if the value is
+ * between bracket. Default key is "org.apache.deltaspike.mbean.category".
+ */
+ String category() default "{org.apache.deltaspike.mbean.category}";
+
+ /**
+ * @return the name of the bean used if no objectName was specified.
+ * It is used with category value to create the MBean {@see javax.management.ObjectName}
+ * using the following pattern: <category>:type=MBeans,name=<name>
+ */
+ String name() default "";
+
+ /**
+ * @return the direct object name used to export the decorated bean.
+ */
+ String objectName() default "";
+
+ /**
+ * @return the description used to describe the JMX bean.
+ */
+ String description() default "";
+}
+
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/a2bebb4f/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/jmx/NotificationInfo.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/jmx/NotificationInfo.java b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/jmx/NotificationInfo.java
new file mode 100644
index 0000000..9f7232c
--- /dev/null
+++ b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/jmx/NotificationInfo.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.deltaspike.core.api.jmx;
+
+import javax.management.Notification;
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Documented
+@Target(TYPE)
+@Retention(RUNTIME)
+public @interface NotificationInfo
+{
+ String[] types() default { };
+ String description() default "";
+ Class<? extends Notification> notificationClass() default Notification.class;
+ String[] descriptorFields() default { };
+
+ @Target(TYPE)
+ @Retention(RUNTIME)
+ static @interface List
+ {
+ NotificationInfo[] value();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/a2bebb4f/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/jmx/annotation/JmxManaged.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/jmx/annotation/JmxManaged.java b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/jmx/annotation/JmxManaged.java
deleted file mode 100644
index 86749e7..0000000
--- a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/jmx/annotation/JmxManaged.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.deltaspike.core.api.jmx.annotation;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-/**
- * This annotation can be used either on a field or a method.
- *
- * Used on a method it describes a JMX operation with an optional description.
- *
- * Used on a field it describes a JMX attribute. This attribute is readable
- * if a getter on this field is available and writable is a setter is found.
- */
-@Retention(RUNTIME)
-@Target({ FIELD, METHOD })
-@Documented
-public @interface JmxManaged
-{
- /**
- * @return the description either of the operation or the attribute exported through JMX.
- */
- String description() default "";
-}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/a2bebb4f/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/jmx/annotation/MBean.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/jmx/annotation/MBean.java b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/jmx/annotation/MBean.java
deleted file mode 100644
index dea1034..0000000
--- a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/jmx/annotation/MBean.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.deltaspike.core.api.jmx.annotation;
-
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-/**
- * This annotation marks a CDI managed bean as exported through JMX.
- */
-@Retention(RUNTIME)
-@Target(TYPE)
-@Inherited
-public @interface MBean
-{
- /**
- * @return the category to use if no objectName was specified. Default is "org.apache.deltaspike"
- * and can be overriden either directly by the value or by a key used to resolve a value using
- * {@see org.apache.deltaspike.core.api.config.ConfigResolver}. It is a key if the value is
- * between bracket. Default key is "org.apache.deltaspike.mbean.category".
- */
- String category() default "{org.apache.deltaspike.mbean.category}";
-
- /**
- * @return the name of the bean used if no objectName was specified.
- * It is used with category value to create the MBean {@see javax.management.ObjectName}
- * using the following pattern: <category>:type=MBeans,name=<name>
- */
- String name() default "";
-
- /**
- * @return the direct object name used to export the decorated bean.
- */
- String objectName() default "";
-
- /**
- * @return the description used to describe the JMX bean.
- */
- String description() default "";
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/a2bebb4f/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/jmx/annotation/NotificationInfo.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/jmx/annotation/NotificationInfo.java b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/jmx/annotation/NotificationInfo.java
deleted file mode 100644
index f85f563..0000000
--- a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/jmx/annotation/NotificationInfo.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.deltaspike.core.api.jmx.annotation;
-
-import javax.management.Notification;
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-@Documented
-@Target(TYPE)
-@Retention(RUNTIME)
-public @interface NotificationInfo
-{
- String[] types() default { };
- String description() default "";
- Class<? extends Notification> notificationClass() default Notification.class;
- String[] descriptorFields() default { };
-
- @Target(TYPE)
- @Retention(RUNTIME)
- static @interface List
- {
- NotificationInfo[] value();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/a2bebb4f/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/jmx/BroadcasterProducer.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/jmx/BroadcasterProducer.java b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/jmx/BroadcasterProducer.java
index 4e51f23..69c3556 100644
--- a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/jmx/BroadcasterProducer.java
+++ b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/jmx/BroadcasterProducer.java
@@ -19,7 +19,7 @@
package org.apache.deltaspike.core.impl.jmx;
import org.apache.deltaspike.core.api.jmx.JmxBroadcaster;
-import org.apache.deltaspike.core.api.jmx.annotation.MBean;
+import org.apache.deltaspike.core.api.jmx.MBean;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.context.Dependent;
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/a2bebb4f/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/jmx/DynamicMBeanWrapper.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/jmx/DynamicMBeanWrapper.java b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/jmx/DynamicMBeanWrapper.java
index 3d1ec8e..e0defaa 100644
--- a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/jmx/DynamicMBeanWrapper.java
+++ b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/jmx/DynamicMBeanWrapper.java
@@ -20,9 +20,9 @@ package org.apache.deltaspike.core.impl.jmx;
import org.apache.deltaspike.core.api.config.ConfigResolver;
import org.apache.deltaspike.core.api.jmx.JmxBroadcaster;
-import org.apache.deltaspike.core.api.jmx.annotation.JmxManaged;
-import org.apache.deltaspike.core.api.jmx.annotation.MBean;
-import org.apache.deltaspike.core.api.jmx.annotation.NotificationInfo;
+import org.apache.deltaspike.core.api.jmx.JmxManaged;
+import org.apache.deltaspike.core.api.jmx.MBean;
+import org.apache.deltaspike.core.api.jmx.NotificationInfo;
import org.apache.deltaspike.core.api.provider.BeanManagerProvider;
import org.apache.deltaspike.core.api.provider.BeanProvider;
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/a2bebb4f/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/jmx/MBeanExtension.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/jmx/MBeanExtension.java b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/jmx/MBeanExtension.java
index 0f35449..48a1a5e 100644
--- a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/jmx/MBeanExtension.java
+++ b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/jmx/MBeanExtension.java
@@ -20,7 +20,7 @@ package org.apache.deltaspike.core.impl.jmx;
import org.apache.deltaspike.core.api.config.ConfigResolver;
import org.apache.deltaspike.core.api.jmx.JmxBroadcaster;
-import org.apache.deltaspike.core.api.jmx.annotation.MBean;
+import org.apache.deltaspike.core.api.jmx.MBean;
import org.apache.deltaspike.core.spi.activation.Deactivatable;
import org.apache.deltaspike.core.util.BeanUtils;
import org.apache.deltaspike.core.util.ClassDeactivationUtils;
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/a2bebb4f/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/jmx/MyMBean.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/jmx/MyMBean.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/jmx/MyMBean.java
index 6c1f338..8a9e9eb 100644
--- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/jmx/MyMBean.java
+++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/jmx/MyMBean.java
@@ -19,8 +19,8 @@
package org.apache.deltaspike.test.core.impl.jmx;
import org.apache.deltaspike.core.api.jmx.JmxBroadcaster;
-import org.apache.deltaspike.core.api.jmx.annotation.JmxManaged;
-import org.apache.deltaspike.core.api.jmx.annotation.MBean;
+import org.apache.deltaspike.core.api.jmx.JmxManaged;
+import org.apache.deltaspike.core.api.jmx.MBean;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;