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.kernel.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.agent.SPIAgent;
020    
021    import java.io.Serializable;
022    
023    import java.rmi.Remote;
024    import java.rmi.RemoteException;
025    
026    /**
027     * @author Shuyang Zhou
028     */
029    public interface SPI extends Remote, Serializable {
030    
031            public static final String SPI_INSTANCE_PUBLICATION_KEY =
032                    "SPI_INSTANCE_PUBLICATION_KEY";
033    
034            public void addServlet(
035                            String contextPath, String docBasePath, String mappingPattern,
036                            String servletClassName)
037                    throws RemoteException;
038    
039            public void addWebapp(String contextPath, String docBasePath)
040                    throws RemoteException;
041    
042            public void destroy() throws RemoteException;
043    
044            public MPI getMPI() throws RemoteException;
045    
046            public RegistrationReference getRegistrationReference()
047                    throws RemoteException;
048    
049            public SPIAgent getSPIAgent() throws RemoteException;
050    
051            public SPIConfiguration getSPIConfiguration() throws RemoteException;
052    
053            public String getSPIProviderName() throws RemoteException;
054    
055            public void init() throws RemoteException;
056    
057            public boolean isAlive() throws RemoteException;
058    
059            public void start() throws RemoteException;
060    
061            public void stop() throws RemoteException;
062    
063    }