diff -u -N -r ../../HG_FRESH/main/api.debugger/apichanges.xml api.debugger/apichanges.xml --- ../../HG_FRESH/main/api.debugger/apichanges.xml 2008-08-20 02:00:43.000000000 +0200 +++ api.debugger/apichanges.xml 2009-01-25 17:37:11.000000000 +0100 @@ -278,6 +278,41 @@ + + + Lookup improvements and service annotation registration. + + + + + +

+ In order to be able to register debugger services on System FileSystem, + which brings more flexibility and better performance (see also + ), + we add non-recursive content of org.openide.util.Lookups.forPath() + into debugger lookup. + Since debugger needs retrieve context-aware services from the lookup, + ContextAwareService interface is introduced. +

+

+ Annotations are added for easy registration on module layers. + DebuggerServiceRegistration to register implementations + of interfaces, *Provider.Registration to register + implementations of appropriate providers. +

+
+ + + + + + + + + +
+ diff -u -N -r ../../HG_FRESH/main/api.debugger/manifest.mf api.debugger/manifest.mf --- ../../HG_FRESH/main/api.debugger/manifest.mf 2008-11-18 20:59:37.000000000 +0100 +++ api.debugger/manifest.mf 2009-01-25 16:50:25.000000000 +0100 @@ -1,5 +1,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.api.debugger/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/api/debugger/Bundle.properties -OpenIDE-Module-Specification-Version: 1.15 - +OpenIDE-Module-Specification-Version: 1.16 diff -u -N -r ../../HG_FRESH/main/api.debugger/nbproject/project.properties api.debugger/nbproject/project.properties --- ../../HG_FRESH/main/api.debugger/nbproject/project.properties 2008-08-20 02:00:44.000000000 +0200 +++ api.debugger/nbproject/project.properties 2009-01-23 22:00:37.000000000 +0100 @@ -42,3 +42,4 @@ javac.source=1.5 javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml +cp.extra=${nb_all}/apisupport.harness/external/openjdk-javac-6-b12.jar diff -u -N -r ../../HG_FRESH/main/api.debugger/src/org/netbeans/api/debugger/LazyActionsManagerListener.java api.debugger/src/org/netbeans/api/debugger/LazyActionsManagerListener.java --- ../../HG_FRESH/main/api.debugger/src/org/netbeans/api/debugger/LazyActionsManagerListener.java 2008-08-20 02:00:44.000000000 +0200 +++ api.debugger/src/org/netbeans/api/debugger/LazyActionsManagerListener.java 2009-01-25 16:56:12.000000000 +0100 @@ -41,15 +41,28 @@ package org.netbeans.api.debugger; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.util.Map; + +import org.netbeans.debugger.registry.ContextAwareServiceHandler; +import org.netbeans.spi.debugger.ContextAwareSupport; +import org.netbeans.spi.debugger.ContextAwareService; +import org.netbeans.spi.debugger.ContextProvider; + /** * This {@link ActionsManagerListener} modification is designed to be - * registerred in "META-INF/debugger/". + * registerred in "META-INF/debugger/", or preferrably via the + * {@link Registration} annotation. * LazyActionsManagerListener should be registerred for some concrete - * {@link DebuggerEngine} (use - * "META-INF/debugger//LazyActionsManagerListener"), or - * for global {@link ActionsManager} (use - * "META-INF/debugger/LazyActionsManagerListener"). + * {@link DebuggerEngine} - use "" as a path of the + * annotation, or create + * "META-INF/debugger//LazyActionsManagerListener" file. + * For global {@link ActionsManager} (do not use the path parameter, or use + * "META-INF/debugger/LazyActionsManagerListener" file. * New instance of LazyActionsManagerListener implementation is loaded * when the new instance of {@link ActionsManager} is created, and its registerred * automatically to all properties returned by {@link #getProperties}. @@ -70,4 +83,59 @@ * @return list of properties this listener is listening on */ public abstract String[] getProperties (); + + /** + * Declarative registration of a LazyActionsManagerListener implementation. + * By marking the implementation class with this annotation, + * you automatically register that implementation for use by debugger. + * The class must be public and have a public constructor which takes + * no arguments or takes {@link ContextProvider} as an argument. + * @since 1.16 + */ + @Retention(RetentionPolicy.SOURCE) + @Target({ElementType.TYPE}) + public @interface Registration { + /** + * An optional path to register this implementation in. + * Usually the "". + */ + String path() default ""; + + } + } diff -u -N -r ../../HG_FRESH/main/api.debugger/src/org/netbeans/spi/debugger/ActionsProvider.java api.debugger/src/org/netbeans/spi/debugger/ActionsProvider.java --- ../../HG_FRESH/main/api.debugger/src/org/netbeans/spi/debugger/ActionsProvider.java 2008-08-20 02:00:44.000000000 +0200 +++ api.debugger/src/org/netbeans/spi/debugger/ActionsProvider.java 2009-01-25 16:58:49.000000000 +0100 @@ -41,7 +41,14 @@ package org.netbeans.spi.debugger; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.util.Map; import java.util.Set; +import org.netbeans.debugger.registry.ContextAwareServiceHandler; +import org.netbeans.spi.debugger.ContextAwareSupport; import org.openide.util.RequestProcessor; /** @@ -109,6 +116,98 @@ } }); } + + /** + * Declarative registration of an ActionsProvider implementation. + * By marking the implementation class with this annotation, + * you automatically register that implementation for use by debugger. + * The class must be public and have a public constructor which takes + * no arguments or takes {@link ContextProvider} as an argument. + * @since 1.16 + */ + @Retention(RetentionPolicy.SOURCE) + @Target({ElementType.TYPE}) + public @interface Registration { + /** + * An optional path to register this implementation in. + */ + String path() default ""; + + } + } diff -u -N -r ../../HG_FRESH/main/api.debugger/src/org/netbeans/spi/debugger/DebuggerEngineProvider.java api.debugger/src/org/netbeans/spi/debugger/DebuggerEngineProvider.java --- ../../HG_FRESH/main/api.debugger/src/org/netbeans/spi/debugger/DebuggerEngineProvider.java 2008-08-20 02:00:44.000000000 +0200 +++ api.debugger/src/org/netbeans/spi/debugger/DebuggerEngineProvider.java 2009-01-25 17:00:15.000000000 +0100 @@ -41,7 +41,15 @@ package org.netbeans.spi.debugger; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.util.Map; + import org.netbeans.api.debugger.DebuggerEngine; +import org.netbeans.debugger.registry.ContextAwareServiceHandler; +import org.netbeans.spi.debugger.ContextAwareSupport; /** * Creates a new instance of {@link org.netbeans.api.debugger.DebuggerEngine} @@ -88,5 +96,88 @@ * by this instance */ public abstract void setDestructor (DebuggerEngine.Destructor desctuctor); + + /** + * Declarative registration of an DebuggerEngineProvider implementation. + * By marking the implementation class with this annotation, + * you automatically register that implementation for use by debugger. + * The class must be public and have a public constructor which takes + * no arguments or takes {@link ContextProvider} as an argument. + * @since 1.16 + */ + @Retention(RetentionPolicy.SOURCE) + @Target({ElementType.TYPE}) + public @interface Registration { + /** + * An optional path to register this implementation in. + */ + String path() default ""; + + } + } diff -u -N -r ../../HG_FRESH/main/api.debugger/src/org/netbeans/spi/debugger/DebuggerServiceRegistration.java api.debugger/src/org/netbeans/spi/debugger/DebuggerServiceRegistration.java --- ../../HG_FRESH/main/api.debugger/src/org/netbeans/spi/debugger/DebuggerServiceRegistration.java 1970-01-01 01:00:00.000000000 +0100 +++ api.debugger/src/org/netbeans/spi/debugger/DebuggerServiceRegistration.java 2009-01-25 16:50:41.000000000 +0100 @@ -0,0 +1,72 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + * + * Contributor(s): + * + * Portions Copyrighted 2009 Sun Microsystems, Inc. + */ + +package org.netbeans.spi.debugger; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Declarative registration of debugger service provider implementing a set + * of interfaces. + * By marking an implementation class with this annotation, + * you automatically register that implementation for use by debugger. + * The class must be public and have a public constructor which takes + * no arguments or takes {@link ContextProvider} as an argument. + * @since 1.16 + * + * @author Martin Entlicher + */ +@Retention(RetentionPolicy.SOURCE) +@Target({ElementType.TYPE}) +public @interface DebuggerServiceRegistration { + + /** + * An optional path to register this implementation in. + * Usually the session ID. + */ + String path() default ""; + + /** + * The list of interfaces that this class implements and wish to register for. + */ + Class[] types(); +} diff -u -N -r ../../HG_FRESH/main/api.debugger/src/org/netbeans/spi/debugger/SessionProvider.java api.debugger/src/org/netbeans/spi/debugger/SessionProvider.java --- ../../HG_FRESH/main/api.debugger/src/org/netbeans/spi/debugger/SessionProvider.java 2008-08-20 02:00:44.000000000 +0200 +++ api.debugger/src/org/netbeans/spi/debugger/SessionProvider.java 2009-01-25 17:00:57.000000000 +0100 @@ -41,6 +41,15 @@ package org.netbeans.spi.debugger; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.util.Map; + +import org.netbeans.debugger.registry.ContextAwareServiceHandler; +import org.netbeans.spi.debugger.ContextAwareSupport; + /** * Creates a new instance of {@link org.netbeans.api.debugger.Session} * for some {@link org.netbeans.api.debugger.DebuggerInfo}. @@ -80,5 +89,87 @@ * @return array of services */ public abstract Object[] getServices (); + + /** + * Declarative registration of an SessionProvider implementation. + * By marking the implementation class with this annotation, + * you automatically register that implementation for use by debugger. + * The class must be public and have a public constructor which takes + * no arguments or takes {@link ContextProvider} as an argument. + * @since 1.16 + */ + @Retention(RetentionPolicy.SOURCE) + @Target({ElementType.TYPE}) + public @interface Registration { + /** + * An optional path to register this implementation in. + */ + String path() default ""; + + } + } diff -u -N -r ../../HG_FRESH/main/spi.debugger.ui/manifest.mf spi.debugger.ui/manifest.mf --- ../../HG_FRESH/main/spi.debugger.ui/manifest.mf 2008-11-18 21:00:41.000000000 +0100 +++ spi.debugger.ui/manifest.mf 2009-01-25 17:38:02.000000000 +0100 @@ -2,6 +2,6 @@ OpenIDE-Module: org.netbeans.spi.debugger.ui/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/debugger/ui/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/debugger/resources/mf-layer.xml -OpenIDE-Module-Specification-Version: 2.15 +OpenIDE-Module-Specification-Version: 2.16 OpenIDE-Module-Provides: org.netbeans.spi.debugger.ui OpenIDE-Module-Install: org/netbeans/modules/debugger/ui/DebuggerModule.class diff -u -N -r ../../HG_FRESH/main/spi.debugger.ui/nbproject/project.properties spi.debugger.ui/nbproject/project.properties --- ../../HG_FRESH/main/spi.debugger.ui/nbproject/project.properties 2009-01-20 14:20:18.000000000 +0100 +++ spi.debugger.ui/nbproject/project.properties 2009-01-23 22:00:54.000000000 +0100 @@ -41,6 +41,6 @@ test.config.stable.includes=**/ts/*TestSuite.class +cp.extra=${nb_all}/apisupport.harness/external/openjdk-javac-6-b12.jar diff -u -N -r ../../HG_FRESH/main/spi.debugger.ui/nbproject/project.xml spi.debugger.ui/nbproject/project.xml --- ../../HG_FRESH/main/spi.debugger.ui/nbproject/project.xml 2008-09-29 16:42:38.000000000 +0200 +++ spi.debugger.ui/nbproject/project.xml 2009-01-25 17:38:19.000000000 +0100 @@ -52,7 +52,7 @@ 1 - 1.13 + 1.16 diff -u -N -r ../../HG_FRESH/main/spi.debugger.ui/src/org/netbeans/spi/debugger/ui/AttachType.java spi.debugger.ui/src/org/netbeans/spi/debugger/ui/AttachType.java --- ../../HG_FRESH/main/spi.debugger.ui/src/org/netbeans/spi/debugger/ui/AttachType.java 2008-09-23 09:44:26.000000000 +0200 +++ spi.debugger.ui/src/org/netbeans/spi/debugger/ui/AttachType.java 2009-01-25 13:34:37.000000000 +0100 @@ -41,8 +41,18 @@ package org.netbeans.spi.debugger.ui; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.util.Map; import javax.swing.JComponent; +import org.netbeans.modules.debugger.ui.registry.DebuggerProcessor; +import org.netbeans.spi.debugger.ContextAwareService; +import org.netbeans.spi.debugger.ContextAwareSupport; +import org.netbeans.spi.debugger.ContextProvider; + /** * Support for "Attach ..." dialog. Represents one type of attaching. @@ -52,12 +62,13 @@ public abstract class AttachType { /** - * Provides display name of this Attach Type. Is used as one choice in - * ComboBox. + * TODO * * @return display name of this Attach Type */ - public abstract String getTypeDisplayName (); + public String getTypeDisplayName () { + return null; + } /** * Returns visual customizer for this Attach Type. Customizer can @@ -88,4 +99,75 @@ return null; } + @Retention(RetentionPolicy.SOURCE) + @Target({ElementType.TYPE}) + public @interface Registration { + String displayName(); + } + } \ No newline at end of file diff -u -N -r ../../HG_FRESH/main/spi.debugger.ui/src/org/netbeans/spi/debugger/ui/BreakpointType.java spi.debugger.ui/src/org/netbeans/spi/debugger/ui/BreakpointType.java --- ../../HG_FRESH/main/spi.debugger.ui/src/org/netbeans/spi/debugger/ui/BreakpointType.java 2008-09-23 09:44:26.000000000 +0200 +++ spi.debugger.ui/src/org/netbeans/spi/debugger/ui/BreakpointType.java 2009-01-25 13:34:05.000000000 +0100 @@ -41,8 +41,18 @@ package org.netbeans.spi.debugger.ui; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.util.Map; import javax.swing.JComponent; +import org.netbeans.modules.debugger.ui.registry.DebuggerProcessor; +import org.netbeans.spi.debugger.ContextAwareService; +import org.netbeans.spi.debugger.ContextAwareSupport; +import org.netbeans.spi.debugger.ContextProvider; + /** * Support for "New Breakpoint" dialog and Breakpoint Customizer. Represents * one breakpoint type. @@ -60,11 +70,13 @@ public abstract String getCategoryDisplayName (); /** - * Return display name of this breakpoint type (like "Line Breakppoint"). + * TODO * * @return display name of this breakpoint type */ - public abstract String getTypeDisplayName (); + public String getTypeDisplayName () { + return null; + } /** * Returns visual customizer for this breakpoint type. Customizer can @@ -103,4 +115,81 @@ * @return true of this breakpoint type should be default */ public abstract boolean isDefault (); + + @Retention(RetentionPolicy.SOURCE) + @Target({ElementType.TYPE}) + public @interface Registration { + String displayName(); + } + } \ No newline at end of file diff -u -N -r ../../HG_FRESH/main/spi.debugger.ui/src/org/netbeans/spi/debugger/ui/ColumnModelRegistration.java spi.debugger.ui/src/org/netbeans/spi/debugger/ui/ColumnModelRegistration.java --- ../../HG_FRESH/main/spi.debugger.ui/src/org/netbeans/spi/debugger/ui/ColumnModelRegistration.java 1970-01-01 01:00:00.000000000 +0100 +++ spi.debugger.ui/src/org/netbeans/spi/debugger/ui/ColumnModelRegistration.java 2009-01-25 17:51:24.000000000 +0100 @@ -0,0 +1,73 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + * + * Contributor(s): + * + * Portions Copyrighted 2009 Sun Microsystems, Inc. + */ + +package org.netbeans.spi.debugger.ui; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import org.netbeans.spi.debugger.ContextProvider; + +/** + * Declarative registration of a ColumnModel implementation. + * By marking the implementation class with this annotation, + * you automatically register that implementation for use by debugger. + * The class must be public and have a public constructor which takes + * no arguments or takes {@link ContextProvider} as an argument. + * + * @author Martin Entlicher + * @since 2.16 + */ +@Retention(RetentionPolicy.SOURCE) +@Target({ElementType.TYPE, ElementType.METHOD}) +public @interface ColumnModelRegistration { + + /** + * An optional path to register this implementation in. + */ + String path(); + + /** + * An optional position in which to register this service relative to others. + * Lower-numbered services are returned in the lookup result first. + * Services with no specified position are returned last. + */ + int position() default Integer.MAX_VALUE; +} diff -u -N -r ../../HG_FRESH/main/api.debugger.jpda/apichanges.xml api.debugger.jpda/apichanges.xml --- ../../HG_FRESH/main/api.debugger.jpda/apichanges.xml 2009-01-13 21:39:21.000000000 +0100 +++ api.debugger.jpda/apichanges.xml 2009-01-25 18:28:48.000000000 +0100 @@ -710,6 +710,39 @@ + + + Annotations for debugger service registration. + + + + + +

+ In order to be able to register debugger services on System FileSystem, + which brings more flexibility and better performance (see also + ), + we add non-recursive content of org.openide.util.Lookups.forPath() + into debugger lookup. + Since debugger needs retrieve context-aware services from the lookup, + ContextAwareService interface is introduced. +

+

+ Annotations are added for easy registration on module layers. + DebuggerServiceRegistration to register implementations + of interfaces, *Provider.Registration to register + implementations of appropriate providers. +

+ + + + + + + + + + diff -u -N -r ../../HG_FRESH/main/api.debugger.jpda/manifest.mf api.debugger.jpda/manifest.mf --- ../../HG_FRESH/main/api.debugger.jpda/manifest.mf 2009-01-13 21:39:21.000000000 +0100 +++ api.debugger.jpda/manifest.mf 2009-01-25 17:39:28.000000000 +0100 @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.api.debugger.jpda/2 OpenIDE-Module-Localizing-Bundle: org/netbeans/api/debugger/jpda/Bundle.properties -OpenIDE-Module-Specification-Version: 2.18 +OpenIDE-Module-Specification-Version: 2.19 OpenIDE-Module-Package-Dependencies: com.sun.jdi[VirtualMachineManager] diff -u -N -r ../../HG_FRESH/main/api.debugger.jpda/nbproject/project.properties api.debugger.jpda/nbproject/project.properties --- ../../HG_FRESH/main/api.debugger.jpda/nbproject/project.properties 2008-08-20 02:00:43.000000000 +0200 +++ api.debugger.jpda/nbproject/project.properties 2009-01-23 22:42:21.000000000 +0100 @@ -38,7 +38,7 @@ # made subject to such option by the copyright holder. is.autoload=true -cp.extra=${tools.jar} +cp.extra=${tools.jar}:${nb_all}/apisupport.harness/external/openjdk-javac-6-b12.jar javac.compilerargs=-Xlint:unchecked javac.source=1.5 javadoc.arch=${basedir}/arch.xml diff -u -N -r ../../HG_FRESH/main/api.debugger.jpda/nbproject/project.xml api.debugger.jpda/nbproject/project.xml --- ../../HG_FRESH/main/api.debugger.jpda/nbproject/project.xml 2008-08-20 02:00:43.000000000 +0200 +++ api.debugger.jpda/nbproject/project.xml 2009-01-25 17:39:54.000000000 +0100 @@ -52,6 +52,7 @@ 1 + 1.16 diff -u -N -r ../../HG_FRESH/main/api.debugger.jpda/src/org/netbeans/api/debugger/jpda/JPDADebugger.java api.debugger.jpda/src/org/netbeans/api/debugger/jpda/JPDADebugger.java --- ../../HG_FRESH/main/api.debugger.jpda/src/org/netbeans/api/debugger/jpda/JPDADebugger.java 2008-08-20 02:00:43.000000000 +0200 +++ api.debugger.jpda/src/org/netbeans/api/debugger/jpda/JPDADebugger.java 2009-01-25 18:22:32.000000000 +0100 @@ -41,27 +41,29 @@ package org.netbeans.api.debugger.jpda; -import com.sun.jdi.Bootstrap; import com.sun.jdi.VirtualMachine; -import com.sun.jdi.connect.AttachingConnector; import com.sun.jdi.connect.Connector.Argument; -import com.sun.jdi.connect.IllegalConnectorArgumentsException; import com.sun.jdi.connect.ListeningConnector; import com.sun.jdi.request.EventRequest; import java.beans.PropertyChangeListener; -import java.io.File; -import java.io.IOException; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; import java.util.Collections; -import java.util.Iterator; import java.util.List; import java.util.Map; + import org.netbeans.api.debugger.DebuggerEngine; import org.netbeans.api.debugger.DebuggerInfo; import org.netbeans.api.debugger.DebuggerManager; -import org.netbeans.api.debugger.jpda.InvalidExpressionException; -import org.netbeans.api.debugger.jpda.Variable; import org.netbeans.api.debugger.jpda.event.JPDABreakpointEvent; + +import org.netbeans.modules.debugger.jpda.apiregistry.DebuggerProcessor; +import org.netbeans.spi.debugger.ContextAwareService; +import org.netbeans.spi.debugger.ContextAwareSupport; +import org.netbeans.spi.debugger.ContextProvider; import org.openide.util.NbBundle; @@ -533,4 +535,127 @@ } */ + + /** + * Declarative registration of a JPDADebugger implementation. + * By marking the implementation class with this annotation, + * you automatically register that implementation for use by debugger. + * The class must be public and have a public constructor which takes + * no arguments or takes {@link ContextProvider} as an argument. + * + * @author Martin Entlicher + * @since 2.19 + */ + @Retention(RetentionPolicy.SOURCE) + @Target({ElementType.TYPE}) + public @interface Registration { + /** + * An optional path to register this implementation in. + * Usually the session ID. + */ + String path() default ""; + + } + } diff -u -N -r ../../HG_FRESH/main/api.debugger.jpda/src/org/netbeans/spi/debugger/jpda/EditorContext.java api.debugger.jpda/src/org/netbeans/spi/debugger/jpda/EditorContext.java --- ../../HG_FRESH/main/api.debugger.jpda/src/org/netbeans/spi/debugger/jpda/EditorContext.java 2008-08-20 02:00:43.000000000 +0200 +++ api.debugger.jpda/src/org/netbeans/spi/debugger/jpda/EditorContext.java 2009-01-25 18:22:25.000000000 +0100 @@ -41,11 +41,20 @@ package org.netbeans.spi.debugger.jpda; import java.beans.PropertyChangeListener; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; import java.util.ArrayList; import java.util.Collections; import java.util.List; +import java.util.Map; import org.netbeans.api.debugger.jpda.JPDAThread; import org.netbeans.api.debugger.jpda.Variable; +import org.netbeans.modules.debugger.jpda.apiregistry.DebuggerProcessor; +import org.netbeans.spi.debugger.ContextAwareService; +import org.netbeans.spi.debugger.ContextAwareSupport; +import org.netbeans.spi.debugger.ContextProvider; /** * Defines bridge to editor and src hierarchy. It allows to use different @@ -725,5 +734,158 @@ } + + /** + * Declarative registration of a EditorContext implementation. + * By marking the implementation class with this annotation, + * you automatically register that implementation for use by debugger. + * The class must be public and have a public constructor which takes + * no arguments or takes {@link ContextProvider} as an argument. + * + * @author Martin Entlicher + * @since 2.19 + */ + @Retention(RetentionPolicy.SOURCE) + @Target({ElementType.TYPE}) + public @interface Registration { + /** + * An optional path to register this implementation in. + * Usually the session ID. + */ + String path() default ""; + + } + } diff -u -N -r ../../HG_FRESH/main/api.debugger.jpda/src/org/netbeans/spi/debugger/jpda/SmartSteppingCallback.java api.debugger.jpda/src/org/netbeans/spi/debugger/jpda/SmartSteppingCallback.java --- ../../HG_FRESH/main/api.debugger.jpda/src/org/netbeans/spi/debugger/jpda/SmartSteppingCallback.java 2008-08-20 02:00:43.000000000 +0200 +++ api.debugger.jpda/src/org/netbeans/spi/debugger/jpda/SmartSteppingCallback.java 2009-01-25 18:22:20.000000000 +0100 @@ -41,9 +41,16 @@ package org.netbeans.spi.debugger.jpda; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.util.Map; import org.netbeans.api.debugger.jpda.JPDAThread; import org.netbeans.api.debugger.jpda.SmartSteppingFilter; -import org.netbeans.api.debugger.DebuggerEngine; +import org.netbeans.modules.debugger.jpda.apiregistry.DebuggerProcessor; +import org.netbeans.spi.debugger.ContextAwareService; +import org.netbeans.spi.debugger.ContextAwareSupport; import org.netbeans.spi.debugger.ContextProvider; /** @@ -74,5 +81,63 @@ * @return true if execution should be stopped on the current position */ public abstract boolean stopHere (ContextProvider lookupProvider, JPDAThread thread, SmartSteppingFilter f); + + + /** + * Declarative registration of a SmartSteppingCallback implementation. + * By marking the implementation class with this annotation, + * you automatically register that implementation for use by debugger. + * The class must be public and have a public constructor which takes + * no arguments or takes {@link ContextProvider} as an argument. + * + * @author Martin Entlicher + * @since 2.19 + */ + @Retention(RetentionPolicy.SOURCE) + @Target({ElementType.TYPE}) + public @interface Registration { + /** + * An optional path to register this implementation in. + */ + String path() default ""; + + } + } diff -u -N -r ../../HG_FRESH/main/api.debugger.jpda/src/org/netbeans/spi/debugger/jpda/SourcePathProvider.java api.debugger.jpda/src/org/netbeans/spi/debugger/jpda/SourcePathProvider.java --- ../../HG_FRESH/main/api.debugger.jpda/src/org/netbeans/spi/debugger/jpda/SourcePathProvider.java 2008-08-20 02:00:43.000000000 +0200 +++ api.debugger.jpda/src/org/netbeans/spi/debugger/jpda/SourcePathProvider.java 2009-01-25 18:22:15.000000000 +0100 @@ -41,8 +41,15 @@ package org.netbeans.spi.debugger.jpda; import java.beans.PropertyChangeListener; -import java.io.File; -import java.util.Set; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.util.Map; +import org.netbeans.modules.debugger.jpda.apiregistry.DebuggerProcessor; +import org.netbeans.spi.debugger.ContextAwareService; +import org.netbeans.spi.debugger.ContextAwareSupport; +import org.netbeans.spi.debugger.ContextProvider; /** * Defines source path for debugger. It translates relative path @@ -134,5 +141,87 @@ public abstract void removePropertyChangeListener ( PropertyChangeListener l ); + + + /** + * Declarative registration of a SourcePathProvider implementation. + * By marking the implementation class with this annotation, + * you automatically register that implementation for use by debugger. + * The class must be public and have a public constructor which takes + * no arguments or takes {@link ContextProvider} as an argument. + * + * @author Martin Entlicher + * @since 2.19 + */ + @Retention(RetentionPolicy.SOURCE) + @Target({ElementType.TYPE}) + public @interface Registration { + /** + * An optional path to register this implementation in. + */ + String path() default ""; + + } + } diff -u -N -r ../../HG_FRESH/main/api.debugger.jpda/src/org/netbeans/spi/debugger/jpda/VariablesFilter.java api.debugger.jpda/src/org/netbeans/spi/debugger/jpda/VariablesFilter.java --- ../../HG_FRESH/main/api.debugger.jpda/src/org/netbeans/spi/debugger/jpda/VariablesFilter.java 2008-08-20 02:00:43.000000000 +0200 +++ api.debugger.jpda/src/org/netbeans/spi/debugger/jpda/VariablesFilter.java 2009-01-25 18:22:09.000000000 +0100 @@ -41,8 +41,17 @@ package org.netbeans.spi.debugger.jpda; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.util.Map; import javax.swing.Action; import org.netbeans.api.debugger.jpda.Variable; +import org.netbeans.modules.debugger.jpda.apiregistry.DebuggerProcessor; +import org.netbeans.spi.debugger.ContextAwareService; +import org.netbeans.spi.debugger.ContextAwareSupport; +import org.netbeans.spi.debugger.ContextProvider; import org.netbeans.spi.viewmodel.NodeActionsProvider; import org.netbeans.spi.viewmodel.NodeModel; import org.netbeans.spi.viewmodel.TableModel; @@ -263,4 +272,117 @@ String columnID, Object value ) throws UnknownTypeException; + + + /** + * Declarative registration of a VariablesFilter implementation. + * By marking the implementation class with this annotation, + * you automatically register that implementation for use by debugger. + * The class must be public and have a public constructor which takes + * no arguments or takes {@link ContextProvider} as an argument. + * + * @author Martin Entlicher + * @since 2.19 + */ + @Retention(RetentionPolicy.SOURCE) + @Target({ElementType.TYPE}) + public @interface Registration { + /** + * An optional path to register this implementation in. + */ + String path() default ""; + + } + }