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

org.objectweb.dream.queue.keyed.KeyedPull 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): Vivien Quema, Romain Lenglet
 */

package org.objectweb.dream.queue.keyed;

import org.objectweb.dream.PullException;
import org.objectweb.dream.message.Message;

/**
 * Interface that allows pulling messages mapping a specified key.
 */
public interface KeyedPull
{
  /**
   * The commonly used name to refer to this interface when it is used as an
   * output.
   */
  String OUT_KEYED_PULL_ITF_NAME = "out-keyed-pull";

  /**
   * The commonly used name to refer to this interface when it is used as an
   * input.
   */
  String IN_KEYED_PULL_ITF_NAME  = "in-keyed-pull";

  /**
   * Asks for a message matching the given key. If no message is available, the
   * semantic of this method is left to the component implementing the
   * interface. As an example, it can return null or block until
   * a message is available.
   * 
   * @param key the key that is associated with the message to pull.
   * @return the pulled message, or null.
   * @throws PullException if an exception occurs.
   */
  Message pull(Object key) throws PullException;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy