commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hus...@apache.org
Subject cvs commit: jakarta-commons-sandbox/chain/apps/agility/src/java/org/apache/commons/agility Response.java RequestHandler.java Request.java ProcessException.java Controller.java
Date Tue, 01 Jun 2004 00:55:29 GMT
husted      2004/05/31 17:55:29

  Added:       chain/apps/agility/src/java/org/apache/commons/agility
                        Response.java RequestHandler.java Request.java
                        ProcessException.java Controller.java
  Log:
  Add controller application.
  
  Revision  Changes    Path
  1.1                  jakarta-commons-sandbox/chain/apps/agility/src/java/org/apache/commons/agility/Response.java
  
  Index: Response.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-commons-sandbox/chain/apps/agility/src/java/org/apache/commons/agility/Response.java,v
1.1 2004/06/01 00:55:28 husted Exp $
   * $Revision: 1.1 $
   * $Date: 2004/06/01 00:55:28 $
   *
   * Copyright 1999-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.commons.agility;
  
  /**
   * Outcome of a Request.
   */
  public interface Response {
  
      /**
       * Logical name of corresponding Request.
       * @return Logical name of corresponding Request
       */
      String getName();
  }
  
  
  
  1.1                  jakarta-commons-sandbox/chain/apps/agility/src/java/org/apache/commons/agility/RequestHandler.java
  
  Index: RequestHandler.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-commons-sandbox/chain/apps/agility/src/java/org/apache/commons/agility/RequestHandler.java,v
1.1 2004/06/01 00:55:28 husted Exp $
   * $Revision: 1.1 $
   * $Date: 2004/06/01 00:55:28 $
   *
   * Copyright 1999-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.commons.agility;
  
  /**
   * Command to execute for a Request.
   */
  public interface RequestHandler {
  
      /**
       * Logical name for handler to match with a Request.
       * @return Logical name for handler to match with a Request
       */
      String getName();
  
      /**
       * Execute operation corresponding to Request.
       * @param request The Request to handle
       * @throws ProcessException On any error
       */
      void handle(Request request) throws ProcessException;
  }
  
  
  
  1.1                  jakarta-commons-sandbox/chain/apps/agility/src/java/org/apache/commons/agility/Request.java
  
  Index: Request.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-commons-sandbox/chain/apps/agility/src/java/org/apache/commons/agility/Request.java,v
1.1 2004/06/01 00:55:28 husted Exp $
   * $Revision: 1.1 $
   * $Date: 2004/06/01 00:55:28 $
   *
   * Copyright 1999-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.commons.agility;
  
  /**
   * Command submitted by a client for processing.
   */
  public interface Request {
  
      /**
       * Logical name for this Request.
       * @return Logical name for this Request.
       */
      String getName();
  
      /**
       * The outcome of this Request.
       * @return Outcome of this Request.
       */
      Response getResponse();
  
      /**
       * Set outcome of this Request.
       * @param response Outcome of this Request.
       */
      void setResponse(Response response);
  }
  
  
  
  1.1                  jakarta-commons-sandbox/chain/apps/agility/src/java/org/apache/commons/agility/ProcessException.java
  
  Index: ProcessException.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-commons-sandbox/chain/apps/agility/src/java/org/apache/commons/agility/ProcessException.java,v
1.1 2004/06/01 00:55:28 husted Exp $
   * $Revision: 1.1 $
   * $Date: 2004/06/01 00:55:28 $
   *
   * Copyright 1999-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.commons.agility;
  
  /**
   * Base exception for controller package.
   */
  public class ProcessException extends Exception {
  
      /**
       * Constructor to wrap any Throwable.
       * @param cause Throwable to wrap
       */
      public ProcessException(Throwable cause) {
          super(cause);
      }
  }
  
  
  
  1.1                  jakarta-commons-sandbox/chain/apps/agility/src/java/org/apache/commons/agility/Controller.java
  
  Index: Controller.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-commons-sandbox/chain/apps/agility/src/java/org/apache/commons/agility/Controller.java,v
1.1 2004/06/01 00:55:28 husted Exp $
   * $Revision: 1.1 $
   * $Date: 2004/06/01 00:55:28 $
   *
   * Copyright 1999-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.commons.agility;
  
  /**
   * A controller "interacts with a client, controlling and managing the handling
   * of each request" [J2EE Design Patterns].
   */
  public interface Controller {
  
      /**
       * Add a handler for a request.
       * @param handler RequestHandler to add
       */
      void addHandler(RequestHandler handler);
  
      /**
       * Return the RequestHandler matching name.
       * @param name RequestHandler name to match
       * @return the RequestHandler matching name
       * @throws ProcessException if name cannot be matched
       */
      RequestHandler getHandler(String name) throws ProcessException;
  
      /**
       * Main entry method that is called for each request
       * @param request The Request to process
       * @throws ProcessException On any error
       */
      void process(Request request) throws ProcessException;
  }
  
  
  

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


Mime
View raw message