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.


Method Index

 o getAttractor()
Returns the attractor.
 o getClient()
Returns the client.
 o getMatchPolicy()
Returns the policy to use for matching.
 o getService()
Returns the service for this need or null if not yet satisfied.
 o getServiceSource()
Returns the service source or null if none.
 o isDeferred()
Determines whether this need is deferred.
 o isSatisfied()
Determines whether the need has been satisfied.
 o satisfyDeferred()
Satisfys a deferred service.
 o setAttractor(Attractor)
Sets the attractor describing the service.
 o setClient(ServiceClient)
Sets the client needing the service.
 o setDeferred(boolean)
Sets whether this need is "deferred".
 o setMatchPolicy(MatchPolicy)
Sets the policy to use for matching.
 o setService(Object)
Sets the service needed.
 o setServiceSource(ServiceSource)
Sets the source to be used to satisfy the need.

Methods

 o 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.
 o getAttractor
 public abstract Attractor getAttractor()
Returns the attractor.

Returns:
the attractor.
 o setClient
 public abstract void setClient(ServiceClient client)
Sets the client needing the service. This is required.

Parameters:
client - the client.
 o getClient
 public abstract ServiceClient getClient()
Returns the client.

Returns:
the client, which should not be null.
 o 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.
 o getService
 public abstract Object getService()
Returns the service for this need or null if not yet satisfied.

Returns:
the service or null.
 o isSatisfied
 public abstract boolean isSatisfied()
Determines whether the need has been satisfied.

Returns:
true if satisfied or false if not.
 o 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.
 o isDeferred
 public abstract boolean isDeferred()
Determines whether this need is deferred.

Returns:
ture if deferred or false if not.
 o 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.
 o 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.
 o getServiceSource
 public abstract ServiceSource getServiceSource()
Returns the service source or null if none.

Returns:
the service source.
 o setMatchPolicy
 public abstract void setMatchPolicy(MatchPolicy policy)
Sets the policy to use for matching.

Parameters:
policy - the policy to use for matching.
 o 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