001 /*
002 * Copyright 2009-2013 the original author or authors.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017 package org.codehaus.griffon.runtime.core;
018
019 import griffon.core.EventRouter;
020 import griffon.util.RunnableWithArgs;
021 import groovy.lang.Closure;
022
023 import java.util.List;
024 import java.util.Map;
025
026 /**
027 * Implementation of {@code EventRouter} where all operations are ignored.
028 *
029 * @author Andres Almiray
030 * @since 1.2.0
031 */
032 public class NoopEventRouter implements EventRouter {
033
034 @Override
035 public boolean isEnabled() {
036 return false;
037 }
038
039 @Override
040 public void setEnabled(boolean enabled) {
041
042 }
043
044 @Override
045 public void publish(String eventName) {
046
047 }
048
049 @Override
050 public void publish(String eventName, List params) {
051 }
052
053 @Override
054 public void publishOutsideUI(String eventName) {
055 }
056
057 @Override
058 public void publishOutsideUI(String eventName, List params) {
059 }
060
061 @Override
062 public void publishAsync(String eventName) {
063 }
064
065 @Override
066 public void publishAsync(String eventName, List params) {
067 }
068
069 @Override
070 public void addEventListener(Object listener) {
071 }
072
073 @Override
074 public void addEventListener(Map<String, Object> listener) {
075 }
076
077 @Override
078 public void removeEventListener(Object listener) {
079 }
080
081 @Override
082 public void removeEventListener(Map<String, Object> listener) {
083 }
084
085 @Override
086 public void addEventListener(String eventName, Closure listener) {
087 }
088
089 @Override
090 public void addEventListener(String eventName, RunnableWithArgs listener) {
091 }
092
093 @Override
094 public void removeEventListener(String eventName, Closure listener) {
095 }
096
097 @Override
098 public void removeEventListener(String eventName, RunnableWithArgs listener) {
099 }
100 }
|