Openwings API Documentation (v1.1)

net.openwings.component
Class UseServiceParameters

java.lang.Object
  extended bynet.openwings.component.UseServiceParameters
All Implemented Interfaces:
java.io.Serializable

public class UseServiceParameters
extends java.lang.Object
implements java.io.Serializable

This class defines an object which can be passed to the useService() methods of the ComponentComplex interface to specify configuration information and behavior relevant to using services. This includes:

This object can be stored in a UseServicePolicy to make it configurable at deployment time.

See Also:
UseServicePolicy, Serialized Form

Constructor Summary
UseServiceParameters()
          Default constructor
UseServiceParameters(UniqueID componentID, UniqueID serviceID, boolean acceptDistributedObjectsImmediately, boolean returnServiceAttributes, boolean returnUserInterfaceFactories, java.lang.Class desiredUIClass, java.lang.Object[] desiredUIConstructorParameters, boolean buildUIImmediately, int maximumNumberOfResults, Attribute[] requiredAttributes)
          General constructor
 
Method Summary
 void addRequiredAttribute(Attribute attribute)
          This convenience method adds a service attribute
 boolean getAcceptDistributedObjectsImmediately()
          This method returns a flag indicating whether a service (or services) should be connected immediately.
 boolean getBuildUIImmediately()
          This method returns a flag that indicates whether the user interface for a used service should built immediately upon locating the service.
 UniqueID getComponentID()
          This method returns the unique identifier for a component.
 java.lang.Class getDesiredUIClass()
          This method returns the desired type of user interface for a service, based on the class of the UI object.
 java.lang.Object[] getDesiredUIConstructorParameters()
          This method returns parameters that a UI factory will pass to the constructor of a UI object.
 int getMaximumNumberOfResults()
          This method returns an integer that represents an upper limit on the number of ServiceResult objects that should be returned from a call to ComponentComplex.useService().
 Attribute getRequiredAttribute(Attribute attribute)
          This convenience method retrieves a service attribute
 Attribute getRequiredAttribute(java.lang.String attributeName)
          This convenience method retrieves a service attribute by name
 Attribute[] getRequiredAttributes()
          This method returns required attributes for service
 boolean getReturnServiceAttributes()
          This method returns a flag that indicates whether the attributes of a used service should be returned in the serviceAttributes field of a ServiceResult.
 boolean getReturnUserInterfaceFactories()
          This method returns a flag that indicates whether the user interface factories attached to a used service should be returned in the userInterfaceFactories field of a ServiceResult.
 UniqueID getServiceID()
          This method returns the unique identifier for a service.
 Attribute removeRequiredAttribute(Attribute attribute)
          This convenience method removes a service attribute return the attribute, or null if the attribute is not in the list
 Attribute removeRequiredAttribute(java.lang.String attributeName)
          This convenience method removes a service attribute by name return the attribute, or null if the attribute is not in the list
 void setAcceptDistributedObjectsImmediately(boolean acceptDistributedObjectsImmediately)
          This method sets a flag to indicate whether a service (or services) should be connected immediately or whether the connection should wait until the user calls ComponentComplex.acceptDistributedObject(), passing the service object.
 void setBuildUIImmediately(boolean buildUIImmediately)
          This method sets a flag that indicates whether the user interface for a used service should built immediately upon locating the service.
 void setComponentID(UniqueID componentID)
          This method sets the unique identifier for a component.
 void setDesiredUIClass(java.lang.Class desiredUIClass)
          This method sets the desired type of user interface for a service, based on the class of the UI object.
 void setDesiredUIConstructorParameters(java.lang.Object[] desiredUIConstructorParameters)
          This method sets parameters that are to be passed to the constructor of a UI object by a UI factory.
 void setMaximumNumberOfResults(int maximumNumberOfResults)
          This method sets an integer that represents an upper limit on the number of ServiceResult objects that should be returned from a call to ComponentComplex.useService().
 void setRequiredAttributes(Attribute[] requiredAttributes)
          This method sets required attributes for a service
 void setReturnServiceAttributes(boolean returnServiceAttributes)
          This method sets a flag that indicates whether the attributes of a used service should be returned in the serviceAttributes field of a ServiceResult.
 void setReturnUserInterfaceFactories(boolean returnUserInterfaceFactories)
          This method sets a flag that indicates whether the user interface factories attached to a used service should be returned in the userInterfaceFactories field of a ServiceResult.
 void setServiceID(UniqueID serviceID)
          This method sets the unique identifier for a desired service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UseServiceParameters

public UseServiceParameters()
Default constructor


UseServiceParameters

public UseServiceParameters(UniqueID componentID,
                            UniqueID serviceID,
                            boolean acceptDistributedObjectsImmediately,
                            boolean returnServiceAttributes,
                            boolean returnUserInterfaceFactories,
                            java.lang.Class desiredUIClass,
                            java.lang.Object[] desiredUIConstructorParameters,
                            boolean buildUIImmediately,
                            int maximumNumberOfResults,
                            Attribute[] requiredAttributes)
General constructor

Method Detail

setComponentID

public void setComponentID(UniqueID componentID)
This method sets the unique identifier for a component. This is useful when attempting to use multiple services from the same component.

Parameters:
componentID - unique identifer for a component

getComponentID

public UniqueID getComponentID()
This method returns the unique identifier for a component.

Returns:
unique identifer for a component

setServiceID

public void setServiceID(UniqueID serviceID)
This method sets the unique identifier for a desired service. This limits the search to a single service instance and should be used with care.


getServiceID

public UniqueID getServiceID()
This method returns the unique identifier for a service.

Returns:
unique identifer for a service

setAcceptDistributedObjectsImmediately

public void setAcceptDistributedObjectsImmediately(boolean acceptDistributedObjectsImmediately)
This method sets a flag to indicate whether a service (or services) should be connected immediately or whether the connection should wait until the user calls ComponentComplex.acceptDistributedObject(), passing the service object.

Parameters:
acceptDistributedObjectsImmediately - flag

getAcceptDistributedObjectsImmediately

public boolean getAcceptDistributedObjectsImmediately()
This method returns a flag indicating whether a service (or services) should be connected immediately.

Returns:
flag

setReturnServiceAttributes

public void setReturnServiceAttributes(boolean returnServiceAttributes)
This method sets a flag that indicates whether the attributes of a used service should be returned in the serviceAttributes field of a ServiceResult.

Parameters:
returnServiceAttributes - flag

getReturnServiceAttributes

public boolean getReturnServiceAttributes()
This method returns a flag that indicates whether the attributes of a used service should be returned in the serviceAttributes field of a ServiceResult.

Returns:
flag

setReturnUserInterfaceFactories

public void setReturnUserInterfaceFactories(boolean returnUserInterfaceFactories)
This method sets a flag that indicates whether the user interface factories attached to a used service should be returned in the userInterfaceFactories field of a ServiceResult.

Parameters:
returnUserInterfaceFactories - flag

getReturnUserInterfaceFactories

public boolean getReturnUserInterfaceFactories()
This method returns a flag that indicates whether the user interface factories attached to a used service should be returned in the userInterfaceFactories field of a ServiceResult.

Returns:
flag

setDesiredUIClass

public void setDesiredUIClass(java.lang.Class desiredUIClass)
This method sets the desired type of user interface for a service, based on the class of the UI object.

Parameters:
desiredUIClass - the UI object returned in ServiceResult will be an instance of this class

getDesiredUIClass

public java.lang.Class getDesiredUIClass()
This method returns the desired type of user interface for a service, based on the class of the UI object.

Returns:
the UI object returned in ServiceResult will be an instance of this class

setDesiredUIConstructorParameters

public void setDesiredUIConstructorParameters(java.lang.Object[] desiredUIConstructorParameters)
This method sets parameters that are to be passed to the constructor of a UI object by a UI factory.

Parameters:
desiredUIConstructorParameters - required parameters for a constructor of the desiredUIClass

getDesiredUIConstructorParameters

public java.lang.Object[] getDesiredUIConstructorParameters()
This method returns parameters that a UI factory will pass to the constructor of a UI object.

Returns:
required parameters for a constructor of desiredUIClass

setBuildUIImmediately

public void setBuildUIImmediately(boolean buildUIImmediately)
This method sets a flag that indicates whether the user interface for a used service should built immediately upon locating the service. This setting only applies if the desiredUIClass attribute is set

Parameters:
buildUIImmediately - flag

getBuildUIImmediately

public boolean getBuildUIImmediately()
This method returns a flag that indicates whether the user interface for a used service should built immediately upon locating the service.

Returns:
flag

setMaximumNumberOfResults

public void setMaximumNumberOfResults(int maximumNumberOfResults)
This method sets an integer that represents an upper limit on the number of ServiceResult objects that should be returned from a call to ComponentComplex.useService(). The value 0 is used to indicate no limit on the number of services returned. This parameter defaults to 1, but is ignored when a UseServiceListener is passed to useService.

Parameters:
maximumNumberOfResults - upper limit on the number of ServiceResult objects desired

getMaximumNumberOfResults

public int getMaximumNumberOfResults()
This method returns an integer that represents an upper limit on the number of ServiceResult objects that should be returned from a call to ComponentComplex.useService(). The value 0 is used to indicate no limit on the number of services returned. This parameter defaults to 1, but is ignored when a UseServiceListener is passed to useService.

Returns:
upper limit on the number of ServiceResult objects desired

setRequiredAttributes

public void setRequiredAttributes(Attribute[] requiredAttributes)
This method sets required attributes for a service

See Also:
Attribute

getRequiredAttributes

public Attribute[] getRequiredAttributes()
This method returns required attributes for service

Returns:
array of attributes
See Also:
Attribute

addRequiredAttribute

public void addRequiredAttribute(Attribute attribute)
This convenience method adds a service attribute


removeRequiredAttribute

public Attribute removeRequiredAttribute(Attribute attribute)
This convenience method removes a service attribute return the attribute, or null if the attribute is not in the list


removeRequiredAttribute

public Attribute removeRequiredAttribute(java.lang.String attributeName)
This convenience method removes a service attribute by name return the attribute, or null if the attribute is not in the list


getRequiredAttribute

public Attribute getRequiredAttribute(Attribute attribute)
This convenience method retrieves a service attribute


getRequiredAttribute

public Attribute getRequiredAttribute(java.lang.String attributeName)
This convenience method retrieves a service attribute by name


Openwings API Documentation (v1.1)