Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.remotebuild
Class RBResourceContext

java.lang.Object
  extended by com.ibm.etools.iseries.remotebuild.RBResourceContext

public class RBResourceContext
extends Object

An RBResourceContext provides a means of caching references to RBResources by their model resource. The RBResource hierarchy uses this to ensure that the resources that are located through a context preserve object identity. If an RBResourceContext is not used, then, for example, the RBProject returned by two successive calls to getProject() on the same resource will return different object instances for the RBProject. If the resource has an associated RBResourceContext, then these two results will be the same instance.

An operation that takes a selection of AbstractISeriesResources and creates RBResources from them should establish a context at the beginning of the operation, use it for resolution, and then discard it at the end of the operation.


Constructor Summary
RBResourceContext()
           
 
Method Summary
 void add(RBResource resource)
          Adds a new resource to the context.
 RBResource get(AbstractISeriesResource modelResource)
          Retrieves an RBResource from a context, given the model resource.
 void remove(RBResource resource)
          Removes a resource from the context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RBResourceContext

public RBResourceContext()
Method Detail

add

public void add(RBResource resource)
Adds a new resource to the context.

Parameters:
resource - the resource to be added

remove

public void remove(RBResource resource)
Removes a resource from the context. Does nothing if the resource has not been added.

Parameters:
resource - the resource to be removed

get

public RBResource get(AbstractISeriesResource modelResource)
Retrieves an RBResource from a context, given the model resource. Will return null if there is no associated model resource.

Parameters:
resource - the model resource associated with the RBResource.
Returns:
the RBResource that is associated with that model resource.

Rational Developer for Power Systems Software
V7.6

Copyright © 2011 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.