Openwings API Documentation (v1.1)

net.openwings.component
Class ServiceResult

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

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

This class is used to associate a used service object with its unique service identifier and additional information such as service attributes and user interfaces.

For synchronous services, this class is returned from calls to Component.useService() and is passed to UseServiceListener.serviceProvided(). Additional information can be requested by passing a UseServiceParameters object in the useService() call.

For asynchronous services, this class is returned from calls to Component.publishService() / Component.subscribeService() and is passed to EventServiceListener.serviceAvailable(). For service subscribers, the service object will be null. Additional information can be requested by passing a EventServiceParameters object in the Component.publishService() / Component.subscribeService() call.

See Also:
Serialized Form

Constructor Summary
ServiceResult()
          Default constructor.
ServiceResult(UniqueID serviceID, UniqueID componentID, java.lang.Object service, Attribute[] serviceAttributes, java.lang.Object userInterface, UserInterfaceFactory[] factories)
          Simple constructor.
 
Method Summary
 UniqueID getComponentID()
          This method returns the global unique service identifier for the component that provided this synchronous service / created this asynchronous service (topic), if known.
 java.lang.Object getService()
          This method returns the service object.
 Attribute getServiceAttribute(java.lang.String attributeName)
          This convenience method retrieves a service attribute by name.
 Attribute[] getServiceAttributes()
          This method returns attributes that describe a service, if requested
 UniqueID getServiceID()
          This method returns the global unique service identifier for this service
 java.lang.Object getUserInterface()
          This method returns the user interface object for this service, if one was requested.
 UserInterfaceFactory[] getUserInterfaceFactories()
          This method returns acceptable user interface factories for this service, if requested.
 void setComponentID(UniqueID componentID)
          This method sets the global unique service identifier for the component that provided this synchronous service / created this asynchronous service (topic), if known.
 void setService(java.lang.Object service)
          This method sets the service object.
 void setServiceAttributes(Attribute[] attributes)
          This method sets the attributes that describe the service
 void setServiceID(UniqueID serviceID)
          This method sets the global unique service identifier for this service
 void setUserInterface(java.lang.Object userInterface)
          This method sets the user interface object for this service.
 void setUserInterfaceFactories(UserInterfaceFactory[] factories)
          This method sets acceptable user interface factories for this service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceResult

public ServiceResult()
Default constructor.


ServiceResult

public ServiceResult(UniqueID serviceID,
                     UniqueID componentID,
                     java.lang.Object service,
                     Attribute[] serviceAttributes,
                     java.lang.Object userInterface,
                     UserInterfaceFactory[] factories)
Simple constructor.

Parameters:
serviceID - global unique service identifier
service - service object
userInterface - optional user interface attached to the service
Method Detail

getServiceID

public UniqueID getServiceID()
This method returns the global unique service identifier for this service


setServiceID

public void setServiceID(UniqueID serviceID)
This method sets the global unique service identifier for this service


getComponentID

public UniqueID getComponentID()
This method returns the global unique service identifier for the component that provided this synchronous service / created this asynchronous service (topic), if known.


setComponentID

public void setComponentID(UniqueID componentID)
This method sets the global unique service identifier for the component that provided this synchronous service / created this asynchronous service (topic), if known.


getService

public java.lang.Object getService()
This method returns the service object. If this ServiceResult is for a service subscriber, the method returns null.


setService

public void setService(java.lang.Object service)
This method sets the service object. If this ServiceResult is for a service subscriber, the value should be null.


getServiceAttributes

public Attribute[] getServiceAttributes()
This method returns attributes that describe a service, if requested

To request that attributes be returned for a synchronous service, a UseServiceParameters must be passed to one of the ComponentComplex.useService() methods, with the following settings:

To request that attributes be returned for an asynchronous service (topic), a EventServiceParameters must be passed to one of the ComponentComplex.publishService() / ComponentComplex.subscribeService() methods, with the following settings:

Returns:
array of attributes

setServiceAttributes

public void setServiceAttributes(Attribute[] attributes)
This method sets the attributes that describe the service

Parameters:
attributes - array of attributes

getServiceAttribute

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

Parameters:
attributeName - name of the attribute to retrieve
Returns:
the named attribute, or null if no attribute with the name was found.

getUserInterface

public java.lang.Object getUserInterface()
This method returns the user interface object for this service, if one was requested.

To request a user interface for a synchronous service, a UseServiceParameters must be passed to one of the ComponentComplex.useService() methods, with the following settings:

To request a user interface for an asynchronous service, a EventServiceParameters must be passed to one of the ComponentComplex.publishService() / ComponentComplex.subscribeService() methods, with the following settings:

Returns:
user interface object if one was requested, or if no user interface was requested.

setUserInterface

public void setUserInterface(java.lang.Object userInterface)
This method sets the user interface object for this service.

Parameters:
userInterface - user interface object.

getUserInterfaceFactories

public UserInterfaceFactory[] getUserInterfaceFactories()
This method returns acceptable user interface factories for this service, if requested.

To request that user interface factories be returned for a synchronous service, a UseServiceParameters must be passed to one of the ComponentComplex.useService() methods, with the following settings:

If the desiredUIClass and/or desiredUIConstructorParameters attributes are set, only UserInterfaceFactory objects that meet the criteria will be returned.

To request that user interface factories be returned for an asynchronous service, an EventServiceParameters must be passed to one of the ComponentComplex.publishService() / ComponentComplex.subscribeService() methods, with the following settings:

If the desiredUIClass and/or desiredUIConstructorParameters attributes are set, only UserInterfaceFactory objects that meet the criteria will be returned.

Returns:
user interface object if one was requested, or if no user interface was requested.

setUserInterfaceFactories

public void setUserInterfaceFactories(UserInterfaceFactory[] factories)
This method sets acceptable user interface factories for this service.

Parameters:
factories - user interface factories.

Openwings API Documentation (v1.1)