1
/*___INFO__MARK_BEGIN__*/
2
/*************************************************************************
4
* The Contents of this file are made available subject to the terms of
5
* the Sun Industry Standards Source License Version 1.2
7
* Sun Microsystems Inc., March, 2001
10
* Sun Industry Standards Source License Version 1.2
11
* =================================================
12
* The contents of this file are subject to the Sun Industry Standards
13
* Source License Version 1.2 (the "License"); You may not use this file
14
* except in compliance with the License. You may obtain a copy of the
15
* License at http://gridengine.sunsource.net/Gridengine_SISSL_license.html
17
* Software provided under this License is provided on an "AS IS" basis,
18
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
19
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
20
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
21
* See the License for the specific provisions governing your rights and
22
* obligations concerning the Software.
24
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
26
* Copyright: 2001 by Sun Microsystems, Inc.
28
* All Rights Reserved.
30
************************************************************************/
31
/*___INFO__MARK_END__*/
32
package com.sun.grid.jgdi.rmi;
34
import com.sun.grid.jgdi.monitoring.ClusterQueueSummaryOptions;
35
import com.sun.grid.jgdi.monitoring.QHostOptions;
36
import com.sun.grid.jgdi.monitoring.QHostResult;
37
import com.sun.grid.jgdi.monitoring.QQuotaOptions;
38
import com.sun.grid.jgdi.monitoring.QQuotaResult;
39
import com.sun.grid.jgdi.monitoring.QueueInstanceSummaryOptions;
40
import com.sun.grid.jgdi.monitoring.QueueInstanceSummaryResult;
42
import java.rmi.RemoteException;
43
import java.util.ArrayList;
44
import java.util.Collections;
45
import java.util.List;
46
import java.util.logging.Logger;
52
public class JGDIRemoteCacheBase implements JGDIRemoteBase {
54
protected JGDIRemote jgdi;
55
protected Logger logger = Logger.getLogger("com.sun.grid.jgdi.rmi");
56
private List listeners = Collections.synchronizedList(new ArrayList());
58
/** Creates a new instance of JGDIRemoteCacheBase */
59
public JGDIRemoteCacheBase() {
62
public JGDIRemoteCacheBase(JGDIRemote jgdi) {
66
public void addJGDIRemoteCacheListener(JGDIRemoteCacheListener lis) {
70
public void removeJGDIRemoteCacheListener(JGDIRemoteCacheListener lis) {
71
listeners.remove(lis);
74
public void setJGDI(JGDIRemote jgdi) {
78
public JGDIRemote getJGDI() {
82
public void close() throws RemoteException {
89
private boolean actQMasterNotSet = true;
90
private String actQMaster;
92
private RemoteException error;
94
private RemoteException getError() {
98
protected void handleError(RemoteException re) {
101
} catch( RemoteException e) {
104
Object [] lis = listeners.toArray();
106
for(int i = 0; i < lis.length; i++ ) {
107
((JGDIRemoteCacheListener)lis[i]).errorOccured(this,re);
113
public void clearError() {
117
public String getActQMaster() {
118
if(actQMasterNotSet) {
121
actQMaster = jgdi.getActQMaster();
122
} catch(RemoteException re) {
127
actQMasterNotSet = false;
132
private boolean actAdminUserNotSet = true;
133
private String adminUser;
135
public String getAdminUser() {
136
if(actAdminUserNotSet) {
139
adminUser = jgdi.getAdminUser();
140
} catch( RemoteException re ) {
145
actAdminUserNotSet = false;
150
private boolean qhostResultNotSet = true;
151
private QHostResult qhostResult;
153
public QHostResult execQHost(QHostOptions options) throws RemoteException {
154
if(qhostResultNotSet) {
157
qhostResult = jgdi.execQHost(options);
158
} catch( RemoteException re ) {
163
qhostResultNotSet = false;
168
private boolean SGERootNotSet = true;
169
private File SGERoot;
171
public File getSGERoot() throws RemoteException {
175
SGERoot = jgdi.getSGERoot();
176
} catch( RemoteException re ) {
181
SGERootNotSet = false;
186
private boolean SGECellNotSet = true;
187
private String SGECell;
189
public String getSGECell() throws RemoteException {
193
SGECell = jgdi.getSGECell();
194
} catch( RemoteException re ) {
199
SGECellNotSet = false;
204
private boolean RealExecHostListNotSet = true;
205
private List RealExecHostList;
207
public List getRealExecHostList() throws RemoteException {
208
if(RealExecHostListNotSet) {
211
RealExecHostList = jgdi.getRealExecHostList();
212
} catch( RemoteException re ) {
217
RealExecHostListNotSet = false;
219
return RealExecHostList;
222
public List getClusterQueueSummary(ClusterQueueSummaryOptions options) throws RemoteException {
226
public QueueInstanceSummaryResult getQueueInstanceSummary(QueueInstanceSummaryOptions options) throws RemoteException {
230
public QQuotaResult getQQuota(QQuotaOptions options) throws RemoteException {
234
public void clearShareTreeUsage() throws RemoteException {
237
public void cleanQueues(String[] queues) throws RemoteException {
240
public void killMaster() throws RemoteException {
243
public void killScheduler() throws RemoteException {
246
public void killExecd(String[] hosts, boolean terminateJobs) throws RemoteException {
249
public void killAllExecds(boolean terminateJobs) throws RemoteException {
252
public void killEventClients(int[] ids) throws RemoteException {
255
public void killAllEventClients() throws RemoteException {
258
public void triggerSchedulerMonitoring() throws RemoteException {
261
public String getSchedulerHost() throws RemoteException {
265
public void enableQueues(String[] queues, boolean force) throws RemoteException {
268
public void disableQueues(String[] queues, boolean force) throws RemoteException {
271
public void suspendQueues(String[] queues, boolean force) throws RemoteException {
274
public void suspendJobs(String[] jobs, boolean force) throws RemoteException {
277
public void unsuspendQueues(String[] queues, boolean force) throws RemoteException {
280
public void unsuspendJobs(String[] jobs, boolean force) throws RemoteException {
283
public void clearQueues(String[] queues, boolean force) throws RemoteException {
286
public void clearJobs(String[] jobs, boolean force) throws RemoteException {
289
public void rescheduleQueues(String[] queues, boolean force) throws RemoteException {
292
public void rescheduleJobs(String[] jobs, boolean force) throws RemoteException {