ludc
2024-09-14 36c2449aec5b51e5ed4e5c6841154b746060e09a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package com.vci.client.oq;
 
import javax.swing.JPanel;
 
import com.vci.client.common.providers.ServiceProvider;
import com.vci.client.oq.ui.QTPanel;
import com.vci.client.ui.frame.UIConstructorInterface;
import com.vci.corba.common.VCIError;
import com.vci.corba.query.ObjectQueryServicePrx;
 
public class QTClient implements UIConstructorInterface{
    private static ObjectQueryServicePrx qtService = null;
    private static QTClient qtClient = null;
    
    private static QTClient getInstance(){
        if(qtClient == null){
            qtClient = new QTClient();
        }
        return qtClient;
    }
 
 
    @Override
    public void destory() throws VCIError {
        // TODO Auto-generated method stub
        
    }
 
    @Override
    public void init() throws VCIError {
        if(qtService != null){
            return;
        }
        try {
            qtService = ServiceProvider.getOQService();
        } catch (Exception e) {
            e.printStackTrace();
            throw new VCIError("", new String[0]);
        }
    }
 
    @Override
    public JPanel start() throws VCIError {
        QTPanel.cleanInstance();
        QTPanel qtPanel = QTPanel.getInstance();
        return qtPanel;
    }
 
    public static ObjectQueryServicePrx getService() throws VCIError{
        if(qtService == null){
            try {
                QTClient.getInstance().init();
            } catch (VCIError e) {
                e.printStackTrace();
                throw new VCIError("", new String[0]);
            }
        }
        return qtService;
    }
}