Skip to main content
summaryrefslogtreecommitdiffstats
blob: 95a2ca5afed6a7ac67cb686a44e633c63685de6a (plain) (blame)
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/*******************************************************************************
 * Copyright (c) 2008, 2009 Wind River Systems and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *     Wind River Systems - initial API and implementation
 *     Nokia - create and use backend service. 
 *******************************************************************************/
package org.eclipse.cdt.dsf.mi.service;

import java.io.InputStream;
import java.io.OutputStream;

import org.eclipse.cdt.dsf.concurrent.Immutable;
import org.eclipse.cdt.dsf.service.IDsfService;

/**
 * Service for controlling the back end process.
 * @since 1.1
 */
public interface IMIBackend extends IDsfService {

    public enum State { NOT_INITIALIZED, STARTED, TERMINATED };

	/**
	 * Event indicating that the back end process has started or terminated.
	 */
    @Immutable
    public static class BackendStateChangedEvent {
        final private String fSessionId;
        final private String fBackendId;
        final private State fState;
        
        public BackendStateChangedEvent(String sessionId, String backendId, State state) {
            fSessionId = sessionId;
            fBackendId = backendId;
            fState = state;
        }
        
        public String getSessionId() {
            return fSessionId;
        }
        
        public String getBackendId() {
            return fBackendId;
        }
        
        public State getState() {
            return fState;
        }
    }

    /**
     * Returns the identifier of this backend service.  It can be used 
     * to distinguish between multiple instances of this service in a 
     * single session.   
     */
    public String getId();
    
    /**
     * Requests that the backend be immediately terminated.
     */
    public void destroy();

    /**
     * Returns the current state of the backed.
     * @return
     */
    public State getState();

    /**
     * Returns the exit code of the backend.  Returns <code>-1</code> if 
     * the backend exit code is not available.
     * @return
     */
    public int getExitCode();

    /**
     * Returns the backend command stream. 
     */
    public InputStream getMIInputStream();

    /**
     * Returns the backend result and event stream.
     * @return
     */
    public OutputStream getMIOutputStream();
}

Back to the top