wt.build
Class StandardBuildService

java.lang.Object
  extended bywt.services.StandardManager
      extended bywt.build.StandardBuildService
All Implemented Interfaces:
BuildService, Manager, NetFactor, Serializable

public class StandardBuildService
extends StandardManager
implements BuildService, Serializable

Use the newStandardBuildService static factory method(s), not the StandardBuildService constructor, to construct instances of this class. Instances must be constructed using the static factory(s), in order to ensure proper initialization of the instance.



Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static String BUILDABLE_OBJECT_KEY
           
private static String BUILTCACHE
           
private static String BUILTLINKSCACHE
           
private static String CLASSNAME
           
static String KEY_ID_SEPARATOR
           
private static String OCCNAMESSCACHE
           
private static String OCCURRENCESTOSAVE
           
private static String OTHERLINKSCACHE
           
private static String OTHEROCCSCACHE
           
private static String RESOURCE
           
 
Fields inherited from class wt.services.StandardManager
 
Fields inherited from interface wt.services.Manager
MANAGER_SERVICE, STARTUP_AUTOMATIC, STARTUP_MANUAL, STATUS_EMERGENCY_SHUTDOWN, STATUS_EMERGENCY_SHUTTING_DOWN, STATUS_SHUTDOWN, STATUS_SHUTDOWN_ERRORS, STATUS_SHUTDOWN_FAILURE, STATUS_SHUTTING_DOWN, STATUS_STARTED, STATUS_STARTED_ERRORS, STATUS_STARTING_UP, STATUS_STARTUP_FAILURE
 
Constructor Summary
StandardBuildService()
           
 
Method Summary
protected  WTCollection build(WTCollection buildRules, ConfigSpec configSpec)
           
 BuildTarget buildTarget(BuildTarget target)
          Deprecated. at R6. Please use buildTarget(BuildTarget, ConfigSpec).
 QueryResult buildTarget(BuildTarget[] targets, ConfigSpec configSpec)
          Deprecated.  
 BuildTarget buildTarget(BuildTarget target, ConfigSpec configSpec)
          

Supported API: false
 WTValuedMap buildTarget(WTCollection targets, ConfigSpec configSpec)
          Builds the given collection of targets.
 BuildTargetMaster buildTargetMaster(BuildTargetMaster targetMaster)
          Propagates attributes from all source master to given target master.
 QueryResult buildTargetMaster(BuildTargetMaster[] targetMasters)
          Propagates attributes from all source master to given target masters.
 QueryResult buildTargetMasterForSourceMaster(BuildSourceMaster sourceMaster)
          Propagates attributes from all source masters associated with target master associated to given master.
 QueryResult buildTargetMasterForSourceMaster(BuildSourceMaster[] sourceMasters)
          Propagates attributes from all source masters associated with target master associated to given masters.
 QueryResult buildTargetsForSource(BuildSource source)
          Deprecated. at R6. Please use buildTargetForSource(BuildSource, ConfigSpec).
 QueryResult buildTargetsForSource(BuildSource[] sources, ConfigSpec configSpec)
          Deprecated.  
 QueryResult buildTargetsForSource(BuildSource source, ConfigSpec configSpec)
          

Supported API: false
 QueryResult buildTargetsForSource(WTCollection sources, ConfigSpec configSpec)
          

Supported API: false
private  void canCreateLink(WTCollection links)
          canCreateLink: Added to support Sandbox Containers Get containers of the end points of the buildlink and checks if it valid to create links across these containers.
protected  void copyHistoryForward(WTCollection targets)
           
 BuildableOccurrence deleteOccurrence(BuildableOccurrence occurrence)
          Deprecated.  
 WTSet deleteOccurrences(WTSet occurrences)
          Deletes given buildable occurrences.
 BuildableLink getBuiltLink(BuildReference buildReference)
          Deprecated.  
 BuildableLink getBuiltLink(BuildTarget targetParent, BuildReference buildReference)
          Returns a "built" buildable link (if exists else null) with the given build reference.
private  WTList getBuiltObjects(WTCollection buildableObjects)
           
 BuildableOccurrence getBuiltOccurrence(BuildReference buildReference)
          Returns the "built" buildable occurrence that is associated with this build reference..
 QueryResult getBuiltOccurrences()
          Returns all "built" buildable occurrences that are associated with selected build targets.
 QueryResult getBuiltOccurrences(UsesOccurrenceContext buildTarget)
          Returns all "built" buildable occurrences that are associated with this build target.
 QueryResult getCandidateLinks(Persistable child)
          Deprecated.  
 QueryResult getCandidateLinks(Persistable parent, Persistable child)
          Returns a QueryResult of "non built" buildable links for the given parent and child.
 QueryResult getCandidateOccurrences(OccurrenceableLink link)
          Returns all "non built" buildable occurrences associated with the given link.
 String getConceptualClassname()
          Deprecated.  
private  WTValuedMap getDatabaseCopies(WTCollection objects)
          Returns the database copy the objects
private  WTKeyedMap.WTEntry getEntry(WTValuedHashMap map, WTReference reference)
           
private  String getKey(QueryKey targetKey, BuildReference br)
           
 QueryResult getTargetsForSources(QueryResult buildSources, Class buildRule)
          

Supported API: false
private  boolean isBuildInProgress()
           
 void markAsBuilt(BuildableLink link, BuildReference buildReference)
          Deprecated. at R6. Please use BuildHelper.markAsBuilt().
 void markAsNeeded(BuildableObject object)
          Tells the Build Service to preserve the given buildable object.
 BuildableLink newBuildableLink(Class linkClass, BuildTarget buildTargetRoleObject, Persistable persistableRoleObject, BuildReference buildReference)
          

Supported API: false
static StandardBuildService newStandardBuildService()
          Default factory for the class.
protected  void performStartupProcess()
          Dummy method to be overridden by subclasses.
private  void processBuildRuleEvents(WTCollection buildRules, KeyedEvent event)
           
protected  void processBuildSourceEvent(WTCollection sources, KeyedEvent event)
           
protected  void processBuildTargetEvent(WTCollection targets, KeyedEvent event)
           
protected  void processPreDeleteBuildableLinks(WTCollection buildableLinks)
          Prevent the deletion of a BuildableLink that has been built by an application when the BuildService's build did not emit this event.
protected  void processPreDeleteOccurrences(WTCollection buildableOccurrences)
          Prevent the deletion of a BuildableOccurrence that has been built by an application when the BuildService's build did not emit this event.
protected  void processPreModifyBuildableLinks(WTCollection buildableLinks)
          Prevent the modification of a BuildableLink that has been built if quantity or end points are changed.
protected  void processPreModifyOccurrences(WTCollection buildableOccurrences)
          Prevent the name modification of a BuildableOccurrence that has been built by an application when the BuildService's build did not invoke the modify/store or the 'saveOccurrence' API was called directly.
protected  void processWorkInProgressEvent(WorkInProgressServiceEvent wipEvent)
           
private  void removeBuildHistories(WTCollection targets)
           
 QueryResult saveOccurrence(UsesOccurrence occurrence, Vector occurrenceData)
          Saves a buildable uses occurrence and its associated occurrence data.
 BuildableLink storeBuildableLink(BuildableLink link)
          Deprecated.  
 WTCollection storeBuildableLinks(WTCollection links)
          Stores the buildable links.
private  void validateBuildability(WorkInProgressServiceEvent wipEvent)
           
protected  void vetoBuildHistoryAction(WTCollection bh)
          Prevent client-side CMD actions against the BuildHistory.
 
Methods inherited from class wt.services.StandardManager
emergencyShutdown, emergencyShutdownComplete, emergencyShuttingDown, getClassInfo, getManagerService, getManagerStatus, getName, getStartupType, init, initialize, initialize, isStarted, newStandardManager, newStandardManager, performEmergencyShutdownProcess, performShutdownProcess, registerEvents, setManagerService, shutdown, shutdownFailure, shutdownSuccess, shuttingDown, started, startedErrors, startingUp, startup, startupFailure, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

KEY_ID_SEPARATOR

public static final String KEY_ID_SEPARATOR
See Also:
Constant Field Values

BUILDABLE_OBJECT_KEY

private static final String BUILDABLE_OBJECT_KEY
See Also:
Constant Field Values

BUILTCACHE

private static final String BUILTCACHE
See Also:
Constant Field Values

BUILTLINKSCACHE

private static final String BUILTLINKSCACHE
See Also:
Constant Field Values

OTHERLINKSCACHE

private static final String OTHERLINKSCACHE
See Also:
Constant Field Values

OTHEROCCSCACHE

private static final String OTHEROCCSCACHE
See Also:
Constant Field Values

OCCNAMESSCACHE

private static final String OCCNAMESSCACHE
See Also:
Constant Field Values

OCCURRENCESTOSAVE

private static final String OCCURRENCESTOSAVE
See Also:
Constant Field Values
Constructor Detail

StandardBuildService

public StandardBuildService()
Method Detail

getConceptualClassname

public String getConceptualClassname()
Deprecated.  

Returns the conceptual (modeled) name for the class.

Supported API: false

Specified by:
getConceptualClassname in interface NetFactor
Overrides:
getConceptualClassname in class StandardManager
Returns:
String

newStandardBuildService

public static StandardBuildService newStandardBuildService()
                                                    throws WTException
Default factory for the class.

Supported API: false

Returns:
StandardBuildService
Throws:
WTException

buildTargetsForSource

public QueryResult buildTargetsForSource(BuildSource source)
                                  throws WTException,
                                         NoRulesToBuildException
Deprecated. at R6. Please use buildTargetForSource(BuildSource, ConfigSpec).



Supported API: false

Specified by:
buildTargetsForSource in interface BuildService
Parameters:
source -
Returns:
QueryResult
Throws:
WTException
NoRulesToBuildException

buildTargetsForSource

public QueryResult buildTargetsForSource(BuildSource source,
                                         ConfigSpec configSpec)
                                  throws WTException,
                                         NoRulesToBuildException


Supported API: false

Specified by:
buildTargetsForSource in interface BuildService
Parameters:
source -
configSpec -
Returns:
QueryResult
Throws:
WTException
NoRulesToBuildException

buildTarget

public BuildTarget buildTarget(BuildTarget target)
                        throws WTException,
                               NoRulesToBuildException
Deprecated. at R6. Please use buildTarget(BuildTarget, ConfigSpec).



Supported API: false

Specified by:
buildTarget in interface BuildService
Parameters:
target -
Returns:
BuildTarget
Throws:
WTException
NoRulesToBuildException

buildTarget

public BuildTarget buildTarget(BuildTarget target,
                               ConfigSpec configSpec)
                        throws WTException,
                               NoRulesToBuildException


Supported API: false

Specified by:
buildTarget in interface BuildService
Parameters:
target -
configSpec -
Returns:
BuildTarget
Throws:
WTException
NoRulesToBuildException

newBuildableLink

public BuildableLink newBuildableLink(Class linkClass,
                                      BuildTarget buildTargetRoleObject,
                                      Persistable persistableRoleObject,
                                      BuildReference buildReference)
                               throws WTException


Supported API: false

Specified by:
newBuildableLink in interface BuildService
Parameters:
linkClass -
buildTargetRoleObject -
persistableRoleObject -
buildReference -
Returns:
BuildableLink
Throws:
WTException

storeBuildableLink

public BuildableLink storeBuildableLink(BuildableLink link)
                                 throws WTException
Deprecated.  



Supported API: false

Specified by:
storeBuildableLink in interface BuildService
Parameters:
link - buildable link to save
Returns:
BuildableLink
Throws:
WTException

getTargetsForSources

public QueryResult getTargetsForSources(QueryResult buildSources,
                                        Class buildRule)
                                 throws WTException


Supported API: false

Specified by:
getTargetsForSources in interface BuildService
Parameters:
buildSources -
buildRule -
Returns:
QueryResult
Throws:
WTException

getBuiltLink

public BuildableLink getBuiltLink(BuildReference buildReference)
                           throws WTException
Deprecated.  

Returns a "built" buildable link (if exists else null) with the given build reference.

Supported API: false

Specified by:
getBuiltLink in interface BuildService
Parameters:
buildReference -
Returns:
BuildableLink
Throws:
WTException

getCandidateLinks

public QueryResult getCandidateLinks(Persistable child)
                              throws WTException
Deprecated.  

Returns a QueryResult of "non built" buildable links for the given child.

Supported API: false

Specified by:
getCandidateLinks in interface BuildService
Parameters:
child -
Returns:
QueryResult
Throws:
WTException

markAsBuilt

public void markAsBuilt(BuildableLink link,
                        BuildReference buildReference)
                 throws WTException
Deprecated. at R6. Please use BuildHelper.markAsBuilt().

Converts a "non built" buildable link to "built" buildable link by setting the link's build reference.

Supported API: false

Specified by:
markAsBuilt in interface BuildService
Parameters:
link -
buildReference -
Throws:
WTException

markAsNeeded

public void markAsNeeded(BuildableObject object)
                  throws WTException
Tells the Build Service to preserve the given buildable object.

Supported API: false

Specified by:
markAsNeeded in interface BuildService
Parameters:
object -
Throws:
WTException

getCandidateOccurrences

public QueryResult getCandidateOccurrences(OccurrenceableLink link)
                                    throws WTException
Returns all "non built" buildable occurrences associated with the given link. These are occurrences that a build delegate may possibly want to subsume.

Supported API: false

Specified by:
getCandidateOccurrences in interface BuildService
Parameters:
link -
Returns:
QueryResult
Throws:
WTException

getBuiltOccurrences

public QueryResult getBuiltOccurrences(UsesOccurrenceContext buildTarget)
                                throws WTException
Returns all "built" buildable occurrences that are associated with this build target.

Supported API: false

Specified by:
getBuiltOccurrences in interface BuildService
Parameters:
buildTarget -
Returns:
QueryResult
Throws:
WTException

saveOccurrence

public QueryResult saveOccurrence(UsesOccurrence occurrence,
                                  Vector occurrenceData)
                           throws WTException
Saves a buildable uses occurrence and its associated occurrence data. Updates the occurrence cache maintained by the BuildService.

Supported API: false

Specified by:
saveOccurrence in interface BuildService
Parameters:
occurrence - Buildable Uses Occurrence to save
occurrenceData - Occurrence Data to save along with the occurrence
Returns:
QueryResult
Throws:
WTException

deleteOccurrence

public BuildableOccurrence deleteOccurrence(BuildableOccurrence occurrence)
                                     throws WTException
Deprecated.  

Deletes a buildable occurrence. Updates the occurrence cache maintained by the BuildService.

Supported API: false

Specified by:
deleteOccurrence in interface BuildService
Parameters:
occurrence -
Returns:
BuildableOccurrence
Throws:
WTException

getBuiltOccurrence

public BuildableOccurrence getBuiltOccurrence(BuildReference buildReference)
                                       throws WTException
Returns the "built" buildable occurrence that is associated with this build reference..

Supported API: false

Specified by:
getBuiltOccurrence in interface BuildService
Parameters:
buildReference -
Returns:
BuildableOccurrence
Throws:
WTException

buildTarget

public WTValuedMap buildTarget(WTCollection targets,
                               ConfigSpec configSpec)
                        throws WTException,
                               NoRulesToBuildException
Builds the given collection of targets. Returns WTValuedMap with original target as key and built target as value.

Supported API: false

Specified by:
buildTarget in interface BuildService
Parameters:
targets - collection of BuildTarget
configSpec -
Returns:
WTValuedMap
Throws:
WTException
NoRulesToBuildException

buildTargetsForSource

public QueryResult buildTargetsForSource(WTCollection sources,
                                         ConfigSpec configSpec)
                                  throws WTException,
                                         NoRulesToBuildException


Supported API: false

Specified by:
buildTargetsForSource in interface BuildService
Parameters:
sources - collection of BuildSource
configSpec -
Returns:
QueryResult
Throws:
WTException
NoRulesToBuildException

buildTargetMaster

public BuildTargetMaster buildTargetMaster(BuildTargetMaster targetMaster)
                                    throws WTException
Propagates attributes from all source master to given target master.

Supported API: false

Specified by:
buildTargetMaster in interface BuildService
Parameters:
targetMaster -
Returns:
BuildTargetMaster
Throws:
WTException

buildTargetMaster

public QueryResult buildTargetMaster(BuildTargetMaster[] targetMasters)
                              throws WTException
Propagates attributes from all source master to given target masters.

Supported API: false

Specified by:
buildTargetMaster in interface BuildService
Parameters:
targetMasters -
Returns:
QueryResult
Throws:
WTException

buildTargetMasterForSourceMaster

public QueryResult buildTargetMasterForSourceMaster(BuildSourceMaster[] sourceMasters)
                                             throws WTException
Propagates attributes from all source masters associated with target master associated to given masters.

Supported API: false

Specified by:
buildTargetMasterForSourceMaster in interface BuildService
Parameters:
sourceMasters -
Returns:
QueryResult
Throws:
WTException

buildTargetMasterForSourceMaster

public QueryResult buildTargetMasterForSourceMaster(BuildSourceMaster sourceMaster)
                                             throws WTException
Propagates attributes from all source masters associated with target master associated to given master.

Supported API: false

Specified by:
buildTargetMasterForSourceMaster in interface BuildService
Parameters:
sourceMaster -
Returns:
QueryResult
Throws:
WTException

getBuiltOccurrences

public QueryResult getBuiltOccurrences()
                                throws WTException
Returns all "built" buildable occurrences that are associated with selected build targets.

Supported API: false

Specified by:
getBuiltOccurrences in interface BuildService
Returns:
QueryResult
Throws:
WTException

deleteOccurrences

public WTSet deleteOccurrences(WTSet occurrences)
                        throws WTException
Deletes given buildable occurrences. Updates the occurrence cache maintained by the BuildService .

Supported API: false

Specified by:
deleteOccurrences in interface BuildService
Parameters:
occurrences -
Returns:
WTSet
Throws:
WTException

storeBuildableLinks

public WTCollection storeBuildableLinks(WTCollection links)
                                 throws WTException
Stores the buildable links. Updates the cache maintained by build service.

Supported API: false

Specified by:
storeBuildableLinks in interface BuildService
Parameters:
links - buildable links to save
Returns:
WTCollection
Throws:
WTException

getCandidateLinks

public QueryResult getCandidateLinks(Persistable parent,
                                     Persistable child)
                              throws WTException
Returns a QueryResult of "non built" buildable links for the given parent and child.

Supported API: false

Specified by:
getCandidateLinks in interface BuildService
Parameters:
parent -
child -
Returns:
QueryResult
Throws:
WTException

buildTarget

public QueryResult buildTarget(BuildTarget[] targets,
                               ConfigSpec configSpec)
                        throws WTException,
                               NoRulesToBuildException
Deprecated.  



Supported API: false

Specified by:
buildTarget in interface BuildService
Parameters:
targets -
configSpec -
Returns:
QueryResult
Throws:
WTException
NoRulesToBuildException

buildTargetsForSource

public QueryResult buildTargetsForSource(BuildSource[] sources,
                                         ConfigSpec configSpec)
                                  throws WTException,
                                         NoRulesToBuildException
Deprecated.  



Supported API: false

Specified by:
buildTargetsForSource in interface BuildService
Parameters:
sources -
configSpec -
Returns:
QueryResult
Throws:
WTException
NoRulesToBuildException

getBuiltLink

public BuildableLink getBuiltLink(BuildTarget targetParent,
                                  BuildReference buildReference)
                           throws WTException
Returns a "built" buildable link (if exists else null) with the given build reference.

Supported API: false

Specified by:
getBuiltLink in interface BuildService
Parameters:
targetParent -
buildReference -
Returns:
BuildableLink
Throws:
WTException

performStartupProcess

protected void performStartupProcess()
                              throws ManagerException
Description copied from class: StandardManager
Dummy method to be overridden by subclasses. Subclasses should override this method and provide startup processing.

Supported API: false

Overrides:
performStartupProcess in class StandardManager
Throws:
ManagerException

vetoBuildHistoryAction

protected void vetoBuildHistoryAction(WTCollection bh)
                               throws WTException
Prevent client-side CMD actions against the BuildHistory. Only the build can manipulate the BuildHistory (and it uses server-side APIs to do it). it.

Throws:
WTException

processPreDeleteBuildableLinks

protected void processPreDeleteBuildableLinks(WTCollection buildableLinks)
                                       throws WTException
Prevent the deletion of a BuildableLink that has been built by an application when the BuildService's build did not emit this event.

Throws:
WTException

isBuildInProgress

private boolean isBuildInProgress()

getBuiltObjects

private WTList getBuiltObjects(WTCollection buildableObjects)
                        throws WTException
Throws:
WTException

processPreModifyBuildableLinks

protected void processPreModifyBuildableLinks(WTCollection buildableLinks)
                                       throws WTException
Prevent the modification of a BuildableLink that has been built if quantity or end points are changed.

Throws:
WTException

getDatabaseCopies

private WTValuedMap getDatabaseCopies(WTCollection objects)
                               throws WTException
Returns the database copy the objects

Parameters:
objects - WTCollection
Returns:
WTValuedMap where key is the object and value as database object
Throws:
WTException

processPreDeleteOccurrences

protected void processPreDeleteOccurrences(WTCollection buildableOccurrences)
                                    throws WTException
Prevent the deletion of a BuildableOccurrence that has been built by an application when the BuildService's build did not emit this event.

Throws:
WTException

processPreModifyOccurrences

protected void processPreModifyOccurrences(WTCollection buildableOccurrences)
                                    throws WTException
Prevent the name modification of a BuildableOccurrence that has been built by an application when the BuildService's build did not invoke the modify/store or the 'saveOccurrence' API was called directly.

Throws:
WTException

processBuildSourceEvent

protected void processBuildSourceEvent(WTCollection sources,
                                       KeyedEvent event)
                                throws WTException
Throws:
WTException

processBuildTargetEvent

protected void processBuildTargetEvent(WTCollection targets,
                                       KeyedEvent event)
                                throws WTException
Throws:
WTException

copyHistoryForward

protected void copyHistoryForward(WTCollection targets)
                           throws WTException
Throws:
WTException

processWorkInProgressEvent

protected void processWorkInProgressEvent(WorkInProgressServiceEvent wipEvent)
                                   throws WTException
Throws:
WTException

canCreateLink

private void canCreateLink(WTCollection links)
                    throws WTException
canCreateLink: Added to support Sandbox Containers Get containers of the end points of the buildlink and checks if it valid to create links across these containers. Multiple BuildRule between source and target not allowed.

Throws:
WTException

getEntry

private WTKeyedMap.WTEntry getEntry(WTValuedHashMap map,
                                    WTReference reference)

validateBuildability

private void validateBuildability(WorkInProgressServiceEvent wipEvent)
                           throws WTException
Throws:
WTException

processBuildRuleEvents

private void processBuildRuleEvents(WTCollection buildRules,
                                    KeyedEvent event)
                             throws WTException
Throws:
WTException

removeBuildHistories

private void removeBuildHistories(WTCollection targets)
                           throws WTException
Throws:
WTException

build

protected WTCollection build(WTCollection buildRules,
                             ConfigSpec configSpec)
                      throws WTException
Throws:
WTException

getKey

private String getKey(QueryKey targetKey,
                      BuildReference br)