You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by lu...@apache.org on 2005/01/10 19:16:53 UTC

cvs commit: jakarta-slide/src/share/org/apache/slide/event DomainEvent.java DomainListener.java

luetzkendorf    2005/01/10 10:16:53

  Modified:    src/share/org/apache/slide/common Domain.java
  Added:       src/share/org/apache/slide/event DomainEvent.java
                        DomainListener.java
  Log:
  new DomainEvent to allow configuration after successfull init of the domain.
  
  Revision  Changes    Path
  1.51      +14 -6     jakarta-slide/src/share/org/apache/slide/common/Domain.java
  
  Index: Domain.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/Domain.java,v
  retrieving revision 1.50
  retrieving revision 1.51
  diff -u -r1.50 -r1.51
  --- Domain.java	8 Nov 2004 09:25:02 -0000	1.50
  +++ Domain.java	10 Jan 2005 18:16:52 -0000	1.51
  @@ -29,17 +29,20 @@
   import java.util.Hashtable;
   import java.util.Properties;
   import java.util.Vector;
  +
   import javax.xml.parsers.SAXParser;
   import javax.xml.parsers.SAXParserFactory;
  +
   import org.apache.slide.authenticate.SecurityToken;
  +import org.apache.slide.event.DomainEvent;
  +import org.apache.slide.event.EventDispatcher;
  +import org.apache.slide.extractor.ExtractorManager;
   import org.apache.slide.store.Store;
   import org.apache.slide.util.conf.Configuration;
   import org.apache.slide.util.conf.ConfigurationElement;
   import org.apache.slide.util.conf.ConfigurationException;
   import org.apache.slide.util.conf.Populate;
   import org.apache.slide.util.logger.Logger;
  -import org.apache.slide.event.EventDispatcher;
  -import org.apache.slide.extractor.ExtractorManager;
   import org.xml.sax.InputSource;
   
   /**
  @@ -464,6 +467,11 @@
           if ( eventConfigurations.hasMoreElements() ) {
               Configuration eventConfiguration = (Configuration)eventConfigurations.nextElement();
               EventDispatcher.getInstance().configure(eventConfiguration);
  +        }
  +        
  +        if (DomainEvent.INITIALIZED.isEnabled()) {
  +            EventDispatcher.getInstance().fireEvent(DomainEvent.INITIALIZED, 
  +                    new DomainEvent(Domain.class));
           }
       }
       
  
  
  
  1.1                  jakarta-slide/src/share/org/apache/slide/event/DomainEvent.java
  
  Index: DomainEvent.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/event/DomainEvent.java,v 1.1 2005/01/10 18:16:53 luetzkendorf Exp $
   * $Revision: 1.1 $
   * $Date: 2005/01/10 18:16:53 $
   *
   * ====================================================================
   *
   * Copyright 2004 The Apache Software Foundation
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *
   */
  package org.apache.slide.event;
  
  import java.util.EventListener;
  import java.util.EventObject;
  
  /**
   * Events from the Slide Domain object.
   */
  public class DomainEvent extends EventObject {
  
      public static final Initialized INITIALIZED = new Initialized(); 
      
      public final static String GROUP = "domain";
      public final static AbstractEventMethod[] methods = new AbstractEventMethod[] { INITIALIZED };
      
      public DomainEvent(Object source) {
          super(source);
      }
      
      
      public final static class Initialized extends EventMethod {
          public Initialized() {
              super(GROUP, "initialized");
          }
  
          public void fireEvent(EventListener listener, EventObject event) {
              if (listener instanceof DomainListener) {
                  ((DomainListener)listener).initialized((DomainEvent)event);
              }
          }
      }
  }
  
  
  
  1.1                  jakarta-slide/src/share/org/apache/slide/event/DomainListener.java
  
  Index: DomainListener.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/event/DomainListener.java,v 1.1 2005/01/10 18:16:53 luetzkendorf Exp $
   * $Revision: 1.1 $
   * $Date: 2005/01/10 18:16:53 $
   *
   * ====================================================================
   *
   * Copyright 2004 The Apache Software Foundation
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *
   */
  package org.apache.slide.event;
  
  import java.util.EventListener;
  
  /**
   * @author stefan
   */
  public interface DomainListener extends EventListener {
      public void initialized(DomainEvent event);
  }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org