use of com.liferay.ide.portal.core.debug.fm.FMDebugTarget in project liferay-ide by liferay.
the class DebugPortalLaunchParticipant method portalPostLaunch.
public void portalPostLaunch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
final IServer server = org.eclipse.wst.server.core.ServerUtil.getServer(configuration);
final IServerManagerConnection connection = ServerUtil.getServerManagerConnection(server, monitor);
if (connection != null) {
try {
final String fmDebugPassword = connection.getFMDebugPassword();
final int fmDebugPort = connection.getFMDebugPort();
if (fmDebugPassword != null && fmDebugPort != -1) {
launch.setAttribute(PortalCore.PREF_FM_DEBUG_PASSWORD, fmDebugPassword);
launch.setAttribute(PortalCore.PREF_FM_DEBUG_PORT, Integer.toString(fmDebugPort));
final IDebugTarget target = new FMDebugTarget(server.getHost(), launch, launch.getProcesses()[0]);
launch.addDebugTarget(target);
}
} catch (APIException e) {
LiferayServerCore.logError("Unable to determine remote freemarker debugger connection info.", e);
}
}
this.saveLaunchMode = null;
final String stopServer = configuration.getAttribute(STOP_SERVER, "false");
if (ILaunchManager.DEBUG_MODE.equals(mode) && "false".equals(stopServer)) {
if (this.fmDebugPort != null) {
launch.setAttribute(PortalCore.PREF_FM_DEBUG_PORT, this.fmDebugPort);
this.fmDebugPort = null;
final IDebugTarget target = new FMDebugTarget(server.getHost(), launch, launch.getProcesses()[0]);
launch.addDebugTarget(target);
} else {
// $NON-NLS-1$
PortalCore.logError("Launch freemarker port is invalid.");
}
}
}
Aggregations