com.oracle.coherence.patterns.command
Class DefaultCommandSubmitter

java.lang.Object
  extended by com.oracle.coherence.patterns.command.DefaultCommandSubmitter
All Implemented Interfaces:
CommandSubmitter

public class DefaultCommandSubmitter
extends Object
implements CommandSubmitter

The default implementation of a CommandSubmitter.

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

Author:
Brian Oliver
See Also:
CommandSubmitter

Constructor Summary
DefaultCommandSubmitter()
          Standard Constructor
 
Method Summary
<C extends Context>
boolean
cancelCommand(Identifier commandIdentifier)
          Attempts to cancel the execution of the Command that was issued with the specified Ticket.
static CommandSubmitter getInstance()
          Returns an instance of the DefaultCommandSubmitter.
<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 acceptCommandIfContextDoesNotExist)
          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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCommandSubmitter

public DefaultCommandSubmitter()
Standard Constructor

Method Detail

submitCommand

public <C extends Context> Identifier submitCommand(Identifier contextIdentifier,
                                                    Command<C> command,
                                                    boolean acceptCommandIfContextDoesNotExist)
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.

Specified by:
submitCommand in interface CommandSubmitter
Returns:
The Identifier that was issued to track the execution of the Command

submitCommand

public <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.

Specified by:
submitCommand in interface CommandSubmitter
Returns:
The Identifier that was issued to track the execution of the Command

cancelCommand

public <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.

Specified by:
cancelCommand in interface CommandSubmitter

getInstance

public static CommandSubmitter getInstance()
Returns an instance of the DefaultCommandSubmitter.



Copyright © 2016. All rights reserved.