com.canoo.dolphin.server.event.DolphinEventBus Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dolphin-platform-server Show documentation
Show all versions of dolphin-platform-server Show documentation
The Dolphin Platform is a framework that implements the presentation model pattern and provides amodern way to create enterprise applications. The Platform provides several client implementations that all canbe used in combination with a general sever API.
/*
* Copyright 2015 Canoo Engineering AG.
*
* 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 com.canoo.dolphin.server.event;
import com.canoo.dolphin.event.Subscription;
/**
* The dolphin event bus that can be used to send messages to dolphin sessions.
* The {@link com.canoo.dolphin.server.event.DolphinEventBus} can be injected in any
* managed bean and will automatically publish the given data in the dolphin session.
* THis means that you ca subscribe your dolphin controller (see {@link com.canoo.dolphin.server.DolphinController})
* to the event bus and publish messages from any other bean like an REST endpoint.
*
*
*
*/
public interface DolphinEventBus {
/**
* Publish a message to the given address
*
* @param data the data of the message
*/
void publish(String address, Object data);
/**
* Register as a handler / listener for a given address. All messages that will be published for the given address
* by any dolphin session will trigger the given handler in the correct dolphin session.
*
* @param topic the topic
* @param handler the handler
*/
Subscription subscribe(String topic, MessageListener handler);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy