Home | History | Annotate | Download | only in ddms
      1 /*
      2  * Copyright (C) 2010 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package com.android.ide.eclipse.ddms;
     18 
     19 /**
     20  * Classes which implement this interface provides a way to connect a debugger to a VM running
     21  * on a connected device.
     22  */
     23 public interface IDebuggerConnector {
     24     /**
     25      * Is this application from a project present in the workspace?
     26      * @param appName name of the application. This is typically the application's package, but
     27      * can be different if the component was setup to run in its own process.
     28      * @return true if there is a project in the workspace containing the given app.
     29      */
     30     boolean isWorkspaceApp(String appName);
     31 
     32     /**
     33      * Connects a debugger to a VM identified by its appName.
     34      * <p/>
     35      * The given port is tied to the application and should be used if possible. However the
     36      * "selected" port can also be used if needed.
     37      * @param appName the name of the application. Usually the application's package but this
     38      * can be different if the component was setup to run in it's own process.
     39      * @param appPort the preferred connection port.
     40      * @param selectedPort the port value for the selected application
     41      * @return true if success.
     42      */
     43     boolean connectDebugger(String appName, int appPort, int selectedPort);
     44 
     45 }
     46