Difference between revisions of "VCLDequeueOperation"

From GreenVulcano Wiki
Jump to: navigation, search
(Created page with "Interface: '''it.greenvulcano.gvesb.virtual.DequeueOperation''' <syntaxhighlight lang="java5"> public interface DequeueOperation extends Operation { public static final Stri...")
 
Line 2: Line 2:
  
 
<syntaxhighlight lang="java5">
 
<syntaxhighlight lang="java5">
public interface DequeueOperation extends Operation
 
{
 
    public static final String TYPE  = "dequeue";
 
  
    /**
+
public static final String TYPE  = "dequeue";
    * Used in the <code>setTimeout()</code> in order to set an infinite
 
    * timeout.
 
    */
 
    public static final long  TO_INDEFINITELY = 0;
 
  
    /**
+
/**
    * Used in the <code>setTimeout()</code> in order to set a non-blocking
+
* Used in the setTimeout() in order to set an infinite
    * receive.
+
* timeout.
    */
+
*/
    public static final long  TO_NON_BLOCKING = -1;
+
public static final long  TO_INDEFINITELY = 0;
  
    /**
+
/**
    * Return <code>null</code> if no messages are available or timeout occurs.
+
* Used in the setTimeout() in order to set a non-blocking
    *
+
* receive.
    * @param gvBuffer
+
*/
    * @return a <code>GVBuffer</code> or <code>null</code> if no messages are
+
public static final long  TO_NON_BLOCKING = -1;
    *         available or timeout occurs.
 
    * @throws ConnectionException
 
    * @throws DequeueException
 
    * @throws InvalidDataException
 
    */
 
    public GVBuffer perform(GVBuffer gvBuffer) throws ConnectionException, DequeueException, InvalidDataException;
 
  
    /**
+
/**
    * This method acknowledge the message identified by the given Id.
+
* Returns null if no messages are available or timeout occurs.
    *
+
*
    * @param id
+
* @param gvBuffer
    * @throws ConnectionException
+
* @return a GVBuffer or null if no messages are
    * @throws AcknowledgeException
+
*        available or timeout occurs.
    */
+
* @throws ConnectionException
    public void acknowledge(Id id) throws ConnectionException, AcknowledgeException;
+
* @throws DequeueException
 +
* @throws InvalidDataException
 +
*/
 +
public GVBuffer perform(GVBuffer gvBuffer) throws ConnectionException, DequeueException, InvalidDataException;
  
    /**
+
/**
    * This method acknowledge all the messages.
+
* This method acknowledge the message identified by the given Id.
    *
+
*
    * @throws ConnectionException
+
* @param id
    * @throws AcknowledgeException
+
* @throws ConnectionException
    */
+
* @throws AcknowledgeException
    public void acknowledgeAll() throws ConnectionException, AcknowledgeException;
+
*/
 +
public void acknowledge(Id id) throws ConnectionException, AcknowledgeException;
  
    /**
+
/**
    * This method roll-back the dequeue of the message identified by the given
+
* This method acknowledge all the messages.
    * Id.
+
*
    *
+
* @throws ConnectionException
    * @param id
+
* @throws AcknowledgeException
    * @throws ConnectionException
+
*/
    * @throws AcknowledgeException
+
public void acknowledgeAll() throws ConnectionException, AcknowledgeException;
    */
 
    public void rollback(Id id) throws ConnectionException, AcknowledgeException;
 
  
    /**
+
/**
    * This method roll-back the dequeue of all the messages.
+
* This method roll-back the dequeue of the message identified by the given
    *
+
* Id.
    * @throws ConnectionException
+
*
    * @throws AcknowledgeException
+
* @param id
    */
+
* @throws ConnectionException
    public void rollbackAll() throws ConnectionException, AcknowledgeException;
+
* @throws AcknowledgeException
 +
*/
 +
public void rollback(Id id) throws ConnectionException, AcknowledgeException;
  
    /**
+
/**
    * This method set the filter for messages to receive. <br>
+
* This method roll-back the dequeue of all the messages.
    * This filter is valid only for the first perform() invocation.
+
*
    * The filter is reset also if perform() terminate with an exception. <br>
+
* @throws ConnectionException
    * Despite the GVVCL is a virtual interface, the syntax for the filter is
+
* @throws AcknowledgeException
    * like the syntax for JMS selectors. The concrete implementation must
+
*/
    * adapt to the underlying MOM.
+
public void rollbackAll() throws ConnectionException, AcknowledgeException;
    *
 
    * @param filter
 
    * @throws FilterException
 
    */
 
    public void setFilter(String filter) throws FilterException;
 
  
    /**
+
/**
    * This method set the timeout for the receive operation. <br>
+
* This method set the filter for messages to receive.
    * If 0 then the receive blocks indefinitely. If <nobr>&gt;
+
* This filter is valid only for the first perform() invocation.
    * 0</nobr> then this parameter specify, in milliseconds, the time that the
+
* The filter is reset also if perform() terminate with an exception.
    * receive must wait for a message. If <nobr>&lt; 0</nobr> then executes a
+
* Despite the GVVCL is a virtual interface, the syntax for the filter is
    * non-blocking receive. <br>
+
* like the syntax for JMS selectors. The concrete implementation must
    * This parameter is valid only for the first perform() invocation.
+
* adapt to the underlying MOM.
    * The timeout is reset also if perform() terminate with an exception.
+
*
    *
+
* @param filter
    * @param timeout
+
* @throws FilterException
    *        Specify the receive timeout. If <nobr>&gt; 0</nobr> specifies the
+
*/
    *        milliseconds for timeout. It is possible to use the
+
public void setFilter(String filter) throws FilterException;
    *        <code>TO_xxx</code> constants in order to specify a non-blocking
+
 
    *        receive operation or a indefinitely blocking receive.
+
/**
    *
+
* This method sets the timeout for the receive operation.  
    */
+
* If 0 then the receive blocks indefinitely. If > 0
    public void setTimeout(long timeout);
+
* then this parameter specify, in milliseconds, the time that the
}
+
* receive must wait for a message. If < 0 then executes a
 +
* non-blocking receive.  
 +
* This parameter is valid only for the first perform() invocation.
 +
* The timeout is reset also if perform() terminate with an exception.
 +
*
 +
* @param timeout
 +
*        Specify the receive timeout. If > 0 specifies the
 +
*        milliseconds for timeout. It is possible to use the
 +
*        TO_xxx constants in order to specify a non-blocking
 +
*        receive operation or a indefinitely blocking receive.
 +
*
 +
*/
 +
public void setTimeout(long timeout);
 
</syntaxhighlight>
 
</syntaxhighlight>

Revision as of 09:12, 21 December 2012

Interface: it.greenvulcano.gvesb.virtual.DequeueOperation

public static final String TYPE  = "dequeue";

/**
* Used in the setTimeout() in order to set an infinite
* timeout.
*/
public static final long   TO_INDEFINITELY = 0;

/**
* Used in the setTimeout() in order to set a non-blocking
* receive.
*/
public static final long   TO_NON_BLOCKING = -1;

/**
* Returns null if no messages are available or timeout occurs.
*
* @param gvBuffer
* @return a GVBuffer or null if no messages are
*         available or timeout occurs.
* @throws ConnectionException
* @throws DequeueException
* @throws InvalidDataException
*/
public GVBuffer perform(GVBuffer gvBuffer) throws ConnectionException, DequeueException, InvalidDataException;

/**
* This method acknowledge the message identified by the given Id.
*
* @param id
* @throws ConnectionException
* @throws AcknowledgeException
*/
public void acknowledge(Id id) throws ConnectionException, AcknowledgeException;

/**
* This method acknowledge all the messages.
*
* @throws ConnectionException
* @throws AcknowledgeException
*/
public void acknowledgeAll() throws ConnectionException, AcknowledgeException;

/**
* This method roll-back the dequeue of the message identified by the given
* Id.
*
* @param id
* @throws ConnectionException
* @throws AcknowledgeException
*/
public void rollback(Id id) throws ConnectionException, AcknowledgeException;

/**
* This method roll-back the dequeue of all the messages.
*
* @throws ConnectionException
* @throws AcknowledgeException
*/
public void rollbackAll() throws ConnectionException, AcknowledgeException;

/**
* This method set the filter for messages to receive. 
* This filter is valid only for the first perform() invocation.
* The filter is reset also if perform() terminate with an exception. 
* Despite the GVVCL is a virtual interface, the syntax for the filter is
* like the syntax for JMS selectors. The concrete implementation must
* adapt to the underlying MOM.
*
* @param filter
* @throws FilterException
*/
public void setFilter(String filter) throws FilterException;

/**
* This method sets the timeout for the receive operation. 
* If 0 then the receive blocks indefinitely. If > 0
* then this parameter specify, in milliseconds, the time that the
* receive must wait for a message. If < 0 then executes a
* non-blocking receive. 
* This parameter is valid only for the first perform() invocation.
* The timeout is reset also if perform() terminate with an exception.
*
* @param timeout
*        Specify the receive timeout. If > 0 specifies the
*        milliseconds for timeout. It is possible to use the
*        TO_xxx constants in order to specify a non-blocking
*        receive operation or a indefinitely blocking receive.
*
*/
public void setTimeout(long timeout);