Skip to content

Commit

Permalink
v0.63 release
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmcclean committed Oct 20, 2015
1 parent adce806 commit b9282c9
Show file tree
Hide file tree
Showing 43 changed files with 219 additions and 453 deletions.
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version=0.63
springVersion=4.2.0.RELEASE
jerseyVersion=2.19
grizzlyVersion=2.3.21
simpleReactVersion=0.98
cyclopsVersion=5.1.0
jacksonVersion=2.5.2
springVersion=4.2.2.RELEASE
jerseyVersion=2.21
grizzlyVersion=2.3.23
simpleReactVersion=0.99.3
cyclopsVersion=6.0.2
jacksonVersion=2.6.3

Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.aol.cyclops.lambda.utils.ExceptionSoftener;
import com.aol.cyclops.invokedynamic.ExceptionSoftener;
import com.aol.micro.server.servers.ApplicationRegister;
import com.aol.micro.server.servers.model.ServerData;

Expand All @@ -38,7 +37,7 @@ public void register(ServerData[] data) {
.getModule().getContext(), null)).collect(Collectors.toList()));
logger.info("Registered application {} ", application);
} catch (UnknownHostException e) {
ExceptionSoftener.singleton.factory.getInstance().throwSoftenedException(e);
ExceptionSoftener.throwSoftenedException(e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public ServiceRegistryResource(Cleaner cleaner, Finder finder, Register register
@Path("/list")
@Produces("application/json")
public void list(@Suspended AsyncResponse response) {
this.ioStream().of(this).forEach(next -> {
this.ioStreamBuilder().of(this).forEach(next -> {
try{
cleaner.clean();
response.resume(finder.find());
Expand All @@ -59,7 +59,7 @@ public void list(@Suspended AsyncResponse response) {
@Consumes("application/json")
@Produces("application/json")
public void schedule(@Suspended AsyncResponse response) {
this.ioStream().of(this).forEach(next -> {
this.ioStreamBuilder().of(this).forEach(next -> {
try{
job.schedule();
response.resume(HashMapBuilder.of("status", "success"));
Expand All @@ -76,7 +76,7 @@ public void schedule(@Suspended AsyncResponse response) {
@Consumes("application/json")
@Produces("application/json")
public void register(@Suspended AsyncResponse response,RegisterEntry entry) {
this.ioStream().of(this).forEach(next -> {
this.ioStreamBuilder().of(this).forEach(next -> {
try{
register.register(entry);
response.resume(HashMapBuilder.of("status", "complete"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import org.springframework.stereotype.Component;

import com.aol.cyclops.lambda.monads.SequenceM;
import com.aol.cyclops.sequence.SequenceM;
import com.aol.micro.server.auto.discovery.RestResource;
import com.aol.micro.server.testing.RestAgent;
import com.aol.simple.react.stream.simple.SimpleReact;
Expand All @@ -34,11 +34,12 @@ public class RegistryResource implements RestResource{
@Produces("text/plain")
public void expensive(@Suspended AsyncResponse asyncResponse){

LazyFutureStream.ofIterable(urls)
LazyFutureStream.lazyFutureStreamFromIterable(urls)
.then(it->client.get(it))
.onFail(it -> "")
.peek(it ->
System.out.println(it))
.convertToSimpleReact()
.<String,Boolean>allOf(data -> {
System.out.println(data);
return asyncResponse.resume(SequenceM.fromIterable(data).join(";")); });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;

import com.aol.cyclops.lambda.monads.SequenceM;
import com.aol.cyclops.lambda.utils.ExceptionSoftener;
import com.aol.cyclops.invokedynamic.ExceptionSoftener;
import com.aol.cyclops.sequence.SequenceM;
import com.aol.micro.server.IncorrectNumberOfServersConfiguredException;
import com.aol.micro.server.Plugin;
import com.aol.micro.server.PluginLoader;
Expand All @@ -35,8 +35,7 @@ public class MicrobootApp {

private final List<Module> modules;
private final CompletableFuture end = new CompletableFuture();
private final ExceptionSoftener softener = ExceptionSoftener.singleton.factory
.getInstance();


@Getter
private final ApplicationContext springContext;
Expand Down Expand Up @@ -91,7 +90,7 @@ private Class extractClass() {
return Class.forName(new Exception().getStackTrace()[2]
.getClassName());
} catch (ClassNotFoundException e) {
softener.throwSoftenedException(e);
ExceptionSoftener.throwSoftenedException(e);
}
return null; // unreachable normally
}
Expand Down Expand Up @@ -154,7 +153,7 @@ private void join(Thread thread) {
thread.join();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
softener.throwSoftenedException(e);
ExceptionSoftener.throwSoftenedException(e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@
import org.pcollections.HashTreePMap;
import org.pcollections.HashTreePSet;

import com.aol.cyclops.lambda.monads.SequenceM;
import com.aol.cyclops.sequence.SequenceM;
import com.aol.micro.server.Plugin;
import com.aol.micro.server.PluginLoader;
import com.aol.micro.server.config.Config;
import com.aol.micro.server.config.Configurer;

import com.nurkiewicz.lazyseq.LazySeq;

public class MicrobootConfigurator implements Configurer{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,16 @@ public class AsyncResource implements RestResource,Reactive{
@Produces("text/plain")
public void expensive(@Suspended AsyncResponse asyncResponse){

this.async(lr -> lr.fromStream(urls.stream()
this.ioStreamBuilder().fromStream(urls.stream()
.<CompletableFuture<String>>map(it -> client.get(it)))
.onFail(it -> "")
.peek(it ->
System.out.println(it))
.convertToSimpleReact()
.<String,Boolean>allOf(data -> {
System.out.println(data);
return asyncResponse.resume(String.join(";", (List<String>)data)); })).run();
return asyncResponse.resume(String.join(";", (List<String>)data)); })
.convertToLazyStream().run();

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import org.junit.Test;

import com.aol.cyclops.lambda.monads.SequenceM;
import com.aol.cyclops.sequence.SequenceM;
import com.aol.micro.server.Plugin;
import com.aol.micro.server.module.ConfigurableModule;
import com.aol.micro.server.module.Module;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;

import com.aol.cyclops.lambda.monads.SequenceM;
import com.aol.cyclops.lambda.utils.ExceptionSoftener;
import com.aol.cyclops.invokedynamic.ExceptionSoftener;
import com.aol.cyclops.sequence.SequenceM;
import com.aol.micro.server.config.Config;
import com.aol.micro.server.config.MicroserverConfigurer;
import com.aol.micro.server.module.Module;
Expand All @@ -35,8 +35,7 @@ public class MicroserverApp {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
private final List<Module> modules;
private final CompletableFuture end = new CompletableFuture();
private final ExceptionSoftener softener = ExceptionSoftener.singleton.factory
.getInstance();


@Getter
private final ApplicationContext springContext;
Expand Down Expand Up @@ -84,7 +83,7 @@ private Class extractClass() {
return Class.forName(new Exception().getStackTrace()[2]
.getClassName());
} catch (ClassNotFoundException e) {
softener.throwSoftenedException(e);
ExceptionSoftener.throwSoftenedException(e);
}
return null; // unreachable normally
}
Expand Down Expand Up @@ -150,7 +149,7 @@ private void join(Thread thread) {
thread.join();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
softener.throwSoftenedException(e);
ExceptionSoftener.throwSoftenedException(e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
import lombok.AccessLevel;
import lombok.NoArgsConstructor;

import com.aol.cyclops.functions.Memoise;
import com.aol.cyclops.lambda.monads.SequenceM;
import com.aol.cyclops.functions.caching.Memoize;
import com.aol.cyclops.sequence.SequenceM;

@NoArgsConstructor(access=AccessLevel.PRIVATE)
public class PluginLoader {

public final static PluginLoader INSTANCE = new PluginLoader();

public final Supplier<List<Plugin>> plugins = Memoise.memoiseSupplier(this::load);
public final Supplier<List<Plugin>> plugins = Memoize.memoizeSupplier(this::load);

private List<Plugin> load(){
return SequenceM.fromIterable(ServiceLoader.load(Plugin.class)).toList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import org.pcollections.HashTreePMap;
import org.pcollections.HashTreePSet;

import com.aol.cyclops.lambda.monads.SequenceM;
import com.aol.cyclops.sequence.SequenceM;
import com.aol.micro.server.Plugin;
import com.aol.micro.server.PluginLoader;
import com.nurkiewicz.lazyseq.LazySeq;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import org.springframework.web.context.ContextLoaderListener;
import org.springframework.web.context.WebApplicationContext;

import com.aol.cyclops.lambda.monads.SequenceM;
import com.aol.cyclops.sequence.SequenceM;
import com.aol.micro.server.Plugin;
import com.aol.micro.server.PluginLoader;
import com.aol.micro.server.auto.discovery.Rest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.aol.cyclops.lambda.utils.ExceptionSoftener;
import com.aol.cyclops.invokedynamic.ExceptionSoftener;
import com.aol.micro.server.auto.discovery.CommonRestResource;


public class RestResourceTagBuilder {

private final static ExceptionSoftener softener = ExceptionSoftener.singleton.factory.getInstance();
private final static Logger logger = LoggerFactory.getLogger(RestResourceTagBuilder.class);

@Setter
Expand All @@ -36,7 +35,7 @@ private static Class toClass(String cl) {
return Class.forName(cl);
} catch (ClassNotFoundException e) {
logger.error("Class not found for {}", cl);
softener.throwSoftenedException(e);
ExceptionSoftener.throwSoftenedException(e);
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
import javax.ws.rs.core.FeatureContext;
import javax.ws.rs.ext.MessageBodyReader;
import javax.ws.rs.ext.MessageBodyWriter;

import com.aol.cyclops.lambda.monads.SequenceM;
import com.aol.cyclops.sequence.SequenceM;
import com.aol.micro.server.Plugin;
import com.aol.micro.server.PluginLoader;
import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.aol.cyclops.lambda.monads.SequenceM;
import com.aol.cyclops.lambda.utils.ExceptionSoftener;
import com.aol.micro.server.Plugin;
import com.aol.cyclops.invokedynamic.ExceptionSoftener;
import com.aol.micro.server.PluginLoader;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JavaType;
Expand All @@ -18,7 +16,7 @@

public final class JacksonUtil {

private final static ExceptionSoftener softener = ExceptionSoftener.singleton.factory.getInstance();

private static ObjectMapper mapper = null;

private static final Logger logger = LoggerFactory.getLogger(JacksonUtil.class);
Expand Down Expand Up @@ -62,7 +60,7 @@ public static String serializeToJson(final Object data) {
try {
jsonString = getMapper().writeValueAsString(data);
} catch (final Exception ex) {
softener.throwSoftenedException(ex);
ExceptionSoftener.throwSoftenedException(ex);
}
return jsonString;
}
Expand All @@ -74,7 +72,7 @@ public static <T> T convertFromJson(final String jsonString, final Class<T> type
return getMapper().readValue(jsonString, type);

} catch (final Exception ex) {
softener.throwSoftenedException(ex);
ExceptionSoftener.throwSoftenedException(ex);
}
return null;
}
Expand All @@ -85,7 +83,7 @@ public static <T> T convertFromJson(final String jsonString, final JavaType type
return getMapper().readValue(jsonString, type);

} catch (final Exception ex) {
softener.throwSoftenedException(ex);
ExceptionSoftener.throwSoftenedException(ex);
}
return null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import javax.servlet.ServletContext;

import com.aol.cyclops.lambda.monads.SequenceM;
import com.aol.cyclops.sequence.SequenceM;
import com.aol.micro.server.Plugin;
import com.aol.micro.server.PluginLoader;
import com.aol.micro.server.module.IncorrectJaxRsPluginsException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;

import com.aol.cyclops.lambda.monads.SequenceM;
import com.aol.cyclops.sequence.SequenceM;
import com.aol.micro.server.Plugin;
import com.aol.micro.server.PluginLoader;
import com.aol.micro.server.config.Config;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;

import com.aol.cyclops.lambda.utils.ExceptionSoftener;
import com.aol.cyclops.invokedynamic.ExceptionSoftener;
import com.aol.micro.server.ErrorCode;
import com.aol.micro.server.config.Config;

Expand All @@ -21,7 +21,6 @@
public class SpringContextFactory {
private final Logger logger = LoggerFactory.getLogger(this.getClass());

private final ExceptionSoftener softener = ExceptionSoftener.singleton.factory.getInstance();
private final PSet<Class> classes;
private final Config config;
@Wither
Expand Down Expand Up @@ -50,7 +49,7 @@ public ApplicationContext createSpringContext() {
return springContext;
} catch (Exception e) {
logger.error( ErrorCode.STARTUP_FAILED_SPRING_INITIALISATION.toString(),e.getMessage());
softener.throwSoftenedException(e);
ExceptionSoftener.throwSoftenedException(e);
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import org.junit.Test;

import com.aol.cyclops.lambda.monads.SequenceM;
import com.aol.cyclops.sequence.SequenceM;
import com.aol.micro.server.Plugin;
public class ModuleTest {

Expand Down
Loading

0 comments on commit b9282c9

Please sign in to comment.