001package org.apache.maven.lifecycle.internal;
002
003/*
004 * Licensed to the Apache Software Foundation (ASF) under one
005 * or more contributor license agreements.  See the NOTICE file
006 * distributed with this work for additional information
007 * regarding copyright ownership.  The ASF licenses this file
008 * to you under the Apache License, Version 2.0 (the
009 * "License"); you may not use this file except in compliance
010 * with the License.  You may obtain a copy of the License at
011 *
012 *  http://www.apache.org/licenses/LICENSE-2.0
013 *
014 * Unless required by applicable law or agreed to in writing,
015 * software distributed under the License is distributed on an
016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017 * KIND, either express or implied.  See the License for the
018 * specific language governing permissions and limitations
019 * under the License.
020 */
021
022import org.apache.maven.execution.MavenExecutionResult;
023import org.apache.maven.session.scope.internal.SessionScope;
024
025/**
026 * Context that is fixed for the entire reactor build.
027 *
028 * @since 3.0
029 * @author Jason van Zyl
030 * @author Kristian Rosenvold
031 *         NOTE: This class is not part of any public api and can be changed or deleted without prior notice.
032 */
033public class ReactorContext
034{
035    private final MavenExecutionResult result;
036
037    private final ProjectIndex projectIndex;
038
039    private final ClassLoader originalContextClassLoader;
040
041    private final ReactorBuildStatus reactorBuildStatus;
042
043    private final SessionScope.Memento sessionScope;
044
045    public ReactorContext( MavenExecutionResult result, ProjectIndex projectIndex,
046                           ClassLoader originalContextClassLoader, ReactorBuildStatus reactorBuildStatus,
047                           SessionScope.Memento sessionScope )
048    {
049        this.result = result;
050        this.projectIndex = projectIndex;
051        this.originalContextClassLoader = originalContextClassLoader;
052        this.reactorBuildStatus = reactorBuildStatus;
053        this.sessionScope = sessionScope;
054    }
055
056    public ReactorBuildStatus getReactorBuildStatus()
057    {
058        return reactorBuildStatus;
059    }
060
061    public MavenExecutionResult getResult()
062    {
063        return result;
064    }
065
066    public ProjectIndex getProjectIndex()
067    {
068        return projectIndex;
069    }
070
071    public ClassLoader getOriginalContextClassLoader()
072    {
073        return originalContextClassLoader;
074    }
075
076    /**
077     * @since 3.3.0
078     */
079    public SessionScope.Memento getSessionScopeMemento()
080    {
081        return sessionScope;
082    }
083}