com.oracle.coherence.patterns.command
Interface CommandSubmitter

All Known Implementing Classes:
DefaultCommandSubmitter

public interface CommandSubmitter

A CommandSubmitter provides the mechanisms by which we submit Command execution within Contexts.

Copyright (c) 2008. All Rights Reserved. Oracle Corporation.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.

Author:
Brian Oliver

Method Summary
<C extends Context>
boolean
cancelCommand(Identifier commandIdentifier)
          Attempts to cancel the execution of the Command that was issued with the specified Ticket.
<C extends Context>
Identifier
submitCommand(Identifier contextIdentifier, Command<C> command)
          Asynchronously submits the provided Command for execution against the Context with the specified Identifier and returns a Ticket that may be used to cancel the execution of the Command.
<C extends Context>
Identifier
submitCommand(Identifier contextIdentifier, Command<C> command, boolean allowSubmissionWhenContextDoesNotExist)
          Asynchronously submits the provided Command for execution against the Context with the specified Identifier and returns a Ticket that may be used to cancel the execution of the Command.
 

Method Detail

submitCommand

<C extends Context> Identifier submitCommand(Identifier contextIdentifier,
                                             Command<C> command)
Asynchronously submits the provided Command for execution against the Context with the specified Identifier and returns a Ticket that may be used to cancel the execution of the Command.

Parameters:
contextIdentifier -
command -
Returns:
The Identifier that was issued to track the execution of the Command
Throws:
IllegalArgumentException - If no Context with the specified Identifier exists.

submitCommand

<C extends Context> Identifier submitCommand(Identifier contextIdentifier,
                                             Command<C> command,
                                             boolean allowSubmissionWhenContextDoesNotExist)
Asynchronously submits the provided Command for execution against the Context with the specified Identifier and returns a Ticket that may be used to cancel the execution of the Command.

If the specified Context does not exist, but the allowSubmissionWhenContextDoesNotExist parameter is true, the provided Command will be queued for execution when the Context is created.

Parameters:
contextIdentifier -
command -
allowSubmissionWhenContextDoesNotExist -
Returns:
The Identifier that was issued to track the execution of the Command
Throws:
IllegalArgumentException - If no Context with the specified Identifier exists and allowSubmissionWhenContextDoesNotExist is false

cancelCommand

<C extends Context> boolean cancelCommand(Identifier commandIdentifier)
Attempts to cancel the execution of the Command that was issued with the specified Ticket.

NOTE: If the Command has already been executed or has commenced execution, it may not be canceled. Only Commands that have not been executed may be canceled. All other requests are ignored.

Type Parameters:
C -
Parameters:
commandIdentifier -


Copyright © 2016. All rights reserved.