Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-04

javax.ide.net
Interface URIFactory.NameGenerator

Enclosing class:
URIFactory

public static interface URIFactory.NameGenerator

This is a callback interface used by the URIFactory while it is in the process of producing a new unique URI.


Method Summary
 java.lang.String nextName()
          This method is called by URIFactory from one of its newUniqueURI() methods to obtain a relative file name.
 

Method Detail

nextName

java.lang.String nextName()
This method is called by URIFactory from one of its newUniqueURI() methods to obtain a relative file name. The name is usually just a simple file name without any preceeding directory names, that will be used in the process of generating a unique URI.

The URIFactory is responsible for assembling a complete URI by combining a base URI with the relative file name returned by nextName(). The URIFactory is also responsible for checking that the newly created URI is unique among files on disk and within the IDE's caches. If the new URI is not unique, then URIFactory will issue another call to nextName() to get a new name. This process is repeated until either a unique URI is produced, or the URIFactory "times out" on the NameGenerator implementation after a very large number of iterations fails to produce a unique URI.

Therefore to interact properly with URIFactory, the nextName() implementation must return a different name each time it is invoked. More specifically, a particular instance of NameGenerator should not return any name more than once from its nextName() method. Of course, this restriction does not apply across different instances of NameGenerator.

The exact means by which a new name is produced is not specified and is left to the specific NameGenerator classes. However, the nextName() method should not attempt to create an URI and check for its uniqueness, as this may lead to problems in the future when the URIFactory and VirtualFileSystem classes are enhanced. For example, if individual NameGenerator implementations are attempting to determine uniqueness, bugs may surface later if the IDE's algorithm for determining uniqueness changes. How the IDE determines URIuniqueness is not documented and should be considered an implementation detail of the IDE framework.


Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-04

Copyright © 1997, 2010, Oracle. All rights reserved.