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

org.jgroups.blocks.mux.Muxer Maven / Gradle / Ivy

There is a newer version: 9.1.7.Final
Show newest version
package org.jgroups.blocks.mux;

/**
 * Allows registration/deregistrator of multiplexed handlers by mux id.
 * @author Paul Ferraro
 */
public interface Muxer {

    /**
     * Registers the specified handler to handle messages containing a mux header with the specified mux identifier.
     * @param id a mux id
     * @param handler a handler for the specified id
     */
    void add(short id, T handler);
    
    /**
     * Gets the handler registered under the specified id
     * @param id a mux id
     * @return the handler, or null if no handler is registered under
     *         id
     */
    T get(short id);
    
    /**
     * Unregisters the handler associated with the specifed mux identifier
     * @param id a mux id
     */
    void remove(short id);
    
    /**
     * Gets the handler for messages that have no mux header.
     * 
     * @return the default handler, or null if no default handler
     *         has been set
     */
    T getDefaultHandler();
    
    /**
     * Sets the handler for messages that have no mux header.
     * 
     * @param handler a handler for messages that have no mux header
     */
    void setDefaultHandler(T handler);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy