KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > admin > servermgmt > InstancesManager


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 package com.sun.enterprise.admin.servermgmt;
25
26 import java.util.Map JavaDoc;
27
28 /**
29  */

30 public interface InstancesManager
31 {
32     /**
33      * Creates a server instance.
34      * @throws InstanceException This exception is thrown if
35      * - the instance already exists.
36      * - an invalid or insufficient config. is supplied.
37      * - an exception occurred during instance creation.
38      */

39     public void createInstance()
40         throws InstanceException;
41
42     /**
43      * Deletes an instance identified by the given name.
44      * (Should we stop the instance before deleting the instance?)
45      * @throws InstanceException This exception is thrown if
46      * - the instance doesnot exist.
47      * - an exception occurred while deleting the instance.
48      */

49     public void deleteInstance()
50         throws InstanceException;
51
52     /**
53      * Starts the instance.
54      * @param startParams
55      * @throws InstanceException
56      */

57     public Process JavaDoc startInstance()
58         throws InstanceException;
59
60     /**
61      * Starts the instance.
62      * @param interativeOptions which may be used for security, these paramters
63      * are passed in on the standard input stream of the executing process
64      * @throws InstanceException
65      */

66     public Process JavaDoc startInstance(String JavaDoc[] interativeOptions)
67         throws InstanceException;
68
69     /**
70      * Starts the instance.
71      * @param interativeOptions which may be used for security, these paramters
72      * are passed in on the standard input stream of the executing process
73      * @param commandLineArgs is additional commandline arguments that are to be appended
74      * to the processes commandline when it starts
75      * @throws InstanceException
76      */

77     public Process JavaDoc startInstance(String JavaDoc[] interativeOptions, String JavaDoc[] commandLineArgs)
78         throws InstanceException;
79     
80     /**
81      * Stops the instance.
82      * @throws InstanceException
83      */

84     public void stopInstance()
85         throws InstanceException;
86
87     /**
88      * Lists all the instances.
89      */

90     public String JavaDoc[] listInstances()
91         throws InstanceException;
92
93     /**
94      * Returns status of an instance.
95      */

96     public int getInstanceStatus()
97         throws InstanceException;
98
99     /**
100      * @return true if the instance requires a restart for some config changes
101      * to take effect, false otherwise.
102      */

103     boolean isRestartNeeded() throws InstanceException;
104 }
105
Popular Tags