org.eclipse.gmf.runtime.common.core.service
Class ExecutionStrategy
java.lang.Object
org.eclipse.gmf.runtime.common.core.util.EnumeratedType
org.eclipse.gmf.runtime.common.core.service.ExecutionStrategy
-
All Implemented Interfaces:
- java.io.Serializable
-
public abstract class ExecutionStrategy
- extends
EnumeratedType
An enumeration of provider execution strategies.
Each service provider has a ProviderPriority
that is declared
in its extension descriptor. It is the
ExecutionStrategy
that
determines how service provider priorities are used to select a provider to
service each client request. For example, if the
FIRST
is used, the provider with the highest priority will give an answer to the
request.
-
See Also:
-
org.eclipse.gmf.runtime.common.core.service
,
Serialized Form
Field Summary
|
static
ExecutionStrategy
|
FIRST
Executes an operation on the first provider of the highest priority
that provides the operation. |
static
ExecutionStrategy
|
FORWARD
Executes an operation on all providers that provide the operation, in
order from highest to lowest priority. |
static
ExecutionStrategy
|
LAST
Executes an operation on the last provider of the lowest priority
that provides the operation. |
static
ProviderPriority[]
|
PRIORITIES
The list of pre-defined provider priorities. |
static
ExecutionStrategy
|
REVERSE
Executes an operation on all providers that provide the operation, in
reverse order from lowest to highest priority. |
Constructor Summary
|
protected
|
ExecutionStrategy
(java.lang.String name)
Constructs a new execution strategy with the specified name. |
protected
|
ExecutionStrategy
(java.lang.String name,
int ordinal)
Constructs a new execution strategy with the specified name and ordinal. |
Methods inherited from class java.lang.Object
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
|
PRIORITIES
public static final
ProviderPriority[] PRIORITIES
- The list of pre-defined provider priorities.
FIRST
public static final
ExecutionStrategy FIRST
- Executes an operation on the first provider of the highest priority
that provides the operation.
LAST
public static final
ExecutionStrategy LAST
- Executes an operation on the last provider of the lowest priority
that provides the operation.
FORWARD
public static final
ExecutionStrategy FORWARD
- Executes an operation on all providers that provide the operation, in
order from highest to lowest priority.
REVERSE
public static final
ExecutionStrategy REVERSE
- Executes an operation on all providers that provide the operation, in
reverse order from lowest to highest priority.
ExecutionStrategy
protected ExecutionStrategy(java.lang.String name)
- Constructs a new execution strategy with the specified name.
-
Parameters:
-
name
- The name of the new execution strategy.
ExecutionStrategy
protected ExecutionStrategy(java.lang.String name,
int ordinal)
- Constructs a new execution strategy with the specified name and ordinal.
-
Parameters:
-
name
- The name of the new execution strategy. -
ordinal
- The ordinal for the new execution strategy.
getValues
protected java.util.List getValues()
- Retrieves the list of constants for this enumerated type.
-
-
Specified by:
-
getValues
in class
EnumeratedType
-
-
Returns:
- The list of constants for this enumerated type.
execute
public abstract java.util.List execute(
Service service,
IOperation operation)
- Executes the specified operation on providers obtained from the
specified service, according to this execution strategy.
-
-
Parameters:
-
service
- The service from which to obtain the providers. -
operation
- The operation to be executed.
-
Returns:
- The list of results.
getUncachedProviders
public java.util.List getUncachedProviders(
Service service,
ProviderPriority priority,
IOperation operation)
- Retrieves a list of providers of the specified priority that provide the
specified operation.
-
-
Parameters:
-
service
- The service used by the strategy -
priority
- The priority of providers to be retrieved. -
operation
- The operation that the provides must provide.
-
Returns:
- A list of uncached providers.
getProviders
protected final java.util.List getProviders(
Service service,
ProviderPriority priority)
- Retrieves a list of providers of the specified priority.
-
-
Parameters:
-
service
- The service used by the strategy -
priority
- The priority of providers to be retrieved.
-
Returns:
- A list of providers of the specified priority.
getProviders
protected final java.util.List getProviders(
Service service,
ExecutionStrategy strategy,
ProviderPriority priority,
IOperation operation)
- Retrieves a list of providers of the specified priority that provide the
specified operation. If this service is optimized, the result will be
cached the first time it is retrieved. If caching is pessimistic, the
providers from the cache will be checked first.
-
-
Parameters:
-
service
- The service used by the strategy -
strategy
- The strategy used by the service -
priority
- The priority of providers to be retrieved. -
operation
- The operation that the provides must provide.
-
Returns:
- A list of providers (from the cache, if appropriate).
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.