blob: 5349fa5f316c7729ea5395971c5493b6fd504968 [file] [log] [blame]
// ========================================================================
// 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;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.jetty.deploy.TrackedEvent.Call;
/**
* AppLifeCycleEventCollector
*/
public class AppLifeCycleEventCollector implements AppLifeCycleListener
{
private List<TrackedEvent> events = new ArrayList<TrackedEvent>();
public void clear()
{
events.clear();
}
public List<TrackedEvent> getEvents()
{
return events;
}
public void onLifeCycleBeforePhase(AppLifeCycleEvent event) throws Exception
{
events.add(new TrackedEvent(Call.BEFORE_PHASE,event));
}
public void onLifeCyclePhase(AppLifeCycleEvent event) throws Exception
{
events.add(new TrackedEvent(Call.PHASE,event));
}
public void onLifeCyclePhaseFailure(AppLifeCycleEvent event)
{
events.add(new TrackedEvent(Call.PHASE_FAILURE,event));
}
public void onLifeCycleState(AppLifeCycleEvent event)
{
events.add(new TrackedEvent(Call.STATE,event));
}
}