vgritsenko    2004/02/20 05:45:06

  Modified:    java/src/org/apache/xindice/core Collection.java
                        Database.java
               java/src/org/apache/xindice/server ManagedServer.java
  Log:
  Add TODO to Database.close()
  Add Javadocs to ManagedServer
  
  Revision  Changes    Path
  1.48      +7 -6      
xml-xindice/java/src/org/apache/xindice/core/Collection.java
  
  Index: Collection.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/core/Collection.java,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- Collection.java   11 Feb 2004 14:00:32 -0000      1.47
  +++ Collection.java   20 Feb 2004 13:45:05 -0000      1.48
  @@ -76,16 +76,17 @@
       private static final String CLASS = "class";
       private static final String CLASSNAME = "xindice-class";
       private static final String COMPRESSED = "compressed";
  -    private static final DocumentSet EMPTY_DOCUMENTSET = new 
EmptyDocumentSet();
  -    private static final NodeSet EMPTY_NODESET = new EmptyNodeSet();
  -    private static final String[] EMPTY_STRING_ARRAY = {};
       private static final String FILER = "filer";
  -    private static int host_id;
       private static final String INDEXES = "indexes";
       private static final String INLINE_METADATA = "inline-metadata";
       private static final String NAME = "name";
       private static final String SYMBOLS = "symbols";
   
  +    private static final DocumentSet EMPTY_DOCUMENTSET = new 
EmptyDocumentSet();
  +    private static final NodeSet EMPTY_NODESET = new EmptyNodeSet();
  +    private static final String[] EMPTY_STRING_ARRAY = {};
  +
  +    private static int host_id;
       static {
           try {
               InetAddress a = InetAddress.getLocalHost();
  
  
  
  1.39      +6 -3      
xml-xindice/java/src/org/apache/xindice/core/Database.java
  
  Index: Database.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/core/Database.java,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- Database.java     8 Feb 2004 02:51:06 -0000       1.38
  +++ Database.java     20 Feb 2004 13:45:05 -0000      1.39
  @@ -141,8 +141,11 @@
       /**
        * @see org.apache.xindice.core.DBObject#close()
        */
  -    public boolean close() {
  +    public boolean close() throws DBException {
           flushConfig();
  +        super.close();
  +
  +        // TODO: Close? Collections / Filers / Indexers?
   
           synchronized (databases) {
               databases.remove(getName());
  
  
  
  1.8       +18 -9     
xml-xindice/java/src/org/apache/xindice/server/ManagedServer.java
  
  Index: ManagedServer.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/server/ManagedServer.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ManagedServer.java        8 Feb 2004 02:54:25 -0000       1.7
  +++ ManagedServer.java        20 Feb 2004 13:45:05 -0000      1.8
  @@ -43,10 +43,12 @@
   
       private static final Log log = LogFactory.getLog(ManagedServer.class);
   
  -    private Database db = null;
  -    private boolean running = false;
  -
  +    private Database db;
  +    private boolean running;
   
  +    /**
  +     * (Optionally configure and) start the server
  +     */
       public synchronized void start() throws Exception {
           if (!running) {
               configure();
  @@ -56,22 +58,29 @@
           }
       }
   
  -    public void stop() throws Exception {
  +    /**
  +     * Stop the server, close database
  +     */
  +    public synchronized void stop() throws Exception {
           if (running) {
               db.close();
               db = null;
  +            running = false;
           } else {
               log.warn("Stop called on a stopped server, ignored");
           }
       }
   
  -    public void configure() throws IOException, XindiceException {
  +    /**
  +     * Configure and load database
  +     */
  +    public synchronized void configure() throws IOException, 
XindiceException {
           db = Database.getDatabase(loadConfiguration());
  -
           if (null == db) {
               log.fatal("Unable to configure database");
               throw new XindiceException("Unable to configure database");
  -        } else if (log.isInfoEnabled()) {
  +        }
  +        if (log.isInfoEnabled()) {
               log.info("Database name: '" + db.getName() + "'");
           }
       }
  
  
  

Reply via email to