Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(a) Create factories for specific types of servers, i.e., standard I/O stream factories for the built-in and the user-defined scion-servers. Keep support for the network pipe servers as well, even if they're not invoked. (b) scion-server executable instance management moved to ScionPlugin via static methods. UI's ScionManager does not directly manage the project-to-scion instance association map; this is all done by ScionPlugin. (c) ScionManager will wail once when the scion-server executable factory is changed but can't start servers. (d) Support scion-server event changes so that editors can refresh their contents, etc. Found issue at server startup and async commands that needs fixing -- multiple commands get sent to the scion-server but need to be processed in temporal order. Also, looks like scion-server needs to send back the actual request id, not its generated id because these are not necessarily kept in sync. Still not sure why the outline page doesn't refresh...
- Loading branch information
Scott Michel
committed
Oct 13, 2010
1 parent
4ef1fcb
commit bb76b91
Showing
23 changed files
with
1,450 additions
and
1,044 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...l.scion.client/src/net/sf/eclipsefp/haskell/scion/client/BuiltInNetworkServerFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package net.sf.eclipsefp.haskell.scion.client; | ||
|
||
import java.io.File; | ||
import java.io.Writer; | ||
|
||
import net.sf.eclipsefp.haskell.scion.internal.client.NetworkScionServer; | ||
|
||
import org.eclipse.core.resources.IProject; | ||
import org.eclipse.core.runtime.IPath; | ||
|
||
public class BuiltInNetworkServerFactory implements IScionServerFactory { | ||
/** Default constructor. */ | ||
public BuiltInNetworkServerFactory() { | ||
// NOP | ||
} | ||
|
||
/** Generate a new BuiltInServer instance */ | ||
public IScionServer createScionServer(IProject project, Writer outStream) { | ||
File directory = (project !=null) ? new File(project.getLocation().toOSString()) : null; | ||
return new NetworkScionServer(ScionPlugin.builtinServerExecutablePath(), outStream, directory); | ||
} | ||
|
||
public IPath getServerExecutable() { | ||
return ScionPlugin.builtinServerExecutablePath(); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
...scion.client/src/net/sf/eclipsefp/haskell/scion/client/BuiltInStdStreamServerFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package net.sf.eclipsefp.haskell.scion.client; | ||
|
||
import java.io.File; | ||
import java.io.Writer; | ||
|
||
import net.sf.eclipsefp.haskell.scion.internal.client.StdStreamScionServer; | ||
|
||
import org.eclipse.core.resources.IProject; | ||
import org.eclipse.core.runtime.IPath; | ||
|
||
/** The built-in scion server factory. This is really a special case of the user-specified | ||
* server, where the path to the executable is well known. | ||
* | ||
* @author B. Scott Michel (scooter.phd@gmail.com) | ||
*/ | ||
public class BuiltInStdStreamServerFactory implements IScionServerFactory { | ||
/** Default constructor. */ | ||
public BuiltInStdStreamServerFactory() { | ||
// NOP | ||
} | ||
|
||
/** Generate a new BuiltInServer instance */ | ||
public IScionServer createScionServer(IProject project, Writer outStream) { | ||
File directory = (project !=null) ? new File(project.getLocation().toOSString()) : null; | ||
return new StdStreamScionServer(ScionPlugin.builtinServerExecutablePath(), outStream, directory); | ||
} | ||
|
||
public IPath getServerExecutable() { | ||
return ScionPlugin.builtinServerExecutablePath(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...ell.scion.client/src/net/sf/eclipsefp/haskell/scion/client/IScionServerEventListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package net.sf.eclipsefp.haskell.scion.client; | ||
|
||
/** Interface for catching and processing scion server events */ | ||
public interface IScionServerEventListener { | ||
/** Process a scion server event */ | ||
public void processScionServerEvent(ScionServerEvent ev); | ||
} |
24 changes: 24 additions & 0 deletions
24
...p.haskell.scion.client/src/net/sf/eclipsefp/haskell/scion/client/IScionServerFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
* | ||
*/ | ||
package net.sf.eclipsefp.haskell.scion.client; | ||
|
||
import java.io.Writer; | ||
|
||
import org.eclipse.core.resources.IProject; | ||
import org.eclipse.core.runtime.IPath; | ||
|
||
|
||
/** Scion executable factory interface. | ||
* | ||
* @author B. Scott Michel (scooter.phd@gmail.com) | ||
*/ | ||
public interface IScionServerFactory { | ||
/** Create a new ScionExectable | ||
* @param project The associated project, which identifies the working directory for the server | ||
* @param outStream TODO | ||
*/ | ||
public IScionServer createScionServer(final IProject project, final Writer outStream); | ||
/** Get the server executable IPath */ | ||
public IPath getServerExecutable(); | ||
} |
26 changes: 26 additions & 0 deletions
26
...ion.client/src/net/sf/eclipsefp/haskell/scion/client/NetworkStreamScionServerFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package net.sf.eclipsefp.haskell.scion.client; | ||
import java.io.File; | ||
import java.io.Writer; | ||
|
||
import org.eclipse.core.resources.IProject; | ||
import org.eclipse.core.runtime.IPath; | ||
|
||
import net.sf.eclipsefp.haskell.scion.internal.client.NetworkScionServer; | ||
|
||
public class NetworkStreamScionServerFactory implements IScionServerFactory { | ||
private IPath userExecutable; | ||
|
||
public NetworkStreamScionServerFactory(final IPath userExecutable) { | ||
this.userExecutable = userExecutable; | ||
} | ||
|
||
public IScionServer createScionServer(IProject project, Writer outStream) { | ||
File directory = (project !=null) ? new File(project.getLocation().toOSString()) : null; | ||
return new NetworkScionServer(userExecutable, outStream, directory); | ||
} | ||
|
||
public IPath getServerExecutable() { | ||
return userExecutable; | ||
} | ||
|
||
} |
43 changes: 43 additions & 0 deletions
43
...askell.scion.client/src/net/sf/eclipsefp/haskell/scion/client/NullScionServerFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package net.sf.eclipsefp.haskell.scion.client; | ||
|
||
import java.io.Writer; | ||
|
||
import org.eclipse.core.resources.IProject; | ||
import org.eclipse.core.runtime.IPath; | ||
import org.eclipse.core.runtime.Path; | ||
|
||
import net.sf.eclipsefp.haskell.scion.internal.client.NullScionServer; | ||
|
||
/** | ||
* The null scion server factory. | ||
* | ||
* @author B. Scott Michel | ||
*/ | ||
public class NullScionServerFactory implements IScionServerFactory { | ||
/** Container class for the {@link NullScionServerFactory NullScionServerFactory} singleton | ||
* instance. | ||
*/ | ||
private final static class SingletonContainer { | ||
private final static NullScionServerFactory theInstance = new NullScionServerFactory(); | ||
} | ||
|
||
/** Default constructor. This is hidden so preserve singleton semantics. */ | ||
private NullScionServerFactory() { | ||
// NOP | ||
} | ||
|
||
/** Get the singleton factory instance */ | ||
public final static NullScionServerFactory getDefault() { | ||
return SingletonContainer.theInstance; | ||
} | ||
|
||
/** Create a new NullScionServer. In reality, this just returns another reference | ||
* to the {@link NullScionServer NullScionServer}'s singleton. */ | ||
public IScionServer createScionServer(final IProject project, final Writer outStream) { | ||
return NullScionServer.getDefault(); | ||
} | ||
|
||
public IPath getServerExecutable() { | ||
return new Path("/nullServer"); | ||
} | ||
} |
Oops, something went wrong.