You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Floaz <gi...@git.apache.org> on 2013/02/23 21:38:02 UTC

wicket pull request: Added another subscription method to wicket-atmosphere...

GitHub user Floaz opened a pull request:

    https://github.com/apache/wicket/pull/32

    Added another subscription method to wicket-atmosphere.

    Wicket-atmosphere provides only the method-subscription method. The nice concept of the subscription methods have one penalty: It is not possible to add a filter with context variables before the request context is loaded. E.g. self-made channels or other checks with variables of components.
    
    I hope there is no error in concept. 
    
    Example:
    
    	@Override
    	protected void onInitialize() {
    		super.onInitialize();
    		
    		final Number id = getWatchId();
    		
    		AtmosphereEventSubscriber s = new AtmosphereEventSubscriber(this);
    		s.subscribe(CommentEvent.class, new AtmosphereEventSubscription<CommentEvent>() {
    			@Override
    			public void call(AjaxRequestTarget target, CommentEvent event) {
    				logger.debug("Comment with id=" + event.getId());
    			}
    		}, new Predicate<CommentEvent>() {
    			@Override
    			public boolean apply(CommentEvent event) {
    				return id.equals(event.getId());
    			}
    		});
    	}


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/Floaz/wicket-atmosphere-channel master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/wicket/pull/32.patch

----
commit f2db8551168a170b7132817b88a5292a7dc44e1f
Author: Philipp René Thomas <th...@uzuzente.de>
Date:   2013-02-23T19:43:58Z

    Added another subscription method.

commit f8e743ce6815ed44a56e458d3a143f80073393f5
Author: Philipp René Thomas <th...@uzuzente.de>
Date:   2013-02-23T20:17:27Z

    Merged the new version of wicket atmosphere.

----