001: /*
002: * Copyright 2006 Google Inc.
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
005: * use this file except in compliance with the License. You may obtain a copy of
006: * the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
012: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
013: * License for the specific language governing permissions and limitations under
014: * the License.
015: */
016: /*
017: * ChainBuilder ESB
018: * Visual Enterprise Integration
019: *
020: * Copyright (C) 2006 Bostech Corporation
021: *
022: * This program is free software; you can redistribute it and/or modify it
023: * under the terms of the GNU General Public License as published by the
024: * Free Software Foundation; either version 2 of the License, or (at your option)
025: * any later version.
026: *
027: * This program is distributed in the hope that it will be useful,
028: * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
029: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
030: * for more details.
031: *
032: * You should have received a copy of the GNU General Public License along with
033: * this program; if not, write to the Free Software Foundation, Inc.,
034: * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
035: *
036: *
037: * $Id$
038: */
039: package com.bostechcorp.cbesb.console.client;
040:
041: import com.bostechcorp.cbesb.console.common.Constants;
042: import com.bostechcorp.cbesb.console.rpc.JmxOperation;
043: import com.bostechcorp.cbesb.console.rpc.JmxOperationAsync;
044: import com.google.gwt.core.client.GWT;
045: import com.google.gwt.user.client.rpc.ServiceDefTarget;
046: import com.google.gwt.user.client.ui.Composite;
047:
048: public abstract class Admin extends Composite implements
049: ICallbackHandler {
050:
051: abstract public void onHide();
052:
053: abstract public void onShow();
054:
055: abstract public void refresh();
056:
057: //protected WaitingDialog waiting =null;
058:
059: protected Admin this Admin = this ;
060:
061: public JmxOperationAsync jmxOp = null;
062:
063: public JmxOperationAsync getJmxOperationAsyncFromModule() {
064: if (jmxOp == null) {
065: jmxOp = (JmxOperationAsync) GWT.create(JmxOperation.class);
066: ServiceDefTarget jmxConnectTarget = (ServiceDefTarget) jmxOp;
067: String relativeUrl = GWT.getModuleBaseURL()
068: + Constants.JMX_CLIENT_SERVLET;
069: jmxConnectTarget.setServiceEntryPoint(relativeUrl);
070: }
071: return jmxOp;
072: }
073:
074: public Admin() {
075: super ();
076: // this.waiting= new WaitingDialog();
077: }
078:
079: protected void refreshImport() {
080:
081: }
082:
083: protected void createWidget() {
084: };
085:
086: // public void handleFailure(Throwable caught) {
087: // if (!ClientUtils.checkTimeOut(caught)) {
088: // if(caught instanceof ServerSideException){
089: //
090: // handleFailure(ExceptionUtil.stackTextString(caught),
091: // ((ServerSideException)caught).toString());
092: // }
093: // else handleFailure(ExceptionUtil.stackTextString(caught),
094: // ExceptionUtil.stackTraceString(caught));
095: // }
096: //
097: // }
098: //
099: // public void handleFailure(String exceptionText,String exceptionTrace) {
100: //
101: // MessageViewDialog.showError(exceptionText,
102: // exceptionTrace);
103: //
104: // }
105:
106: // public void closeWaitingDialog(){
107: //
108: // waiting.close();
109: // }
110:
111: public void showWaitingDialog() {
112: Console.instance.waiting.show();
113: }
114:
115: public void hideWaitingDialog() {
116:
117: Console.instance.waiting.close();
118: }
119: }
|