All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.fabric3.spi.container.channel.Channel Maven / Gradle / Ivy

There is a newer version: 3.0.0
Show newest version
/*
 * Fabric3
 * Copyright (c) 2009-2015 Metaform Systems
 *
 * 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.fabric3.spi.container.channel;

import javax.xml.namespace.QName;
import java.net.URI;

import org.fabric3.spi.model.physical.ChannelSide;

/**
 * An event channel. Responsible for transmitting events from producers to consumers.
 * 

* A logical channel is divided into two physical channels on a runtime: one for receiving events from producers and transmitting them to a binding; and one for * receiving events from a binding and transmitting them to consumers. If the channel is not bound, it is collocated and only one physical channel will exist. */ public interface Channel { /** * Returns the channel URI. * * @return the channel URI */ URI getUri(); /** * Returns the composite this channel was deployed with. * * @return the deployable composite */ QName getDeployable(); /** * Initializes the channel to receive events. */ void start(); /** * Stops the channel and prepares it for un-deployment */ void stop(); /** * Adds a handler for transmitting events to the channel. * * @param handler the handler */ void addHandler(EventStreamHandler handler); /** * Removes a handler. * * @param handler the handler */ void removeHandler(EventStreamHandler handler); /** * Attach a single handler to the channel so that it can flow events. * * @param handler the handler to attach */ public void attach(EventStreamHandler handler); /** * Attach a connection to the channel so that it can flow events. * * @param connection the connection to attach */ void attach(ChannelConnection connection); /** * Subscribe to receive events from the channel. * * @param uri the URI identifying the subscription * @param connection the connection to receive events on */ void subscribe(URI uri, ChannelConnection connection); /** * Unsubscribe from receiving events from the channel * * @param uri the subscription URI * @return the unsubscribed connection */ ChannelConnection unsubscribe(URI uri); /** * Returns if the Channel receives producer events or sends events to consumers. * * @return if the Channel receives producer events or sends events to consumers */ ChannelSide getChannelSide(); }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy