org.ceryle.tm
Class TopicLocatorPool

java.lang.Object
  extended by org.ceryle.tm.TopicLocatorPool

public class TopicLocatorPool
extends Object

TopicLocatorPool is used as a utility source of created-on-demand, PSI-based Topics and Locators. These are Topics defined by their subject indicators). These are created and stored specific to each TopicMap object, as each is bound to its parent.

The Topics and Locators are stored within instances of an inner class TopicLocatorMap, containing two HashSets: one for Topics and one for Locators. Each of these HashSets is a container mapping URIs to either Topics or Locators. E.g., a method call to create a specific PSI Topic will check to see if the TopicMap has already been registered. If not, it is added to the registry. The TopicLocatorMap for the corresponding TopicMap is used to return (create or locate) the Topic for the PSI.

Since:
JDK1.3
Version:
$Id: TopicLocatorPool.java,v 3.7 2007-06-15 12:09:33 altheim Exp $
Author:
Murray Altheim

Nested Class Summary
protected  class TopicLocatorPool.TopicLocatorMap
          Inner class acting as a map between on-demand URIs and Locators or PSI-based Topics for each TopicMap.
 
Constructor Summary
TopicLocatorPool(TopicMapProcessor tmprocessor)
           
 
Method Summary
 Locator returnLocator(TopicMap topicmap, String uri)
          Returns a Locator whose address is uri, provided with a parent TopicMap topicmap.
protected  TopicLocatorPool.TopicLocatorMap returnTopicLocatorMap(TopicMap topicmap)
          Return a TopicLocatorMap object for the supplied TopicMap.
 Topic returnTopicWithPSI(TopicMap topicmap, String id, Locator uri)
          Returns a Topic whose ID is id and adds a subject indicator with the String uri considered as a PSI.
 Topic returnTopicWithPSI(TopicMap topicmap, String id, String uri)
          Returns a Topic whose ID is id and adds a subject indicator with the String uri considered as a PSI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TopicLocatorPool

public TopicLocatorPool(TopicMapProcessor tmprocessor)
Method Detail

returnLocator

public Locator returnLocator(TopicMap topicmap,
                             String uri)
                      throws TopicMapException
Returns a Locator whose address is uri, provided with a parent TopicMap topicmap.

Parameters:
topicmap - a reference to the topic map to be queried
uri - the String used as the locator address
Throws:
TopicMapException

returnTopicWithPSI

public Topic returnTopicWithPSI(TopicMap topicmap,
                                String id,
                                String uri)
                         throws TopicMapException
Returns a Topic whose ID is id and adds a subject indicator with the String uri considered as a PSI.

Parameters:
topicmap - a reference to the topic map to be queried
id - the ID to be used for the new Topic
uri - the String used as the locator address
Throws:
TopicMapException

returnTopicWithPSI

public Topic returnTopicWithPSI(TopicMap topicmap,
                                String id,
                                Locator uri)
                         throws TopicMapException
Returns a Topic whose ID is id and adds a subject indicator with the String uri considered as a PSI.

Parameters:
topicmap - a reference to the topic map to be queried
id - the ID to be used for the new Topic
uri - the String used as the locator address
Throws:
TopicMapException

returnTopicLocatorMap

protected TopicLocatorPool.TopicLocatorMap returnTopicLocatorMap(TopicMap topicmap)
Return a TopicLocatorMap object for the supplied TopicMap.



The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.