6. The Turnaround Cycle
Make
changes
AVG 2.5 min
Build,
Observe
deploy,
results
wait
7. Make changes
in IDE
ClassLoader
Framework
MyObject.class
Code
101000101
New code
JRebel
100010010
111000100
101010010
MyObject
Configuration
(XML, annotations,..)
19. JVM arguments
• JRebel is bootstrapped using JVM arguments:
-javaagent:/path/to/jrebel.jar
-noverify -Xbootclasspath/p:jrebel-bootstrap.jar;jrebel.jar
-Drebel.log=true -Drebel.jersey_plugin=true
• Various NetBeans project types pass JVM
arguments slightly differently:
Web project VS Maven project
JBoss VS Tomcat VS Glassfish
23. Toggle
Simplest, from the user’s point of view: should not
care about project type of runtime differences
24. Toggle
public final class JRebelToggleAction extends BooleanStateAction {
public void initialize() {
super.initialize();
setBooleanState(JRebelSettings.isEnabled());
}
public void actionPerformed(ActionEvent ev) {
super.actionPerformed(ev);
JRebelSettings.setEnabled(getBooleanState());
// NbPreferences.forModule(JRebelSettings.class)
// .putBoolean(“enabled”, true);
}
}
25. Challenge
No extension points provided
by the NetBeans platform
Load-Time Weaving of
NetBeans platform classes
Might not be the brightest bulb idea, but seems to work fine
39. Pros & Cons
+ Can get stuff done even if the platform doesn’t
provide a proper interface
- Brittle for maintenance
40. New API (7.2)
• SPI for JVM options passed to SE program or
EE server (Bug 206196)
@StartupArgumentsProvider.Registration(
position=10, displayName="#DESC_JRebel",
startMode={StartMode.NORMAL, StartMode.DEBUG})
public class MyArgsProvider
implements StartupArgumentsProvider {
@Override
public List<String> getArguments(ServerInstance instance,
StartMode mode)
45. New API (7.3)
• Allow to provide additional binary classes to
submit breakpoints on (Bug 215680)
@BreakpointClassFilter.Registration
public class MyFilter extends BreakpointClassFilter {
@Override
public ClassNames filterClassNames(ClassNames classNames,
JPDABreakpoint breakpoint){}
}
51. Lessons Learned
• UX is hard
• Follow the logic of the target IDE
• Follow the new APIs
• Annotations over layer.xml
• If no required extension point provided, can
get around with patching via ModuleInstall
• Publishing is not 100% predictable process
52. Credits
• Big thanks to NetBeans team for awesome co-
operation & providing the new API for
debugger and server adaptors!