-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 87b1b36
Showing
110 changed files
with
1,708 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
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 @@ | ||
#Mon Sep 18 03:41:59 PDT 2017 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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 @@ | ||
#Fri Sep 22 11:37:13 PDT 2017 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,25 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>ReliableCollectionsSample</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.buildship.core.gradleprojectbuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>servicefabricactor.projectNature</nature> | ||
<nature>org.eclipse.buildship.core.gradleprojectnature</nature> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> | ||
|
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,55 @@ | ||
apply plugin: 'java' | ||
apply plugin: 'eclipse' | ||
|
||
allprojects { | ||
gradle.projectsEvaluated { | ||
tasks.withType(JavaCompile) { | ||
options.compilerArgs << "-Xlint:unchecked" << "-g" | ||
} | ||
} | ||
} | ||
|
||
sourceSets { | ||
main { | ||
java.srcDirs = ['src'] | ||
output.classesDir = 'out/classes' | ||
resources { | ||
srcDirs = ['src'] | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
compile fileTree(dir: './../../../lib', include: ['*.jar']) | ||
} | ||
|
||
clean.doFirst { | ||
delete "out" | ||
delete "../ReliableCollectionsSample/RCMainService/Code/rcmainservice.jar" | ||
delete "../ReliableCollectionsSample/RCMainService/Code/lib" | ||
} | ||
|
||
jar { | ||
manifest { | ||
attributes( | ||
'Main-Class': 'reliablecollections.sample.service.ReliableCollectionsSampleServiceHost', | ||
"Class-Path": configurations.compile.collect { 'lib/' + it.getName() }.join(' ')) | ||
baseName "rcmainservice" | ||
destinationDir = file('../ReliableCollectionsSample/RCMainService/Code') | ||
} | ||
} | ||
|
||
task copyDeps<< { | ||
copy { | ||
from("../../../lib") | ||
into("../ReliableCollectionsSample/RCMainService/Code/lib") | ||
include('*.jar') | ||
} | ||
copy { | ||
from("../../../lib") | ||
into("../ReliableCollectionsSample/RCMainService/Code/lib") | ||
include('*.so') | ||
} | ||
} | ||
|
||
defaultTasks 'clean', 'jar', 'copyDeps' |
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,10 @@ | ||
Manifest-Version: 1.0 | ||
Main-Class: reliablecollections.sample.service.ReliableCollectionsSamp | ||
leServiceHost | ||
Class-Path: lib/asm-commons-5.0.4.jar lib/asm-analysis-5.0.4.jar lib/a | ||
sm-xml-5.0.4.jar lib/microsoft.servicefabric.fabrictransport-preview. | ||
jar lib/gson-2.7.jar lib/asm-tree-5.0.4.jar lib/system.fabric-preview | ||
.jar lib/microsoft.servicefabric.actors-preview.jar lib/asm-5.0.4.jar | ||
lib/asm-util-5.0.4.jar lib/microsoft.servicefabric.services-preview. | ||
jar | ||
|
Binary file added
BIN
+484 Bytes
RCMainService/out/classes/reliablecollections/sample/service/ComplexType.class
Binary file not shown.
Binary file added
BIN
+2.49 KB
RCMainService/out/classes/reliablecollections/sample/service/HttpCommunicationListener.class
Binary file not shown.
Binary file added
BIN
+3.47 KB
RCMainService/out/classes/reliablecollections/sample/service/HttpServer$1.class
Binary file not shown.
Binary file added
BIN
+4 KB
RCMainService/out/classes/reliablecollections/sample/service/HttpServer$10.class
Binary file not shown.
Binary file added
BIN
+3.93 KB
RCMainService/out/classes/reliablecollections/sample/service/HttpServer$11.class
Binary file not shown.
Binary file added
BIN
+3.89 KB
RCMainService/out/classes/reliablecollections/sample/service/HttpServer$12.class
Binary file not shown.
Binary file added
BIN
+3.2 KB
RCMainService/out/classes/reliablecollections/sample/service/HttpServer$13.class
Binary file not shown.
Binary file added
BIN
+3.13 KB
RCMainService/out/classes/reliablecollections/sample/service/HttpServer$14.class
Binary file not shown.
Binary file added
BIN
+3.16 KB
RCMainService/out/classes/reliablecollections/sample/service/HttpServer$15.class
Binary file not shown.
Binary file added
BIN
+2.58 KB
RCMainService/out/classes/reliablecollections/sample/service/HttpServer$16.class
Binary file not shown.
Binary file added
BIN
+4.37 KB
RCMainService/out/classes/reliablecollections/sample/service/HttpServer$17.class
Binary file not shown.
Binary file added
BIN
+4.64 KB
RCMainService/out/classes/reliablecollections/sample/service/HttpServer$18.class
Binary file not shown.
Binary file added
BIN
+4.42 KB
RCMainService/out/classes/reliablecollections/sample/service/HttpServer$19.class
Binary file not shown.
Binary file added
BIN
+4.03 KB
RCMainService/out/classes/reliablecollections/sample/service/HttpServer$2.class
Binary file not shown.
Binary file added
BIN
+4.7 KB
RCMainService/out/classes/reliablecollections/sample/service/HttpServer$20.class
Binary file not shown.
Binary file added
BIN
+5.73 KB
RCMainService/out/classes/reliablecollections/sample/service/HttpServer$21.class
Binary file not shown.
Binary file added
BIN
+3.52 KB
RCMainService/out/classes/reliablecollections/sample/service/HttpServer$3.class
Binary file not shown.
Binary file added
BIN
+5.26 KB
RCMainService/out/classes/reliablecollections/sample/service/HttpServer$4.class
Binary file not shown.
Binary file added
BIN
+3.15 KB
RCMainService/out/classes/reliablecollections/sample/service/HttpServer$5.class
Binary file not shown.
Binary file added
BIN
+4.79 KB
RCMainService/out/classes/reliablecollections/sample/service/HttpServer$6.class
Binary file not shown.
Binary file added
BIN
+3.71 KB
RCMainService/out/classes/reliablecollections/sample/service/HttpServer$7.class
Binary file not shown.
Binary file added
BIN
+3.15 KB
RCMainService/out/classes/reliablecollections/sample/service/HttpServer$8.class
Binary file not shown.
Binary file added
BIN
+3.52 KB
RCMainService/out/classes/reliablecollections/sample/service/HttpServer$9.class
Binary file not shown.
Binary file added
BIN
+4.97 KB
RCMainService/out/classes/reliablecollections/sample/service/HttpServer.class
Binary file not shown.
Binary file added
BIN
+2.74 KB
...ice/out/classes/reliablecollections/sample/service/ReliableCollectionsSampleService.class
Binary file not shown.
Binary file added
BIN
+2.18 KB
...out/classes/reliablecollections/sample/service/ReliableCollectionsSampleServiceHost.class
Binary file not shown.
53 changes: 53 additions & 0 deletions
53
RCMainService/src/reliablecollections/sample/service/HttpCommunicationListener.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,53 @@ | ||
package reliablecollections.sample.service; | ||
|
||
import java.util.Random; | ||
import java.util.UUID; | ||
import java.util.concurrent.CompletableFuture; | ||
|
||
import microsoft.servicefabric.data.ReliableStateManager; | ||
import microsoft.servicefabric.services.communication.runtime.CommunicationListener; | ||
import system.fabric.CancellationToken; | ||
import system.fabric.FabricRuntime; | ||
import system.fabric.ServiceContext; | ||
import system.fabric.StatefulServiceContext; | ||
import system.fabric.description.EndpointResourceDescription; | ||
|
||
public class HttpCommunicationListener implements CommunicationListener { | ||
|
||
private ServiceContext serviceContext; | ||
private String listeningAddress; | ||
private HttpServer httpServer; | ||
private ReliableStateManager stateManager; | ||
public HttpCommunicationListener(ServiceContext serviceContext, ReliableStateManager stateManager) { | ||
this.serviceContext = serviceContext; | ||
this.stateManager = stateManager; | ||
} | ||
@Override | ||
public CompletableFuture<String> openAsync(CancellationToken cancellationToken) { | ||
EndpointResourceDescription serviceEndpoint = this.serviceContext.getCodePackageActivationContext().getEndpoint("ServiceEndpoint"); | ||
int port = serviceEndpoint.getPort(); | ||
if (serviceContext instanceof StatefulServiceContext){ | ||
StatefulServiceContext statefulInitParams = (StatefulServiceContext) this.serviceContext; | ||
String baseAddress = "/"; | ||
|
||
this.httpServer = new HttpServer(baseAddress, port, stateManager); | ||
this.httpServer.start(); | ||
|
||
} else { | ||
// TODO | ||
} | ||
return CompletableFuture.completedFuture(this.listeningAddress); | ||
} | ||
|
||
@Override | ||
public CompletableFuture<?> closeAsync(CancellationToken cancellationToken) { | ||
this.httpServer.stop(); | ||
return CompletableFuture.completedFuture(null); | ||
} | ||
|
||
@Override | ||
public void abort() { | ||
this.httpServer.stop(); | ||
} | ||
|
||
} |
Oops, something went wrong.