001: /*
002: * JOnAS: Java(TM) Open Application Server
003: * Copyright (C) 1999 Bull S.A.
004: * Contact: jonas-team@objectweb.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * Initial developer(s): ____________________________________.
022: * Contributor(s): ______________________________________.
023: * JOnAS 2.4 Murad Meghani (Murad.Meghani@compuware.com) killServer and stopServer
024: * JOnAS 2.5 2002.06 Florent Benoit & Ludovic Bert :
025: * Methods for wars and ear files
026: * Dean Jennings = add deployFile
027: * --------------------------------------------------------------------------
028: * $Id: AdmInterface.java 9299 2006-08-01 16:10:46Z durieuxp $
029: * --------------------------------------------------------------------------
030: */
031:
032: package org.objectweb.jonas.adm;
033:
034: import java.rmi.Remote;
035: import java.rmi.RemoteException;
036: import java.util.Properties;
037: import java.util.Vector;
038: import java.util.List;
039:
040: import org.objectweb.jonas.ear.EarServiceException;
041: import org.objectweb.jonas.resource.ResourceServiceException;
042: import org.objectweb.jonas.web.JWebContainerServiceException;
043:
044: /*
045: * JOnAS Administration Remote Interface.
046: * This is used basically by jonas admin.
047: * @author Philippe Coq
048: * Contributor(s):
049: * Murad Meghani (Murad.Meghani@compuware.com) killServer and stopServer
050: * Florent Benoit & Ludovic Bert : Methods for wars and ear files
051: */
052: public interface AdmInterface extends Remote {
053:
054: public static final int TYPE_EJB = 1;
055: public static final int TYPE_WAR = 2;
056: public static final int TYPE_EAR = 3;
057: public static final int TYPE_RAR = 4;
058: public static final int TYPE_CAR = 5;
059:
060: public static final int STATUS_RUNNING = 1;
061: public static final int STATUS_STOPPED = 2;
062: public static final int STATUS_ALL = 0;
063:
064: /**
065: * Deploy a given ear file with the help of the ear service.
066: * @param fileName the name of the ear file.
067: * @throws RemoteException if rmi call failed.
068: * @throws EarServiceException if the deployment failed.
069: */
070: public void addEar(String fileName) throws RemoteException,
071: EarServiceException;
072:
073: /**
074: * Deploy a given rar file with the help of the resource service.
075: * @param fileName the name of the rar file.
076: * @throws RemoteException if rmi call failed.
077: * @throws ResourceServiceException if the deployment failed.
078: */
079: public void addRar(String fileName) throws RemoteException,
080: ResourceServiceException;
081:
082: /**
083: * Deploy a given war file with the help of the web container service.
084: * @param fileName the name of the war file.
085: * @throws RemoteException if rmi call failed.
086: * @throws JWebContainerServiceException if the deployment failed.
087: */
088: public void addWar(String fileName) throws RemoteException,
089: JWebContainerServiceException;
090:
091: /**
092: * UnDeploy a given ear file with the help of the ear service.
093: * @param fileName the name of the ear file.
094: * @throws RemoteException if rmi call failed.
095: * @throws EarServiceException if the undeployment failed.
096: */
097: public void removeEar(String fileName) throws RemoteException,
098: EarServiceException;
099:
100: /**
101: * UnDeploy a given rar file with the help of the resource service.
102: * @param fileName the name of the rar file.
103: * @throws RemoteException if rmi call failed.
104: * @throws ResourceServiceException if the undeployment failed.
105: */
106: public void removeRar(String fileName) throws RemoteException,
107: ResourceServiceException;
108:
109: /**
110: * UnDeploy a given war file with the help of the web container service.
111: * @param fileName the name of the war file.
112: * @throws RemoteException if rmi call failed.
113: * @throws JWebContainerServiceException if the undeployment failed.
114: */
115: public void removeWar(String fileName) throws RemoteException,
116: JWebContainerServiceException;
117:
118: /**
119: * Test if the specified filename is already deployed or not
120: * @param fileName the name of the ear file.
121: * @return true if the ear is deployed, else false.
122: * @throws RemoteException if rmi call failed.
123: */
124: boolean isEarLoaded(String fileName) throws RemoteException,
125: EarServiceException;
126:
127: /**
128: * Test if the specified filename is already deployed or not
129: * @param fileName the name of the rar file.
130: * @return true if the rar is deployed, else false.
131: * @throws RemoteException if rmi call failed.
132: */
133: boolean isRarLoaded(String fileName) throws RemoteException,
134: ResourceServiceException;
135:
136: /**
137: * Test if the specified filename is already deployed or not
138: * @param fileName the name of the war file.
139: * @return true if the war is deployed, else false.
140: * @throws RemoteException if rmi call failed.
141: */
142: boolean isWarLoaded(String fileName) throws RemoteException,
143: JWebContainerServiceException;
144:
145: void addBeans(String fileName) throws RemoteException;
146:
147: void removeBeans(String fileName) throws RemoteException;
148:
149: boolean isLoaded(String fileName) throws RemoteException;
150:
151: String[] listBeans() throws RemoteException;
152:
153: String dumpCustom() throws RemoteException;
154:
155: Vector listContext() throws RemoteException;
156:
157: Properties listEnv() throws RemoteException;
158:
159: void stopServer() throws RemoteException;
160:
161: void killServer() throws RemoteException;
162:
163: boolean isEJBContainer() throws RemoteException;
164:
165: int getServerState() throws RemoteException;
166:
167: void setTransactionTimeout(int timeout) throws RemoteException;
168:
169: void runGC() throws RemoteException;
170:
171: void syncAllEntities(boolean passivate) throws RemoteException;
172:
173: String[] getTopics() throws RemoteException;
174:
175: String getTopicLevel(String topic) throws RemoteException;
176:
177: void setTopicLevel(String topic, String l) throws RemoteException;
178:
179: void deployFileOn(String filename, String[] target)
180: throws RemoteException;
181:
182: void stopRemoteServers(String[] target) throws RemoteException;
183:
184: void startRemoteServers(String[] target) throws RemoteException;
185:
186: /**
187: * Deploy file (GenIC), needed for Ishmael to work.
188: * @param type type of the file (EJB, WAR, EAR, RAR, CAR)
189: * @param file the actual file
190: * @param filename basename of the file to be deployed
191: * @throws RemoteException
192: * @throws EarServiceException
193: * @throws ResourceServiceException
194: * @throws JWebContainerServiceException
195: * @author Dean Jennings. <deanjennings@junta.com.au>
196: */
197: String deployFile(int type, byte[] file, String filename)
198: throws RemoteException, EarServiceException,
199: ResourceServiceException, JWebContainerServiceException;
200:
201: /**
202: * List modules, needed for Ishmael to work. Currently only lists top
203: * level modules. It does need to do sub elements of ears in the future.
204: * @param type type of the file (EJB, WAR, EAR, RAR, CAR)
205: * @param state status of the modules to be returned
206: * (RUNNING, STOPPED, ALL)
207: * @throws RemoteException
208: * @author Dean Jennings. <deanjennings@junta.com.au>
209: */
210: List listModules(int type, int state) throws RemoteException;
211:
212: /**
213: * Physically remove the module from the server
214: * @param filename the filename of the module to be removed
215: * @throws RemoteException
216: * @author Dean Jennings. <deanjennings@junta.com.au>
217: *
218: */
219: public void undeployFile(String filename) throws RemoteException;
220: }
|