nextgrid.api.env
Interface ProcessEnvironment

All Superinterfaces:
java.io.Serializable

public interface ProcessEnvironment
extends java.io.Serializable

Provides environment context and services to the processes involved in a workflow enaction.

It also provides control and monitoring operations for the enaction user.

Author:
Rodrigo Ruiz

Method Summary
 void addListenersFor(java.net.URI id, POMListener... listeners)
          Adds one or more listeners to a given process.
 void clearListeners()
          Clears all listeners registered in this environment instance.
 void clearListenersFor(java.net.URI id)
          Clears all listeners registered for a given Process in this environment instance.
 java.io.Serializable getAttribute(java.lang.String name)
          Gets an environment attribute value.
 java.util.Map<java.lang.String,java.io.Serializable> getAttributes()
          Gets a map containing all attributes.
 ProcessDiscoverer getDiscovererFor(java.net.URI id)
          Gets a discoverer for the specified process id.
 java.util.List<ProcessDiscoverer> getDiscoverers()
          Gets the discoverer instances registered in this environment.
 java.util.Collection<POMListener> getListenersFor(java.net.URI id)
          Gets a collection of listeners to be attached to the given Process id.
 Prioritiser getPrioritiserFor(java.net.URI id)
          Gets a prioritiser for the specified process id.
 java.util.List<Prioritiser> getPrioritisers()
          Gets the prioritiser instances.
 ProcessSelector getSelectorFor(java.net.URI id)
          Gets a selector for the specified process id.
 java.util.List<ProcessSelector> getSelectors()
          Gets the selector instances registered in this environment.
 STSModule getSTSModule()
          Gets the security module.
 void removeListenersFrom(java.net.URI id, POMListener... listeners)
          Removes one or more listeners from the attachment map.
 void setAttribute(java.lang.String name, java.io.Serializable value)
          Sets an environment attribute value.
 void setComponentFor(java.net.URI id, java.lang.Object obj)
          Registers an arbitrary object in any collection it fits in.
 void setDefaultDiscoverer(ProcessDiscoverer discoverer)
          Sets the discoverer instance associated to all processes without an explicit one.
 void setDefaultPrioritiser(Prioritiser prioritiser)
          Sets the prioritiser instance associated to all processes without an explicit one.
 void setDefaultSelector(ProcessSelector selector)
          Sets the selector instance associated to all processes without an explicit one.
 void setDiscovererFor(java.net.URI id, ProcessDiscoverer discoverer)
          Sets the discoverer associated to a given URI.
 void setPrioritiser(java.net.URI id, Prioritiser prioritiser)
          Sets the prioritiser associated to a given URI.
 void setSelectorFor(java.net.URI id, ProcessSelector selector)
          Sets the selector associated to a given URI.
 void setSTSModule(STSModule stsmod)
          Sets the security module implementation.
 

Method Detail

getDiscoverers

java.util.List<ProcessDiscoverer> getDiscoverers()
Gets the discoverer instances registered in this environment.

Returns:
A list of discoverers

getDiscovererFor

ProcessDiscoverer getDiscovererFor(java.net.URI id)
                                   throws DiscoveryException
Gets a discoverer for the specified process id.

The selection of the appropriate instance is up to the implementation.

Parameters:
id - A process id
Returns:
A discoverer
Throws:
DiscoveryException - If an error occurs selecting a discoverer

setDiscovererFor

void setDiscovererFor(java.net.URI id,
                      ProcessDiscoverer discoverer)
Sets the discoverer associated to a given URI.

Parameters:
id - A process id
discoverer - A discoverer instance

setDefaultDiscoverer

void setDefaultDiscoverer(ProcessDiscoverer discoverer)
Sets the discoverer instance associated to all processes without an explicit one.

Parameters:
discoverer - A discoverer instance

getPrioritisers

java.util.List<Prioritiser> getPrioritisers()
Gets the prioritiser instances.

Returns:
A list of prioritisers

getPrioritiserFor

Prioritiser getPrioritiserFor(java.net.URI id)
Gets a prioritiser for the specified process id.

The selection of the appropriate instance is up to the implementation.

Parameters:
id - A process id
Returns:
A prioritiser

setPrioritiser

void setPrioritiser(java.net.URI id,
                    Prioritiser prioritiser)
Sets the prioritiser associated to a given URI.

Parameters:
id - A process id
prioritiser - A prioritiser instance

setDefaultPrioritiser

void setDefaultPrioritiser(Prioritiser prioritiser)
Sets the prioritiser instance associated to all processes without an explicit one.

Parameters:
prioritiser - A prioritiser instance

getSelectors

java.util.List<ProcessSelector> getSelectors()
Gets the selector instances registered in this environment.

Returns:
A list of selectors

getSelectorFor

ProcessSelector getSelectorFor(java.net.URI id)
Gets a selector for the specified process id.

The selection of the appropriate instance is up to the implementation.

Parameters:
id - A process id
Returns:
A selector

setSelectorFor

void setSelectorFor(java.net.URI id,
                    ProcessSelector selector)
Sets the selector associated to a given URI.

Parameters:
id - A process id
selector - A selector instance

setDefaultSelector

void setDefaultSelector(ProcessSelector selector)
Sets the selector instance associated to all processes without an explicit one.

Parameters:
selector - A selector instance

getSTSModule

STSModule getSTSModule()
Gets the security module.

The security token service client module implementation.

Returns:
Security module instance

setSTSModule

void setSTSModule(STSModule stsmod)
Sets the security module implementation.

Parameters:
stsmod - A STS module instance

addListenersFor

void addListenersFor(java.net.URI id,
                     POMListener... listeners)
Adds one or more listeners to a given process.

Parameters:
id - The id of the Process to attach these listeners to
listeners - The listeners to attach

getListenersFor

java.util.Collection<POMListener> getListenersFor(java.net.URI id)
Gets a collection of listeners to be attached to the given Process id.

Parameters:
id - The id of the Process
Returns:
A collection of listeners

removeListenersFrom

void removeListenersFrom(java.net.URI id,
                         POMListener... listeners)
Removes one or more listeners from the attachment map.

Parameters:
id - The id of the Process to detach these listeners from
listeners - The listeners to detach

clearListeners

void clearListeners()
Clears all listeners registered in this environment instance.


clearListenersFor

void clearListenersFor(java.net.URI id)
Clears all listeners registered for a given Process in this environment instance.

Parameters:
id - The id of the Process

setComponentFor

void setComponentFor(java.net.URI id,
                     java.lang.Object obj)
Registers an arbitrary object in any collection it fits in. The interfaces obj implements will determine in which collections it is set.

If the object does not implement any relevant interface, nothing should be done. In particular, exceptions should never be thrown.

Parameters:
id - The Process URI to associate the component to
obj - Component

getAttribute

java.io.Serializable getAttribute(java.lang.String name)
Gets an environment attribute value.

Parameters:
name - Attribute name
Returns:
Attribute value

setAttribute

void setAttribute(java.lang.String name,
                  java.io.Serializable value)
Sets an environment attribute value.

Parameters:
name - Attribute name
value - Attribute value

getAttributes

java.util.Map<java.lang.String,java.io.Serializable> getAttributes()
Gets a map containing all attributes.

Returns:
A map with all attributes in this environment


Copyright © 2006-2008 Grid Systems, S.A.. All Rights Reserved.