org.elkoserver.foundation.server
Interface ServiceFactory


public interface ServiceFactory

Interface to provide the application-specific portion of MessageHandlerFactory creation.

An Elko server application provides an implementation of this interface to the Server object when it asks it to start listeners based on information in the server configuration file. Whenever a listener is started, that ServiceFactory is called to provide an appropriate MessageHandlerFactory to provide MessageHandlers for each new connection accepted by that listener, based on the selection of services that are configured to be offered over connections made to that listener.


Method Summary
 MessageHandlerFactory provideFactory(String label, AuthDesc auth, Set<String> allow, List<String> serviceNames, String protocol)
          Provide a message handler factory for a new listener.
 

Method Detail

provideFactory

MessageHandlerFactory provideFactory(String label,
                                     AuthDesc auth,
                                     Set<String> allow,
                                     List<String> serviceNames,
                                     String protocol)
Provide a message handler factory for a new listener.

Parameters:
label - The label for the listener; typically this is the root property name for the properties defining the listener attributes.
auth - The authorization configuration for the listener.
allow - A set of permission keywords (derived from the properties configuring this listener) that specify what sorts of connections will be permitted through the listener.
serviceNames - A mutable list to which this method should append (and thus return) the names of the services offered to connections made to the new listener.
protocol - The protocol (TCP, HTTP, etc.) that connections made to the new listener are expected to speak
Returns:
a new MessageHandlerFactory that will provide message handlers for connections made to the new listener.