marmotta-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sschaff...@apache.org
Subject [14/22] git commit: some documentation updates
Date Thu, 03 Oct 2013 15:07:13 GMT
some documentation updates


Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/96e68a9f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/96e68a9f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/96e68a9f

Branch: refs/heads/develop
Commit: 96e68a9f88c0e92303ef13af2fa6dd29cdb8d9b7
Parents: 278a80a
Author: Sebastian Schaffert <sschaffert@apache.org>
Authored: Wed Oct 2 22:33:41 2013 +0200
Committer: Sebastian Schaffert <sschaffert@apache.org>
Committed: Wed Oct 2 22:33:41 2013 +0200

----------------------------------------------------------------------
 .../apache/marmotta/platform/core/util/CDIContext.java   | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/96e68a9f/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/util/CDIContext.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/util/CDIContext.java
b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/util/CDIContext.java
index 2a81693..a5be73d 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/util/CDIContext.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/util/CDIContext.java
@@ -123,12 +123,19 @@ public class CDIContext {
         return !beanManager.resolveObserverMethods(event,qualifier).isEmpty();
     }
 
-    public static <T> boolean hasObservers(Object o, String fieldName) {
+    /**
+     * Convenience method for checking if there are observers for an event trigger field
of a service. Pass the service
+     * as first parameter and the name of the field of type Event<T> as second argument.
+     * @param o
+     * @param fieldName
+     * @return
+     */
+    public static boolean hasObservers(Object o, String fieldName) {
         Class type = o.getClass();
         try {
             Field field = type.getDeclaredField(fieldName);
             if(!field.getType().getClass().getSimpleName().equals("Event")) {
-                Class persistentClass = (Class<T>) ((ParameterizedType) field.getGenericType()).getActualTypeArguments()[0];
+                Class persistentClass = (Class) ((ParameterizedType) field.getGenericType()).getActualTypeArguments()[0];
                 Annotation qualifier = null;
                 for(Annotation a : field.getDeclaredAnnotations()) {
                     if(a.annotationType().isAnnotationPresent(Qualifier.class)) {


Mime
View raw message