All Packages Class Hierarchy This Package Previous Next Index
Interface uhr.core.attract.ServiceNeed
- public interface ServiceNeed
A ServiceNeed describes a single needed service. It's designed
for easy matching to a ServiceItem.
-
getAttractor()
- Returns the attractor.
-
getClient()
- Returns the client.
-
getMatchPolicy()
- Returns the policy to use for matching.
-
getService()
- Returns the service for this need or null if not yet satisfied.
-
getServiceSource()
- Returns the service source or null if none.
-
isDeferred()
- Determines whether this need is deferred.
-
isSatisfied()
- Determines whether the need has been satisfied.
-
satisfyDeferred()
- Satisfys a deferred service.
-
setAttractor(Attractor)
- Sets the attractor describing the service.
-
setClient(ServiceClient)
- Sets the client needing the service.
-
setDeferred(boolean)
- Sets whether this need is "deferred".
-
setMatchPolicy(MatchPolicy)
- Sets the policy to use for matching.
-
setService(Object)
- Sets the service needed.
-
setServiceSource(ServiceSource)
- Sets the source to be used to satisfy the need.
setAttractor
public abstract void setAttractor(Attractor attractor)
- Sets the attractor describing the service.
This is a required property.
- Parameters:
- attractor - the attractor describing the service.
getAttractor
public abstract Attractor getAttractor()
- Returns the attractor.
- Returns:
- the attractor.
setClient
public abstract void setClient(ServiceClient client)
- Sets the client needing the service. This is required.
- Parameters:
- client - the client.
getClient
public abstract ServiceClient getClient()
- Returns the client.
- Returns:
- the client, which should not be null.
setService
public abstract void setService(Object service)
- Sets the service needed. This will be passed on to the client.
Once this method is called the need is considered "satisfied".
- Parameters:
- service - the service needed.
getService
public abstract Object getService()
- Returns the service for this need or null if not yet satisfied.
- Returns:
- the service or null.
isSatisfied
public abstract boolean isSatisfied()
- Determines whether the need has been satisfied.
- Returns:
- true if satisfied or false if not.
setDeferred
public abstract void setDeferred(boolean isDeferred)
- Sets whether this need is "deferred". The default is false. A
deferred need is NOT
automatically provided when the part is initialized by the
UHR framework. Instead the ServiceClient should call
satisfyDeferred() when the service is needed.
- Parameters:
- isDeferred - true for deferred, false for not.
isDeferred
public abstract boolean isDeferred()
- Determines whether this need is deferred.
- Returns:
- ture if deferred or false if not.
satisfyDeferred
public abstract void satisfyDeferred()
- Satisfys a deferred service. If the service is currently
unsatisfied and isDeferred is true, calling this method will
cause the need to be satisfied. If the service is already
satisfied this method does nothing.
- Throws: IllegalStateException
- if cannot satisfy the need.
setServiceSource
public abstract void setServiceSource(ServiceSource serviceSource)
- Sets the source to be used to satisfy the need. This is done for
deferred needs. The source may be used anytime by calling
getService(). We do not expose the ServiceSource
to clients so there is no getServiceSource().
- Parameters:
- serviceSource - the source to use to satisfy the need.
getServiceSource
public abstract ServiceSource getServiceSource()
- Returns the service source or null if none.
- Returns:
- the service source.
setMatchPolicy
public abstract void setMatchPolicy(MatchPolicy policy)
- Sets the policy to use for matching.
- Parameters:
- policy - the policy to use for matching.
getMatchPolicy
public abstract MatchPolicy getMatchPolicy()
- Returns the policy to use for matching.
- Returns:
- the policy to use for matching.
All Packages Class Hierarchy This Package Previous Next Index