avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/interfaces ApplicationException.java ApplicationMBean.java
Date Sun, 02 Dec 2001 05:13:32 GMT
donaldp     01/12/01 21:13:32

  Added:       src/java/org/apache/avalon/phoenix/interfaces
                        ApplicationException.java ApplicationMBean.java
  Log:
  First cut at making a Management interface for Applications.
  
  Revision  Changes    Path
  1.1                  jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/interfaces/ApplicationException.java
  
  Index: ApplicationException.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 file.
   */
  package org.apache.avalon.phoenix.interfaces;
  
  import org.apache.avalon.framework.CascadingException;
  
  /**
   * Exception to indicate that an Application failed to 
   * startup or shutdown cleanly.
   *
   * @author <a href="mailto:peter@apache.org">Peter Donald</a>
   */
  public final class ApplicationException
      extends CascadingException
  {
      /**
       * Construct a new <code>ApplicationException</code> instance.
       *
       * @param message The detail message for this exception.
       */
      public ApplicationException( final String message )
      {
          this( message, null );
      }
  
      /**
       * Construct a new <code>ApplicationException</code> instance.
       *
       * @param message The detail message for this exception.
       * @param throwable the root cause of the exception
       */
      public ApplicationException( final String message, final Throwable throwable )
      {
          super( message, throwable );
      }
  }
  
  
  
  1.1                  jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/interfaces/ApplicationMBean.java
  
  Index: ApplicationMBean.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 file.
   */
  package org.apache.avalon.phoenix.interfaces;
  
  /**
   * This is the interface via which you can manager 
   * the root container of Applications.
   *
   * @author <a href="mailto:peter@apache.org">Peter Donald</a>
   */
  public interface ApplicationMBean
  {
      String ROLE = "org.apache.avalon.phoenix.interfaces.ApplicationMBean";
  
      /**
       * Get the name of the application.
       *
       * @return the name of the application
       */
      String getName();
  
      /**
       * Get the name to display in Management UI.
       *
       * @return the name of the application to display in UI
       */
      String getDisplayName();
  
      /**
       * Get the string used to describe the application in the UI.
       *
       * @return a short description of the application
       */
      String getDescription();
  
      /**
       * Get location of Application installation
       *
       * @return the home directory of application
       */
      String getHomeDirectory();
  
      /**
       * Return true if the application is 
       * running or false otherwise.
       *
       * @return true if application is running, false otherwise
       */
      boolean isRunning();
  
      /**
       * Start the application running.
       * This is only valid when isRunning() returns false,
       * otherwise it will generate an IllegalStateException.
       *
       * @exception IllegalStateException if application is already running
       * @exception ApplicationException if the application failed to start.
       *            the message part of exception will contain more information
       *            pertaining to why the application failed to startup
       */
      void start() 
          throws IllegalStateException, ApplicationException;
  
      /**
       * Shutdown and restart the application running.
       * This is only valid when isRunning() returns true,
       * otherwise it will generate an IllegalStateException.
       * This is equivelent to  calling start() and then stop() 
       * in succession.
       *
       * @exception IllegalStateException if application is not already running
       * @exception ApplicationException if the application failed to stop or start.
       *            the message part of exception will contain more information
       *            pertaining to why the application failed to startup/shutdown
       */
      void restart() 
          throws IllegalStateException, ApplicationException;
  
      /**
       * Stop the application running.
       * This is only valid when isRunning() returns true,
       * otherwise it will generate an IllegalStateException.
       *
       * @exception IllegalStateException if application is not already running
       * @exception ApplicationException if the application failed to shutdown.
       *            the message part of exception will contain more information
       *            pertaining to why the application failed to shutodwn
       */
      void stop() 
          throws IllegalStateException, ApplicationException;
  
      /**
       * Uninstall the application.
       * This is only valid when isRunning() returns false,
       * otherwise it will generate an IllegalStateException.
       *
       * @exception IllegalStateException if application is running
       * @exception ApplicationException if the application failed to undeploy.
       *            the message part of exception will contain more information
       *            pertaining to why the application failed to undeploy
       */
      void undeploy() 
          throws IllegalStateException, ApplicationException;
  }
  
  
  

--
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