use of com.liferay.ide.server.remote.IServerManagerConnection 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.");
}
}
}
use of com.liferay.ide.server.remote.IServerManagerConnection in project liferay-ide by liferay.
the class LiferayServerCore method getRemoteConnection.
public static IServerManagerConnection getRemoteConnection(final IRemoteServer server) {
IServerManagerConnection retval = null;
if (connections == null) {
connections = new HashMap<String, IServerManagerConnection>();
}
if (server != null) {
IServerManagerConnection service = connections.get(server.getId());
if (service == null) {
service = new ServerManagerConnection();
updateConnectionSettings(server, service);
connections.put(server.getId(), service);
} else {
updateConnectionSettings(server, service);
}
retval = service;
}
return retval;
}
Aggregations