document EventSubscriptionInvoker and return void from #invoke()
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/c9945144 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/c9945144 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/c9945144 Branch: refs/heads/wicket-6.x Commit: c9945144003a3dfc3458f8f9daa42b99c4b38b8d Parents: 4096615 Author: Dan Retzlaff <dretzl...@gmail.com> Authored: Wed Jun 12 06:28:15 2013 -0700 Committer: Emond Papegaaij <emond.papega...@topicus.nl> Committed: Wed Jun 12 19:16:49 2013 +0200 ---------------------------------------------------------------------- .../wicket/atmosphere/EventSubscriptionInvoker.java | 12 ++++++++---- .../SubscribeAnnotationEventSubscriptionInvoker.java | 4 +--- 2 files changed, 9 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/wicket/blob/c9945144/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/EventSubscriptionInvoker.java ---------------------------------------------------------------------- diff --git a/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/EventSubscriptionInvoker.java b/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/EventSubscriptionInvoker.java index 3bc3722..ed70b62 100644 --- a/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/EventSubscriptionInvoker.java +++ b/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/EventSubscriptionInvoker.java @@ -16,28 +16,32 @@ */ package org.apache.wicket.atmosphere; +import org.apache.wicket.Component; import org.apache.wicket.ajax.AjaxRequestTarget; +import org.apache.wicket.behavior.Behavior; /** - * Invokes {@link EventSubscription} + * Delivers events to a subscribed {@link Component} or {@link Behavior}. Implementations convey + * {@link AtmosphereEvent#getPayload()} into an invocation of the subscription method + * {@link EventSubscription#getMethodName()}. */ public interface EventSubscriptionInvoker { /** * * @param target - * {@link AjaxRequestTarget} to which {@link EventSubscription} result should be set + * {@link AjaxRequestTarget} to which {@link EventSubscription} result should be sent * @param subscription * {@link EventSubscription} * @param base * {@link EventSubscription} object on which {@link EventSubscription} should be * invoked * @param event + * {@link AtmosphereEvent} which matches the {@link EventSubscription}'s predicates * @param ajaxRequestInitializer * call {@code ajaxRequestInitializer.initialize()} before you are going to invoke * {@link EventSubscription} - * @return true if invocation was successful */ - boolean invoke(AjaxRequestTarget target, EventSubscription subscription, Object base, + void invoke(AjaxRequestTarget target, EventSubscription subscription, Object base, AtmosphereEvent event, AjaxRequestInitializer ajaxRequestInitializer); } http://git-wip-us.apache.org/repos/asf/wicket/blob/c9945144/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/SubscribeAnnotationEventSubscriptionInvoker.java ---------------------------------------------------------------------- diff --git a/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/SubscribeAnnotationEventSubscriptionInvoker.java b/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/SubscribeAnnotationEventSubscriptionInvoker.java index 0856cb0..81d0a14 100644 --- a/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/SubscribeAnnotationEventSubscriptionInvoker.java +++ b/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/SubscribeAnnotationEventSubscriptionInvoker.java @@ -28,7 +28,7 @@ import org.apache.wicket.ajax.AjaxRequestTarget; public class SubscribeAnnotationEventSubscriptionInvoker implements EventSubscriptionInvoker { @Override - public boolean invoke(AjaxRequestTarget target, EventSubscription subscription, Object base, + public void invoke(AjaxRequestTarget target, EventSubscription subscription, Object base, AtmosphereEvent event, AjaxRequestInitializer ajaxRequestInitializer) { for (Method curMethod : base.getClass().getMethods()) @@ -41,7 +41,6 @@ public class SubscribeAnnotationEventSubscriptionInvoker implements EventSubscri { curMethod.setAccessible(true); curMethod.invoke(base, target, event.getPayload()); - return true; } catch (IllegalAccessException e) { @@ -57,7 +56,6 @@ public class SubscribeAnnotationEventSubscriptionInvoker implements EventSubscri } } } - return false; } }