
org.objectweb.dream.protocol.channel.ChannelFactory Maven / Gradle / Ivy
/**
* Dream
* Copyright (C) 2003-2004 INRIA Rhone-Alpes
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Contact: [email protected]
*
* Initial developer(s): Matthieu Leclercq
* Contributor(s):
*/
package org.objectweb.dream.protocol.channel;
import org.objectweb.dream.protocol.BindException;
import org.objectweb.dream.protocol.IncomingPush;
import org.objectweb.dream.protocol.OutgoingPush;
/**
* A communication channel factory interface, that a {@link ChannelProtocol} can
* export. Each time a client binds to this exported interface, the {@link
* #instantiate} method is called to establish a new communication channel to
* this new client.
*/
public interface ChannelFactory {
static final String BIND_REPLY_CHUNK_NAME = "channel-factory-bind-reply";
/** The commonly used name of this interface. */
String CHANEL_ITF_NAME = "channel";
/**
* The commonly used name of this interface when it is used as a client
* collection interface of a protocol bound to the exported channel.
*/
String EXPORTED_CHANNEL_ITF_NAME = "exported-channel";
/**
* Notify the protocol who exports this interface, that a client is opening
* a new communication channel. The toClientPush
interface can
* be used to send messages to the client. This method returns the interface
* on which messages sent by the client will be passed.
*
* @param toClientPush
* the interface that can be used to send messages to the client
* through the newly created communication channel.
* @return the interface on which messages sent by the client will be
* passed.
* @throws BindException
* if the bind process fails.
*/
IncomingPush instantiate(OutgoingPush toClientPush) throws BindException;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy