001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.resiliency.spi;
016    
017    import com.liferay.portal.kernel.nio.intraband.RegistrationReference;
018    import com.liferay.portal.kernel.resiliency.mpi.MPI;
019    import com.liferay.portal.kernel.resiliency.spi.SPI;
020    import com.liferay.portal.kernel.resiliency.spi.SPIConfiguration;
021    import com.liferay.portal.kernel.resiliency.spi.agent.SPIAgent;
022    import com.liferay.portal.resiliency.spi.agent.ErrorSPIAgent;
023    
024    /**
025     * @author Shuyang Zhou
026     */
027    public class ErrorSPI implements SPI {
028    
029            @Override
030            public void addServlet(
031                    String contextPath, String docBasePath, String mappingPattern,
032                    String servletClassName) {
033            }
034    
035            @Override
036            public void addWebapp(String contextPath, String docBasePath) {
037            }
038    
039            @Override
040            public void destroy() {
041            }
042    
043            @Override
044            public MPI getMPI() {
045                    return null;
046            }
047    
048            @Override
049            public RegistrationReference getRegistrationReference() {
050                    return null;
051            }
052    
053            @Override
054            public SPIAgent getSPIAgent() {
055                    return _spiAgent;
056            }
057    
058            @Override
059            public SPIConfiguration getSPIConfiguration() {
060                    return null;
061            }
062    
063            @Override
064            public String getSPIProviderName() {
065                    return null;
066            }
067    
068            @Override
069            public void init() {
070            }
071    
072            @Override
073            public boolean isAlive() {
074                    return true;
075            }
076    
077            @Override
078            public void start() {
079            }
080    
081            @Override
082            public void stop() {
083            }
084    
085            private static SPIAgent _spiAgent = new ErrorSPIAgent();
086    
087    }