diff --git a/spring-websocket/src/main/java/org/springframework/web/messaging/event/EventBus.java b/spring-websocket/src/main/java/org/springframework/web/messaging/event/EventBus.java deleted file mode 100644 index 97f6926188..0000000000 --- a/spring-websocket/src/main/java/org/springframework/web/messaging/event/EventBus.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2002-2013 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.web.messaging.event; - - -/** - * - */ -public interface EventBus { - - - void send(String key, Object data); - - EventRegistration registerConsumer(String key, EventConsumer consumer); - -} diff --git a/spring-websocket/src/main/java/org/springframework/web/messaging/event/EventConsumer.java b/spring-websocket/src/main/java/org/springframework/web/messaging/event/EventConsumer.java deleted file mode 100644 index d834db0694..0000000000 --- a/spring-websocket/src/main/java/org/springframework/web/messaging/event/EventConsumer.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2002-2013 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.web.messaging.event; - - - -/** - * - */ -public interface EventConsumer { - - - void accept(T data); - -} diff --git a/spring-websocket/src/main/java/org/springframework/web/messaging/event/EventRegistration.java b/spring-websocket/src/main/java/org/springframework/web/messaging/event/EventRegistration.java deleted file mode 100644 index e4d7056199..0000000000 --- a/spring-websocket/src/main/java/org/springframework/web/messaging/event/EventRegistration.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2002-2013 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.web.messaging.event; - - -/** - * - */ -public interface EventRegistration { - - String getRegistrationKey(); - - void cancel(); - -} diff --git a/spring-websocket/src/main/java/org/springframework/web/messaging/event/ReactorEventBus.java b/spring-websocket/src/main/java/org/springframework/web/messaging/event/ReactorEventBus.java deleted file mode 100644 index a6e9ce600f..0000000000 --- a/spring-websocket/src/main/java/org/springframework/web/messaging/event/ReactorEventBus.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright 2002-2013 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.web.messaging.event; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import reactor.core.Reactor; -import reactor.fn.Consumer; -import reactor.fn.Event; -import reactor.fn.registry.Registration; -import reactor.fn.selector.ObjectSelector; - - -/** - * - */ -public class ReactorEventBus implements EventBus { - - private static Log logger = LogFactory.getLog(ReactorEventBus.class); - - private final Reactor reactor; - - - public ReactorEventBus(Reactor reactor) { - this.reactor = reactor; - } - - @Override - public void send(String key, Object data) { - if (logger.isTraceEnabled()) { - logger.trace("Sending notification key=" + key + ", data=" + data); - } - this.reactor.notify(key, Event.wrap(data)); - } - - @Override - public EventRegistration registerConsumer(final String key, final EventConsumer consumer) { - - ObjectSelector selector = new ObjectSelector(key); - - final Registration>> registration = this.reactor.on(selector, - new Consumer>() { - @Override - public void accept(Event event) { - consumer.accept(event.getData()); - } - }); - - return new EventRegistration() { - @Override - public String getRegistrationKey() { - return key; - } - @Override - public void cancel() { - registration.cancel(); - } - }; - } - -}