| // ======================================================================== |
| // Copyright (c) Webtide LLC |
| // ------------------------------------------------------------------------ |
| // All rights reserved. This program and the accompanying materials |
| // are made available under the terms of the Eclipse Public License v1.0 |
| // and Apache License v2.0 which accompanies this distribution. |
| // |
| // The Eclipse Public License is available at |
| // http://www.eclipse.org/legal/epl-v10.html |
| // |
| // The Apache License v2.0 is available at |
| // http://www.apache.org/licenses/LICENSE-2.0.txt |
| // |
| // You may elect to redistribute this code under either of these licenses. |
| // ======================================================================== |
| package org.eclipse.jetty.deploy; |
| |
| /** |
| * Event passed into the {@link AppLifeCycleListener} |
| */ |
| public class AppLifeCycleEvent |
| { |
| private App app; |
| private DeploymentManager deploymentManager; |
| private AppLifeCycle.Phase lifecyclePhase; |
| private AppLifeCycle.State lifecycleState; |
| private Throwable throwable; |
| |
| public App getApp() |
| { |
| return app; |
| } |
| |
| public DeploymentManager getDeploymentManager() |
| { |
| return deploymentManager; |
| } |
| |
| public AppLifeCycle.Phase getLifeCyclePhase() |
| { |
| return lifecyclePhase; |
| } |
| |
| public AppLifeCycle.State getLifeCycleState() |
| { |
| return lifecycleState; |
| } |
| |
| public Throwable getThrowable() |
| { |
| return throwable; |
| } |
| |
| public void setApp(App app) |
| { |
| this.app = app; |
| } |
| |
| public void setDeploymentManager(DeploymentManager deploymentManager) |
| { |
| this.deploymentManager = deploymentManager; |
| } |
| |
| public void setLifeCyclePhase(AppLifeCycle.Phase lifecyclePhase) |
| { |
| this.lifecyclePhase = lifecyclePhase; |
| } |
| |
| public void setLifeCycleState(AppLifeCycle.State lifecycleState) |
| { |
| this.lifecycleState = lifecycleState; |
| } |
| |
| public void setThrowable(Throwable throwable) |
| { |
| this.throwable = throwable; |
| } |
| |
| @Override |
| public String toString() |
| { |
| StringBuilder builder = new StringBuilder(); |
| builder.append("["); |
| if (lifecyclePhase != null) |
| { |
| builder.append("phase=").append(lifecyclePhase).append(", "); |
| } |
| if (lifecycleState != null) |
| { |
| builder.append("state=").append(lifecycleState).append(", "); |
| } |
| if (throwable != null) |
| { |
| builder.append("throwable=").append(throwable); |
| } |
| if (app != null) |
| { |
| builder.append("app=").append(app).append(", "); |
| } |
| builder.append("]"); |
| return builder.toString(); |
| } |
| } |