Oracle® Data Integrator Java API Reference
11g Release 1 (11.1.1.3.0)

E17060-01

oracle.odi.interfaces.interactive.support.xrefs
Class ContextManager

java.lang.Object
  extended by oracle.odi.interfaces.interactive.support.xrefs.ContextManager

public class ContextManager
extends java.lang.Object

This class is a helper to provide expression contexts for each <@link DataSet> in an interface, as well as a context for target expressions.
An ODI interface expression context (<@link IExpressionContext>) is an object that is able to produce all the recognizable parsing tags that will be used when parsing the expression, for a specified language and technology.
Each of the context returned by this class ensures that they refer to:

See method giveContext to learn how to retrieve a context for a given dataset.

See Also:
IExpressionContext

Constructor Summary
ContextManager(OdiProject pProject, IOdiEntityManager pOdiEntityManager)
          Create a context manager that will include tags for the specified project.
ContextManager(OdiProject pProject, IOdiEntityManager pOdiEntityManager, boolean pUseFindersForProjectObjects)
          Create a context manager that will include tags for the specified project.
 
Method Summary
 void dataSetRemoved(DataSet pDataSet)
          This method must be called by the user when a <@link DataSet> is removed from the current interface, so that the cache can be cleaned up.
Note that there is no need for a dataSetAdded method, as the cache will be automatically populated when the context for the new <@link DataSet> is requested using the giveContext method.
 void dataStoreAdded(SourceDataStore pSourceDataStore)
          This method will be called by <@link oracle.odi.interfaces.interactive.support.InteractiveInterfaceHelperWithActions InteractiveInterfaceHelperWithActions> after a <@link SourceDataStore> has been added to a DataSet.
 void dataStoreRemoved(SourceDataStore pSourceDataStore)
          This method will be called by <@link oracle.odi.interfaces.interactive.support.InteractiveInterfaceHelperWithActions InteractiveInterfaceHelperWithActions> after a <@link SourceDataStore> is removed from a DataSet.
 IExpressionContext giveContext(DataSet pDataSet)
          Return an IExpressionContext for a given DataSet.
 boolean isUseFindersForProject()
          A method to return the current setting for how to get external objects, such as variables, sequences, and procedures.
 void refreshDatastores()
          Clear all caches concerning DataStore objects: they might have changed.
 void refreshGlobalAndProjectObjects()
          Refreshes all global and project objects (variables, sequences, user functions).
 void setUseFindersForProject(boolean pUseFindersForProject)
          Change the behaviour of this ContextManager to force it to use finders or not for external project objects.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextManager

public ContextManager(OdiProject pProject,
                      IOdiEntityManager pOdiEntityManager)
Create a context manager that will include tags for the specified project. Using this constructor sets default value for UseFindersForProjectObjects to false

Parameters:
pProject - the project
pOdiEntityManager - the current entity manager
See Also:
ContextManager(OdiProject, IOdiEntityManager, boolean)

ContextManager

public ContextManager(OdiProject pProject,
                      IOdiEntityManager pOdiEntityManager,
                      boolean pUseFindersForProjectObjects)
Create a context manager that will include tags for the specified project.

Parameters:
pProject - The project in which this context manager will pick project objects (variables, etc)
pOdiEntityManager - The current entity manager.
pUseFindersForProjectObjects - if true, finders will be used to fetch project objects, if false the getters on the project will be used. Use finders if other editors or SDK calls might change the context between the time the manager is created and when the context is actually used, since finders will pick up the new information.
Method Detail

dataSetRemoved

public void dataSetRemoved(DataSet pDataSet)
This method must be called by the user when a <@link DataSet> is removed from the current interface, so that the cache can be cleaned up.
Note that there is no need for a dataSetAdded method, as the cache will be automatically populated when the context for the new <@link DataSet> is requested using the giveContext method.

Parameters:
pDataSet - The DataSet that is being removed.

dataStoreAdded

public void dataStoreAdded(SourceDataStore pSourceDataStore)
This method will be called by <@link oracle.odi.interfaces.interactive.support.InteractiveInterfaceHelperWithActions InteractiveInterfaceHelperWithActions> after a <@link SourceDataStore> has been added to a DataSet. For internal use only.

Parameters:
pSourceDataStore - The SourceDataStore that has been added.

dataStoreRemoved

public void dataStoreRemoved(SourceDataStore pSourceDataStore)
This method will be called by <@link oracle.odi.interfaces.interactive.support.InteractiveInterfaceHelperWithActions InteractiveInterfaceHelperWithActions> after a <@link SourceDataStore> is removed from a DataSet. For internal use only.

Parameters:
pSourceDataStore - The SourceDataStore that is being removed.

giveContext

public IExpressionContext giveContext(DataSet pDataSet)
Return an IExpressionContext for a given DataSet. Note that this method is optimized and caches the contexts to return the context as fast as possible. Thus if a context for a specified DataSet object is requested multiple times, the context will be created and cached during the first call. For subsequent calls the cached context object will be returned. This means that if the context information changes, for example if a new DataStore object is added to the DataSet, or if a new column has been added to the DataStore, then the cache must be updated.
To reset the cache that stores context information for DataStore objects, use refreshDatastores.
To reset the cache that stores context information for global and project (external) objects, DataStore objects, use refreshGlobalAndProjectObjects.

Parameters:
pDataSet - A DataSet for which we want an expression context. If pDataSet is null, a context will be returned for target expressions.
Returns:
The context for the given DataSet.

isUseFindersForProject

public boolean isUseFindersForProject()
A method to return the current setting for how to get external objects, such as variables, sequences, and procedures.

Returns:
true if this instance of ContextManager uses finders to find external objects, false if it uses the project's getters.

refreshDatastores

public void refreshDatastores()
Clear all caches concerning DataStore objects: they might have changed. This should be called if the data store objects have been changed since this context manager was created, before calling giveContext to retrieve the context object.


refreshGlobalAndProjectObjects

public void refreshGlobalAndProjectObjects()
Refreshes all global and project objects (variables, sequences, user functions). This should be called if the global or project objects have been changed since this context manager was created, before calling giveContext to retrieve the context object.


setUseFindersForProject

public void setUseFindersForProject(boolean pUseFindersForProject)
Change the behaviour of this ContextManager to force it to use finders or not for external project objects.

Parameters:
pUseFindersForProject - The new value for UseFindersForProject.

Oracle® Data Integrator Java API Reference
11g Release 1 (11.1.1.3.0)

E17060-01

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.