avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hamm...@apache.org
Subject cvs commit: jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix ApplicationEvent.java ApplicationListener.java
Date Wed, 16 Jan 2002 13:48:15 GMT
hammant     02/01/16 05:48:15

  Added:       src/java/org/apache/avalon/phoenix ApplicationEvent.java
                        ApplicationListener.java
  Log:
  new interfaces to support Application listening.
  Peter to approve.
  
  Revision  Changes    Path
  1.1                  jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/ApplicationEvent.java
  
  Index: ApplicationEvent.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included  with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.avalon.phoenix;
  
  import java.util.EventObject;
  import org.apache.avalon.phoenix.metadata.SarMetaData;
  
  /**
   * This is the class that is used to deliver notifications
   * about Application state changes to the
   * <code>ApplicationListener</code>s of a Server Application.
   *
   * @author <a href="mailto:peter@apache.org">Peter Donald</a>
   */
  public final class ApplicationEvent
      extends EventObject
  {
      private final String     m_name;
      private final SarMetaData  m_sarMetaData;
  
      /**
       * Construct the <code>ApplicationEvent</code>.
       *
       * @param name the name of app
       * @param sarMetaData the SarMetaData object for app
       */
      public ApplicationEvent( final String name,
              final SarMetaData sarMetaData )
      {
          super( name );
  
          if( null == name )
          {
              throw new NullPointerException( "name proeprty is null" );
          }
          if( null == sarMetaData )
          {
              throw new NullPointerException( "sarMetaData proeprty is null" );
          }
  
          m_name = name;
          m_sarMetaData = sarMetaData;
      }
  
      /**
       * Retrieve name of app.
       *
       * @return the name of app
       */
      public String getName()
      {
          return m_name;
      }
  
      /**
       * Retrieve the SarMetaData for app.
       *
       * @return the SarMetaData for app
       */
      public SarMetaData getSarMetaData()
      {
          return m_sarMetaData;
      }
  }
  
  
  
  1.1                  jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/ApplicationListener.java
  
  Index: ApplicationListener.java
  ===================================================================
  
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included  with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.avalon.phoenix;
  
  /**
   * Implementations of this interface receive notifications about
   * changes to the state of Application.
   * The implementation <em>must</em> have a zero argument
   * constructor and is instantiated before any other component of the Server
   * Application. To receive notification events, the implementation class
   * should be specified in the <code>assembly.xml</code> descriptor.
   *
   * @author <a href="mailto:peter@apache.org">Peter Donald</a>
   */
  public interface ApplicationListener extends BlockListener
  {
  
      /**
       * Notification that an application is being started.
       *
       * @param event the ApplicationEvent
       *
       */
      void applicationStarting(ApplicationEvent applicationEvent);
  
      /**
       * Notification that an application has now started.
       *
       *
       */
      void applicationStarted();
  
      /**
       * Notification that an application is being stopped.
       *
       *
       */
      void applicationStopping();
  
      /**
       * Notification that an application has stopped.
       *
       *
       */
      void applicationStopped();
  
      /**
       * Notification that an application has failed at some moment.
       * This is for information only as Phoenix will do the right
       * thing for correct shutdown both before and after this method
       * is called.  The user of this method should NOT call System.exit()
       *
       *
       * @param causeOfFailure
       *
       */
      void applicationFailure(Exception causeOfFailure);
  }
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message