Main Page Cookbook/Overview ImageMeister the jcprops file Licensing Binary Installation & Configuration [ Win · Mac · Nix ] Changes Public API Source Code Main Page Java [ Common · Win · Mac · Nix ] Native Code [ Common · Win · Mac · Nix ] Manifest Native Code Overviews [ Common · Win · Mac · Nix · Strings ] Macros [ General · Native Macros ] Walkthroughs [ Java only · Java and native ] Building [ Win · Mac · Nix ] Distribution Issues

    All Packages  This Package  Class Hierarchy  Class Search  Index

Class com.jconfig.FileRegistryFactory

    java.lang.Object
       |
       +----com.jconfig.FileRegistryFactory

Summary

    class  FileRegistryFactory
         extends java.lang.Object
         implements com.jconfig.FileRegistryFactoryI
    {
              // Fields 5
         private boolean bBeenInited;
         private static final String copyrightString;
         private static final String[] defaultFactoryClasses;
         private static final String kFactoryFileName;
         private FileRegistryI obj;

              // Constructors 1
         public FileRegistryFactory();

              // Methods 5
         public FileRegistryI createFileRegistry(File, int);
         private void initialize(File, int);
         private void printPlatformInfo();
         private void tryCreatePlainObject(File, int);
         private void tryCreatePlatformObject(File, int);
    }

The master FileRegistryFactoryI, which is called by FileRegistry to create an object implementing the FileRegistryI interface. All calls to FileRegistry will be delegated to the object returned from this class.
This class implements the behavior described at the start of 'FileRegistryFactoryI': it reads the 'jcfactrz.txt' file, and creates each class listed in this file.
Each class listed in 'jcfactrz.txt' should implement the FileRegistryFactoryI interface. This class will create an instance of each class listed in the 'jcfactrz.txt' file and call that object's createFileRegistry() method. If that method returns an object, the object is returned to FileRegistry. Otherwise, it tries the next FileRegistryFactoryI class listed in this file.
If all FileRegistryFactoryI objects return null, a FileRegistryPlain object is created, if possible, and returned to the FileRegistry.

Author:
  Copyright (c) 1997,1998,1999,2000 Samizdat Productions. All Rights Reserved.

Fields

### · copyrightString | Summary | Top

       private static final String copyrightString

### · kFactoryFileName | Summary | Top

       private static final String kFactoryFileName

### · defaultFactoryClasses | Summary | Top

       private static final String[] defaultFactoryClasses

### · obj | Summary | Top

       private FileRegistryI obj

### · bBeenInited | Summary | Top

       private boolean bBeenInited

Constructors

### · FileRegistryFactory | Summary | Top

       public FileRegistryFactory()

Methods

### · createFileRegistry | Summary | Top

       public FileRegistryI createFileRegistry(File curDir,
                                               int creator)

> Implements:
>   createFileRegistry in interface FileRegistryFactoryI

### · initialize | Summary | Top

       private void initialize(File curDir,
                               int creator)

> First, figure out which platform we're running on. Try to create a platform specific object implementing FileRegistryI (such as FileRegistryMSVM or FileRegistryMRJ). If none of the platform-specific objects can be created, try to create a FileRegistryPlain object.

### · tryCreatePlatformObject | Summary | Top

       private void tryCreatePlatformObject(File curDir,
                                            int creator)

> Open the 'jcfactrz.txt' file, and convert this file into an array of Strings. Then, for each of the Strings, which should be the name of a class, create an instance of that class, which should implement the FileRegistryFactoryI interface. Each object is called, and given a chance to create a FileRegistryI object. If it does create such an object, we're done. The instance variable 'obj' is set by this method.

> For instance, with 'jcfactrz.txt' having its default values, this method will create a 'FileRegistryFactoryWin' object, and then call its 'createFileRegistry()' method. If this method return null, we keep searching. Otherwise, it will return a 'FileRegistryMSVM' object, and we're done.

### · tryCreatePlainObject | Summary | Top

       private void tryCreatePlainObject(File curDir,
                                         int creator)

> Create a FileRegistryPlain object.

### · printPlatformInfo | Summary | Top

       private void printPlatformInfo()

    All Packages  This Package  Class Hierarchy  Class Search  Index

Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7