Skip to content

Commit

Permalink
prepare 0.1.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
pron committed Mar 26, 2014
1 parent 5d95f64 commit 4030dd4
Show file tree
Hide file tree
Showing 16 changed files with 108 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ branches:
env:
global:
- secure: "I8awdba2QYgO+vKmbsIa10L7dGPpcvt/l0sfE+NH2On4ZtBFuX7X4tFncmWizHhrqa0xvoAEl8hZFZ6+RjbAOzd9kDLfdHevLVv6z8VQusvY58GbAHPP0h4yd4PA0YsSeiLv1F7X7bCH6weZo16t42lVh4NrAS2XHqSOOvMyAWo="
- DOCS_BRANCH="0.1.0"
- DOCS_BRANCH="0.1.1"
- GEN_APIDOCS="gradle javadoc"

after_success:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ In Maven:
<dependency>
<groupId>co.paralleluniverse</groupId>
<artifactId>ARTIFACT</artifactId>
<version>0.1.0</version>
<version>0.1.1</version>
</dependency>
```

Expand Down
58 changes: 32 additions & 26 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ subprojects {
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'

group = "co.paralleluniverse"
version = "0.2.0-SNAPSHOT"
version = "0.1.1"
status = "integration"
description = "Fibers services for web"
ext.url = "http://puniverse.github.com/comsat"
Expand Down Expand Up @@ -35,12 +35,18 @@ subprojects {
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url 'https://maven.java.net/content/repositories/snapshots' }
}


configurations {
provided
srcFiles
markdownDoclet
}

configurations.all {
resolutionStrategy {
failOnVersionConflict()
force "com.google.guava:guava:16.0.1"
force "org.ow2.asm:asm:5.0_BETA"
force "org.ow2.asm:asm:5.0.1"
force "org.slf4j:slf4j-api:1.7.6"
force "log4j:log4j:1.2.17"
force "junit:junit:4.11"
Expand All @@ -49,15 +55,17 @@ subprojects {
}
}

configurations {
srcFiles
markdownDoclet
}

dependencies {
compile 'co.paralleluniverse:quasar-core:0.5.0-SNAPSHOT'
provided 'co.paralleluniverse:quasar-core:0.5.0'
markdownDoclet "ch.raffael.pegdown-doclet:pegdown-doclet:1.1.1"
}

sourceSets {
main.compileClasspath = main.compileClasspath + configurations.provided
main.runtimeClasspath = main.runtimeClasspath + configurations.provided
test.compileClasspath = test.compileClasspath + configurations.provided
test.runtimeClasspath = test.runtimeClasspath + configurations.provided
}

defaultTasks 'install'

Expand All @@ -72,7 +80,7 @@ subprojects {
doLast {
ant.taskdef(name:'scanSuspendables',
classname:'co.paralleluniverse.fibers.instrument.SuspendablesScanner',
classpath: "build/classes/main:" + configurations.compile.asPath)
classpath: "build/classes/main:${configurations.provided.asPath}:${configurations.compile.asPath}")
ant.scanSuspendables(outputFile:"$sourceSets.main.output.resourcesDir/META-INF/suspendable-supers") {
fileset(dir: sourceSets.main.output.classesDir)
}
Expand Down Expand Up @@ -213,7 +221,7 @@ project (':comsat-jdbc') {
println("Instrumenting classes...")
ant.taskdef(name:'instrumentation',
classname:'co.paralleluniverse.fibers.instrument.InstrumentationTask',
classpath: "build/resources/main:"+"build/classes/main:" + configurations.compile.asPath)
classpath: "build/classes/main:${configurations.provided.asPath}:${configurations.compile.asPath}")
ant.instrumentation(verbose:'true', check:'true', debug:'true') {
fileset(dir: sourceSets.main.output.classesDir) {
exclude(name: 'co/paralleluniverse/fibers/instrument/*.class')
Expand All @@ -226,18 +234,17 @@ project (':comsat-jdbc') {
project (':comsat-jax-rs-client') {
dependencies {
compile 'javax.ws.rs:javax.ws.rs-api:2.0'
compile 'org.glassfish.jersey.core:jersey-client:2.5.1'
compile 'org.glassfish.jersey.connectors:jersey-jetty-connector:2.5.1'
compile 'org.glassfish.jersey.core:jersey-client:2.7'
compile 'org.glassfish.jersey.connectors:jersey-jetty-connector:2.7'
srcFiles 'javax.ws.rs:javax.ws.rs-api:2.0:sources'
}

}

//project (':comsat-httpclient') {
// dependencies {
// compile 'org.apache.httpcomponents:httpcore:4.3.2'
// compile 'org.apache.httpcomponents:httpclient:4.3.2'
// compile 'org.apache.httpcomponents:httpasyncclient:4.0'
// compile 'org.apache.httpcomponents:httpcore:4.3.3'
// compile 'org.apache.httpcomponents:httpclient:4.3.3'
// compile 'org.apache.httpcomponents:httpasyncclient:4.1'
// }
//}

Expand All @@ -251,29 +258,27 @@ project (':comsat-jersey-server') {
dependencies {
compile project(':comsat-servlet')
compile 'org.sonatype.sisu.inject:cglib:3.1.1' // instead of old cglib in jersey
compile ('org.glassfish.jersey.containers:jersey-container-servlet:2.5.1' ) {
exclude group: 'org.glassfish.hk2.external', module: 'asm-all-repackaged'
compile ('org.glassfish.jersey.containers:jersey-container-servlet:2.7' ) {
exclude group: 'org.glassfish.hk2.external', module: 'cglib'
}
compile ('org.glassfish.jersey.core:jersey-client:2.5.1') {
exclude group: 'org.glassfish.hk2.external', module: 'asm-all-repackaged'
compile ('org.glassfish.jersey.core:jersey-client:2.7') {
exclude group: 'org.glassfish.hk2.external', module: 'cglib'
}
}
}

project (':comsat-actors-api') {
dependencies {
compile 'co.paralleluniverse:quasar-actors:0.5.0-SNAPSHOT'
compile 'co.paralleluniverse:quasar-actors:0.5.0'
compile 'com.google.guava:guava:16.0.1'
}
}

project (':comsat-actors-servlet') {
dependencies {
compile project (':comsat-actors-api')
compile 'javax.websocket:javax.websocket-api:1.0'
compile 'javax.servlet:javax.servlet-api:3.1.0'
provided 'javax.websocket:javax.websocket-api:1.0'
provided 'javax.servlet:javax.servlet-api:3.1.0'
srcFiles 'javax.servlet:javax.servlet-api:3.1.0:sources'
}
}
Expand All @@ -287,13 +292,14 @@ project(':comsat-actors-netty') {

project(':comsat-actors-undertow') {
dependencies {
compile 'io.undertow:undertow-core:1.0.0.Final'
compile 'io.undertow:undertow-core:1.0.2.Final'
compile project (':comsat-actors-api')
}
}

project(':comsat-tomcat-loader') {
dependencies {
compile 'co.paralleluniverse:quasar-core:0.5.0'
compile 'org.apache.tomcat.embed:tomcat-embed-core:8.0.3'
}
jar {
Expand Down Expand Up @@ -348,5 +354,5 @@ task clean(dependsOn: subprojects.clean) << {
}

task wrapper(type: Wrapper) {
gradleVersion = '1.10'
gradleVersion = '1.11'
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ protected String contentString() {
* @param body the response body
* @return A response {@link Builder} that can be used to add headers and other metadata to the response.
*/
public static Builder ok(HttpRequest request, String body) {
return new Builder(request, body);
public static Builder ok(ActorRef<? super WebMessage> from, HttpRequest request, String body) {
return new Builder(from, request, body);
}

/**
Expand All @@ -92,8 +92,8 @@ public static Builder ok(HttpRequest request, String body) {
* @param body the response body
* @return A response {@link Builder} that can be used to add headers and other metadata to the response.
*/
public static Builder ok(HttpRequest request, ByteBuffer body) {
return new Builder(request, body);
public static Builder ok(ActorRef<? super WebMessage> from, HttpRequest request, ByteBuffer body) {
return new Builder(from, request, body);
}

/**
Expand All @@ -105,8 +105,8 @@ public static Builder ok(HttpRequest request, ByteBuffer body) {
* @param cause the exception that caused the error
* @return A response {@link Builder} that can be used to add headers and other metadata to the response.
*/
public static Builder error(HttpRequest request, int status, Throwable cause) {
return new Builder(request).status(status).error(cause);
public static Builder error(ActorRef<? super WebMessage> from, HttpRequest request, int status, Throwable cause) {
return new Builder(from, request).status(status).error(cause);
}

/**
Expand All @@ -117,8 +117,8 @@ public static Builder error(HttpRequest request, int status, Throwable cause) {
* @param body the response body
* @return A response {@link Builder} that can be used to add headers and other metadata to the response.
*/
public static Builder error(HttpRequest request, int status, String body) {
return new Builder(request, body).status(status);
public static Builder error(ActorRef<? super WebMessage> from, HttpRequest request, int status, String body) {
return new Builder(from, request, body).status(status);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*/
package co.paralleluniverse.comsat.webactors;

import co.paralleluniverse.actors.ActorRef;
import java.nio.charset.Charset;

/**
Expand Down Expand Up @@ -51,8 +52,8 @@ public final class SSE {
* @param request the {@link HttpRequest} in response to which we wish to start an SSE stream.
* @return an {@link HttpResponse.Builder HttpResponse.Builder} (which can have other metadata, such as headers or cookies added to).
*/
public static HttpResponse.Builder startSSE(HttpRequest request) {
return new HttpResponse.Builder(request)
public static HttpResponse.Builder startSSE(ActorRef<? super WebMessage> from, HttpRequest request) {
return new HttpResponse.Builder(from, request)
.setContentType("text/event-stream")
.setCharacterEncoding(Charset.forName("UTF-8"))
.startActor();
Expand All @@ -69,8 +70,8 @@ public static HttpResponse.Builder startSSE(HttpRequest request) {
* after the connection has closed (will be encoded in the message body as {@code retry: ...})
* @return an {@link HttpResponse.Builder HttpResponse.Builder} (which can have other metadata, such as headers or cookies added to).
*/
public static HttpResponse.Builder startSSE(HttpRequest request, long reconnectTimeout) {
return new HttpResponse.Builder(request, retryString(reconnectTimeout) + '\n')
public static HttpResponse.Builder startSSE(ActorRef<? super WebMessage> from, HttpRequest request, long reconnectTimeout) {
return new HttpResponse.Builder(from, request, retryString(reconnectTimeout) + '\n')
.setContentType("text/event-stream")
.setCharacterEncoding(Charset.forName("UTF-8"))
.startActor();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ public void sessionCreated(HttpSessionEvent se) {
@Override
public void sessionDestroyed(HttpSessionEvent se) {
HttpActorRef ha = getHttpActorRef(se.getSession());
ha.die(null);
if (ha != null)
ha.die(null);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
* @author eitan
*/
public class ServletContainer extends FiberHttpServlet implements Filter, Container {
private static final int DEFAULT_STACK_SIZE = 120;
private final org.glassfish.jersey.servlet.ServletContainer jerseySC;

/**
Expand Down Expand Up @@ -69,6 +70,8 @@ public ServletContainer(org.glassfish.jersey.servlet.ServletContainer sc) {
@Override
public void init(ServletConfig config) throws ServletException {
super.init(config);
if (getStackSize() <= 0)
setStackSize(DEFAULT_STACK_SIZE);
}

/**
Expand Down
4 changes: 0 additions & 4 deletions comsat-jersey-server/src/main/resources/META-INF/suspendables
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
sun.reflect.NativeMethodAccessorImpl.invoke0
sun.reflect.NativeMethodAccessorImpl.invoke
sun.reflect.DelegatingMethodAccessorImpl.invoke
java.lang.reflect.Method.invoke
org.glassfish.jersey.process.Inflector.apply
org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke
org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*/
package co.paralleluniverse.fibers.servlet;

import co.paralleluniverse.common.util.Debug;
import co.paralleluniverse.fibers.Fiber;
import co.paralleluniverse.fibers.SuspendExecution;
import co.paralleluniverse.strands.SuspendableRunnable;
Expand All @@ -33,6 +34,7 @@ public abstract class FiberGenericServlet extends GenericServlet {
private transient FiberServletConfig configAD;
private transient FiberServletContext contextAD;
private final ThreadLocal<AsyncContext> currentAsyncContext = new ThreadLocal<AsyncContext>();
private int stackSize = -1;

/**
*
Expand All @@ -57,9 +59,22 @@ public ServletContext getServletContext() {
public void init(ServletConfig config) throws ServletException {
this.contextAD = new FiberServletContext(config.getServletContext(), currentAsyncContext);
this.configAD = new FiberServletConfig(config, contextAD);

String sss = config.getInitParameter("stack-size");
if(sss != null)
stackSize = Integer.parseInt(sss);

this.init();
}

protected void setStackSize(int stackSize) {
this.stackSize = stackSize;
}

protected int getStackSize() {
return stackSize;
}

/**
* @inheritDoc
*
Expand All @@ -72,7 +87,7 @@ public final void service(final ServletRequest req, final ServletResponse res) {
req.setAttribute("org.apache.catalina.ASYNC_SUPPORTED", true);
final AsyncContext ac = req.startAsync();
final FiberServletRequest srad = wrapRequest(req);
new Fiber(new SuspendableRunnable() {
new Fiber(null, stackSize, new SuspendableRunnable() {
@Override
public void run() throws SuspendExecution, InterruptedException {
try {
Expand Down
27 changes: 27 additions & 0 deletions comsat-tomcat-loader-jdk8/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apply plugin: 'java'

sourceCompatibility = '1.8'
targetCompatibility = '1.8'

dependencies {
dependencies {
compile 'co.paralleluniverse:quasar-core:0.5.0:jdk8'
compile 'org.apache.tomcat.embed:tomcat-embed-core:8.0.3'
}
}

sourceSets {
main {
java {
srcDirs = ["../comsat-tomcat-loader/src/main/java"]
}
}
}

jar {
baseName = 'comsat-tomcat-loader'
classifier = 'jdk8'

from { configurations.runtime.collect { it.isDirectory() ? it : zipTree(it) } }
}

Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ public void error(String msg, Exception exc) {
exc.printStackTrace(System.out);
}
});
// inst.setVerbose(true);
// inst.setDebug(true);
inst.setVerbose(false);
inst.setDebug(false);
return inst;
}

Expand All @@ -65,7 +65,7 @@ private synchronized void initInstrumentor() {
protected ResourceEntry findResourceInternal(String name, String path) {
initInstrumentor();
ResourceEntry entry = super.findResourceInternal(name, path);
if (entry != null && path.endsWith(".class")) {
if (entry != null && path.endsWith(".class") && entry.binaryContent != null) {
String className = name.substring(0, name.length() - ".class".length());
try {
entry.binaryContent = instrumentor.instrumentClass(className, entry.binaryContent);
Expand Down
2 changes: 1 addition & 1 deletion docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ kramdown:

# Site globals used throughout docs.
project: Comsat
version: 0.1.0
version: 0.1.1
github: puniverse/comsat
google_group: "https://groups.google.com/forum/#!forum/comsat-user"
tagline: "Scalable web application libraries"
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ To use the Java agent, the following must be added to the java command line (or

#### In Tomcat

If you're using Tomcat as your Servlet container, you have the option to use a custom class-loader instead of the Java agent. You'll need to put `comsat-tomcat-loader-{{site.version}}.jar` into Tomcat's `lib` directory.
If you're using Tomcat as your Servlet container, you have the option to use a custom class-loader instead of the Java agent. You'll need to put `comsat-tomcat-loader-{{site.version}}.jar` (or, for JDK8, `comsat-tomcat-loader-{{site.version}}-jdk8.jar`) into Tomcat's `lib` directory.

Then, include the following in your webapp's `context.xml` (in the `META-INF` directory):

Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Loading

0 comments on commit 4030dd4

Please sign in to comment.