All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class uhr.core.attract.ServiceNeedStd

java.lang.Object
   |
   +----uhr.core.attract.ServiceNeedStd

public class ServiceNeedStd
extends Object
implements ServiceNeed
A ServiceNeed describes a single needed service. It's designed for easy matching to a ServiceItem.


Constructor Index

 o ServiceNeedStd()

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.

Constructors

 o ServiceNeedStd
 public ServiceNeedStd()

Methods

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

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

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

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

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

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

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

Returns:
the service source.
 o setMatchPolicy
 public void setMatchPolicy(MatchPolicy policy)
Sets the policy to use for matching. The default is a policy for the "First Subset" algorithm.

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