001/* 002 * GWTEventService 003 * Copyright (c) 2011 and beyond, strawbill UG (haftungsbeschr?nkt) 004 * 005 * This is free software; you can redistribute it and/or modify it 006 * under the terms of the GNU Lesser General Public License as 007 * published by the Free Software Foundation; either version 3 of 008 * the License, or (at your option) any later version. 009 * Other licensing for GWTEventService may also be possible on request. 010 * Please view the license.txt of the project for more information. 011 * 012 * This software is distributed in the hope that it will be useful, 013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 015 * Lesser General Public License for more details. 016 * 017 * You should have received a copy of the GNU Lesser General Public 018 * License along with this software; if not, write to the Free 019 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 020 * 02110-1301 USA, or see the FSF site: http://www.fsf.org. 021 */ 022package de.novanic.eventservice.client.event.listener.unlisten; 023 024import de.novanic.eventservice.client.event.Event; 025 026/** 027 * The UnlistenEventListener can be implemented to listen for {@link de.novanic.eventservice.client.event.listener.unlisten.UnlistenEvent} 028 * instances. An {@link de.novanic.eventservice.client.event.listener.unlisten.UnlistenEvent} is for example triggered on a timeout 029 * or when a user/client leaves a domain. The {@link de.novanic.eventservice.client.event.listener.unlisten.UnlistenEventListenerAdapter} 030 * provides the apply method ({@link de.novanic.eventservice.client.event.listener.RemoteEventListener#apply(de.novanic.eventservice.client.event.Event)}) 031 * and a default implementation of {@link de.novanic.eventservice.client.event.listener.unlisten.UnlistenEventListener}. 032 * 033 * @author sstrohschein 034 * <br>Date: 08.06.2009 035 * <br>Time: 22:35:00 036 */ 037public class UnlistenEventListenerAdapter implements UnlistenEventListener 038{ 039 /** 040 * The apply method checks if the occurred event is an {@link de.novanic.eventservice.client.event.listener.unlisten.UnlistenEvent} 041 * and dispatches the event to {@link de.novanic.eventservice.client.event.listener.unlisten.UnlistenEventListener#onUnlisten(UnlistenEvent)}. 042 * @param anEvent event to process 043 */ 044 public void apply(Event anEvent) { 045 if(anEvent instanceof UnlistenEvent) { 046 UnlistenEvent theUnlistenEvent = (UnlistenEvent)anEvent; 047 onUnlisten(theUnlistenEvent); 048 } 049 } 050 051 /** 052 * The method onUnlisten is called when an {@link de.novanic.eventservice.client.event.listener.unlisten.UnlistenEvent} occurs. 053 * @param anUnlistenEvent triggered {@link de.novanic.eventservice.client.event.listener.unlisten.UnlistenEvent} 054 */ 055 public void onUnlisten(UnlistenEvent anUnlistenEvent) {} 056}