diff --git a/gradle.properties b/gradle.properties index 13e5b0f44..1e1db67e4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,10 +1,10 @@ -version=0.91 +version=0.91.1 springVersion=4.3.3.RELEASE springBootVersion=1.4.1.RELEASE jerseyVersion=2.24 grizzlyVersion=2.3.28 -cyclopsReactVersion=2.0.0-MI5 -cyclopsVersion=9.0.0-MI1 +cyclopsReactVersion=2.0.0-MI7 +cyclopsVersion=9.0.0-MI2 hamcrestVersion=1.3 hibernateVersion=5.1.0.Final hibernateValidator=5.2.4.Final diff --git a/micro-application-register/src/main/java/com/aol/micro/server/application/registry/RegistryHealthChecker.java b/micro-application-register/src/main/java/com/aol/micro/server/application/registry/RegistryHealthChecker.java index 50682ba79..8514440be 100644 --- a/micro-application-register/src/main/java/com/aol/micro/server/application/registry/RegistryHealthChecker.java +++ b/micro-application-register/src/main/java/com/aol/micro/server/application/registry/RegistryHealthChecker.java @@ -2,8 +2,8 @@ import java.util.List; -import cyclops.Semigroups; -import cyclops.collections.ListX; +import cyclops.companion.Semigroups; +import cyclops.collections.mutable.ListX; import cyclops.function.Monoid; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; diff --git a/micro-application-register/src/main/java/com/aol/micro/server/application/registry/RegistryStatsChecker.java b/micro-application-register/src/main/java/com/aol/micro/server/application/registry/RegistryStatsChecker.java index 2d75253b3..af0f6ad7f 100644 --- a/micro-application-register/src/main/java/com/aol/micro/server/application/registry/RegistryStatsChecker.java +++ b/micro-application-register/src/main/java/com/aol/micro/server/application/registry/RegistryStatsChecker.java @@ -4,7 +4,7 @@ import java.util.Map; import java.util.Objects; -import cyclops.collections.ListX; +import cyclops.collections.mutable.ListX; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; diff --git a/micro-application-register/src/main/java/com/aol/micro/server/application/registry/ServiceRegistryResource.java b/micro-application-register/src/main/java/com/aol/micro/server/application/registry/ServiceRegistryResource.java index e9142b0dd..26e0b8d9d 100644 --- a/micro-application-register/src/main/java/com/aol/micro/server/application/registry/ServiceRegistryResource.java +++ b/micro-application-register/src/main/java/com/aol/micro/server/application/registry/ServiceRegistryResource.java @@ -43,9 +43,8 @@ public ServiceRegistryResource(Cleaner cleaner, Finder finder, Register register @Path("/list") @Produces("application/json") public void list(@Suspended AsyncResponse response) { - ReactiveSeq.of(this) - .futureOperations(WorkerThreads.ioExecutor.get()) - .forEachX(Long.MAX_VALUE,next -> { + ReactiveSeq.of(this).foldFuture(WorkerThreads.ioExecutor.get(), + s->s.forEach(Long.MAX_VALUE,next -> { try{ cleaner.clean(); response.resume(finder.find()); @@ -53,7 +52,7 @@ public void list(@Suspended AsyncResponse response) { logger.error(e.getMessage(),e); response.resume(Arrays.asList("failed due to error")); } - }); + })); } @@ -62,9 +61,8 @@ public void list(@Suspended AsyncResponse response) { @Consumes("application/json") @Produces("application/json") public void schedule(@Suspended AsyncResponse response) { - ReactiveSeq.of(this) - .futureOperations(WorkerThreads.ioExecutor.get()) - .forEachX(Long.MAX_VALUE,next -> { + ReactiveSeq.of(this).foldFuture(WorkerThreads.ioExecutor.get(),s-> + s.forEach(Long.MAX_VALUE,next -> { try{ job.schedule(); response.resume(HashMapBuilder.of("status", "success")); @@ -72,7 +70,7 @@ public void schedule(@Suspended AsyncResponse response) { logger.error(e.getMessage(),e); response.resume(HashMapBuilder.of("status", "failure")); } - }); + })); } @@ -81,9 +79,8 @@ public void schedule(@Suspended AsyncResponse response) { @Consumes("application/json") @Produces("application/json") public void register(@Suspended AsyncResponse response,RegisterEntry entry) { - ReactiveSeq.of(this) - .futureOperations(WorkerThreads.ioExecutor.get()) - .forEachX(Long.MAX_VALUE,next -> { + ReactiveSeq.of(this).foldFuture(WorkerThreads.ioExecutor.get(), + s->s.forEach(Long.MAX_VALUE,next -> { try{ register.register(entry); response.resume(HashMapBuilder.of("status", "complete")); @@ -91,7 +88,7 @@ public void register(@Suspended AsyncResponse response,RegisterEntry entry) { logger.error(e.getMessage(),e); response.resume(HashMapBuilder.of("status", "failure")); } - }); + })); } diff --git a/micro-application-register/src/main/java/com/aol/micro/server/application/registry/plugin/ApplicationRegistryPlugin.java b/micro-application-register/src/main/java/com/aol/micro/server/application/registry/plugin/ApplicationRegistryPlugin.java index 89c865df9..4ac3e2f2a 100644 --- a/micro-application-register/src/main/java/com/aol/micro/server/application/registry/plugin/ApplicationRegistryPlugin.java +++ b/micro-application-register/src/main/java/com/aol/micro/server/application/registry/plugin/ApplicationRegistryPlugin.java @@ -10,13 +10,13 @@ import com.aol.micro.server.application.registry.RegisterConfig; import com.aol.micro.server.application.registry.ServiceRegistryResource; import com.aol.micro.server.application.registry.RegistryStatsChecker; -import cyclops.collections.immutable.PSetX; +import cyclops.collections.immutable.PersistentSetX; public class ApplicationRegistryPlugin implements Plugin { @Override - public PSetX springClasses() { - return PSetX.of(ApplicationRegisterImpl.class, Cleaner.class, Register.class, ServiceRegistryResource.class, + public PersistentSetX springClasses() { + return PersistentSetX.of(ApplicationRegisterImpl.class, Cleaner.class, Register.class, ServiceRegistryResource.class, RegisterConfig.class, Job.class, Finder.class, RegistryHealthChecker.class, RegistryStatsChecker.class); } diff --git a/micro-application-register/src/test/java/app/registry/config/com/aol/micro/server/HealthCheckerResource.java b/micro-application-register/src/test/java/app/registry/config/com/aol/micro/server/HealthCheckerResource.java index 9e410b015..bf6be2169 100644 --- a/micro-application-register/src/test/java/app/registry/config/com/aol/micro/server/HealthCheckerResource.java +++ b/micro-application-register/src/test/java/app/registry/config/com/aol/micro/server/HealthCheckerResource.java @@ -8,7 +8,8 @@ import com.aol.micro.server.HealthStatusChecker; import com.aol.micro.server.StatsSupplier; import com.aol.micro.server.auto.discovery.Rest; -import cyclops.collections.MapXs; +import cyclops.companion.MapXs; + @Rest @Path("/health") diff --git a/micro-async-data-loader/src/main/java/com/aol/micro/server/async/data/loader/ConfigureSchedulingAsyncDataLoader.java b/micro-async-data-loader/src/main/java/com/aol/micro/server/async/data/loader/ConfigureSchedulingAsyncDataLoader.java index 57cf59419..a35ca82ae 100644 --- a/micro-async-data-loader/src/main/java/com/aol/micro/server/async/data/loader/ConfigureSchedulingAsyncDataLoader.java +++ b/micro-async-data-loader/src/main/java/com/aol/micro/server/async/data/loader/ConfigureSchedulingAsyncDataLoader.java @@ -4,8 +4,8 @@ import java.util.concurrent.Executors; import java.util.function.BinaryOperator; -import cyclops.collections.ListX; -import cyclops.collections.SetX; +import cyclops.collections.mutable.ListX; +import cyclops.collections.mutable.SetX; import cyclops.stream.ReactiveSeq; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; diff --git a/micro-async-data-loader/src/main/java/com/aol/micro/server/async/data/loader/DataLoader.java b/micro-async-data-loader/src/main/java/com/aol/micro/server/async/data/loader/DataLoader.java index fdff602c7..b720c1f36 100644 --- a/micro-async-data-loader/src/main/java/com/aol/micro/server/async/data/loader/DataLoader.java +++ b/micro-async-data-loader/src/main/java/com/aol/micro/server/async/data/loader/DataLoader.java @@ -9,7 +9,7 @@ import com.aol.micro.server.manifest.ManifestComparator; import com.aol.micro.server.utility.HashMapBuilder; -import cyclops.collections.MapX; +import cyclops.collections.mutable.MapX; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/micro-async-data-loader/src/main/java/com/aol/micro/server/async/data/loader/LoaderSchedular.java b/micro-async-data-loader/src/main/java/com/aol/micro/server/async/data/loader/LoaderSchedular.java index 2685d1ea3..44740a41c 100644 --- a/micro-async-data-loader/src/main/java/com/aol/micro/server/async/data/loader/LoaderSchedular.java +++ b/micro-async-data-loader/src/main/java/com/aol/micro/server/async/data/loader/LoaderSchedular.java @@ -6,7 +6,7 @@ import com.aol.micro.server.events.SystemData; import com.google.common.eventbus.EventBus; -import cyclops.collections.ListX; +import cyclops.collections.mutable.ListX; import cyclops.stream.ReactiveSeq; import lombok.AllArgsConstructor; @@ -23,10 +23,9 @@ public void schedule() { loader.forEach(dl -> { // run on startup - create(dl).limit(1) - .futureOperations(executor) - .forEachX(Long.MAX_VALUE,l -> { - }); + create(dl).limit(1).foldFuture(executor, + s->s.forEach(Long.MAX_VALUE,l -> { + })); // schedule create(dl).schedule(dl.getCron(), executor); diff --git a/micro-async-data-loader/src/main/java/com/aol/micro/server/async/data/loader/plugin/AsyncDataLoaderPlugin.java b/micro-async-data-loader/src/main/java/com/aol/micro/server/async/data/loader/plugin/AsyncDataLoaderPlugin.java index c964ed175..0241bff4b 100644 --- a/micro-async-data-loader/src/main/java/com/aol/micro/server/async/data/loader/plugin/AsyncDataLoaderPlugin.java +++ b/micro-async-data-loader/src/main/java/com/aol/micro/server/async/data/loader/plugin/AsyncDataLoaderPlugin.java @@ -5,7 +5,7 @@ import com.aol.micro.server.Plugin; import com.aol.micro.server.async.data.loader.ConfigureSchedulingAsyncDataLoader; -import cyclops.collections.SetX; +import cyclops.collections.mutable.SetX; public class AsyncDataLoaderPlugin implements Plugin { diff --git a/micro-async-data-loader/src/test/java/app/loader/scheduled/com/aol/micro/server/CouchbaseResource.java b/micro-async-data-loader/src/test/java/app/loader/scheduled/com/aol/micro/server/CouchbaseResource.java index 390ab85ae..7b5e218ec 100644 --- a/micro-async-data-loader/src/test/java/app/loader/scheduled/com/aol/micro/server/CouchbaseResource.java +++ b/micro-async-data-loader/src/test/java/app/loader/scheduled/com/aol/micro/server/CouchbaseResource.java @@ -4,12 +4,12 @@ import javax.ws.rs.Path; import javax.ws.rs.Produces; -import cyclops.collections.immutable.PStackX; +import cyclops.collections.immutable.LinkedListX; import cyclops.control.Maybe; import org.springframework.beans.factory.annotation.Autowired; -import com.aol.micro.server.async.data.loader.DataLoader; + import com.aol.micro.server.auto.discovery.Rest; import com.aol.micro.server.distributed.DistributedMap; import com.aol.micro.server.events.SystemData; @@ -21,7 +21,7 @@ public class CouchbaseResource { private final DistributedMap client; - private volatile PStackX dataLoads = PStackX.empty(); + private volatile LinkedListX dataLoads = LinkedListX.empty(); @Autowired public CouchbaseResource(DistributedMap client, EventBus bus) { @@ -38,7 +38,7 @@ public synchronized void events(SystemData event) { @GET @Path("/loading-events") @Produces("application/json") - public synchronized PStackX loadingEvents() { + public synchronized LinkedListX loadingEvents() { return dataLoads; } diff --git a/micro-async-data-loader/src/test/java/app/loader/scheduled/off/com/aol/micro/server/CouchbaseResource.java b/micro-async-data-loader/src/test/java/app/loader/scheduled/off/com/aol/micro/server/CouchbaseResource.java index eb3787a66..190d1eb13 100644 --- a/micro-async-data-loader/src/test/java/app/loader/scheduled/off/com/aol/micro/server/CouchbaseResource.java +++ b/micro-async-data-loader/src/test/java/app/loader/scheduled/off/com/aol/micro/server/CouchbaseResource.java @@ -4,7 +4,7 @@ import javax.ws.rs.Path; import javax.ws.rs.Produces; -import cyclops.collections.immutable.PStackX; +import cyclops.collections.immutable.LinkedListX; import cyclops.control.Maybe; import org.springframework.beans.factory.annotation.Autowired; @@ -21,7 +21,7 @@ public class CouchbaseResource { private final DistributedMap client; - private volatile PStackX dataLoads = PStackX.empty(); + private volatile LinkedListX dataLoads = LinkedListX.empty(); @Autowired public CouchbaseResource(DistributedMap client, EventBus bus) { @@ -38,7 +38,7 @@ public synchronized void events(SystemData event) { @GET @Path("/loading-events") @Produces("application/json") - public synchronized PStackX loadingEvents() { + public synchronized LinkedListX loadingEvents() { return dataLoads; } diff --git a/micro-async-data-writer/src/main/java/com/aol/micro/server/async/data/cleaner/CleanerSchedular.java b/micro-async-data-writer/src/main/java/com/aol/micro/server/async/data/cleaner/CleanerSchedular.java index 6228e0911..eb4f35c6e 100644 --- a/micro-async-data-writer/src/main/java/com/aol/micro/server/async/data/cleaner/CleanerSchedular.java +++ b/micro-async-data-writer/src/main/java/com/aol/micro/server/async/data/cleaner/CleanerSchedular.java @@ -5,7 +5,7 @@ import com.google.common.eventbus.EventBus; -import cyclops.collections.ListX; +import cyclops.collections.mutable.ListX; import cyclops.stream.ReactiveSeq; import lombok.AllArgsConstructor; diff --git a/micro-async-data-writer/src/main/java/com/aol/micro/server/async/data/cleaner/ConfigureSchedulingAsyncDataWriter.java b/micro-async-data-writer/src/main/java/com/aol/micro/server/async/data/cleaner/ConfigureSchedulingAsyncDataWriter.java index c531b988b..add093217 100644 --- a/micro-async-data-writer/src/main/java/com/aol/micro/server/async/data/cleaner/ConfigureSchedulingAsyncDataWriter.java +++ b/micro-async-data-writer/src/main/java/com/aol/micro/server/async/data/cleaner/ConfigureSchedulingAsyncDataWriter.java @@ -4,7 +4,7 @@ import java.util.concurrent.Executors; import java.util.function.BinaryOperator; -import cyclops.collections.ListX; +import cyclops.collections.mutable.ListX; import cyclops.control.Maybe; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; diff --git a/micro-async-data-writer/src/main/java/com/aol/micro/server/async/data/cleaner/DataCleaner.java b/micro-async-data-writer/src/main/java/com/aol/micro/server/async/data/cleaner/DataCleaner.java index 2597d495b..a249ea3a4 100644 --- a/micro-async-data-writer/src/main/java/com/aol/micro/server/async/data/cleaner/DataCleaner.java +++ b/micro-async-data-writer/src/main/java/com/aol/micro/server/async/data/cleaner/DataCleaner.java @@ -9,7 +9,7 @@ import com.aol.micro.server.manifest.ManifestComparator; import com.aol.micro.server.utility.HashMapBuilder; -import cyclops.collections.MapX; +import cyclops.collections.mutable.MapX; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/micro-async-data-writer/src/main/java/com/aol/micro/server/async/data/writer/AsyncDataWriter.java b/micro-async-data-writer/src/main/java/com/aol/micro/server/async/data/writer/AsyncDataWriter.java index de391f2f5..81cd04bd6 100644 --- a/micro-async-data-writer/src/main/java/com/aol/micro/server/async/data/writer/AsyncDataWriter.java +++ b/micro-async-data-writer/src/main/java/com/aol/micro/server/async/data/writer/AsyncDataWriter.java @@ -5,7 +5,7 @@ import java.util.function.Supplier; import cyclops.async.Future; -import cyclops.collections.MapX; +import cyclops.collections.mutable.MapX; import org.jooq.lambda.tuple.Tuple; diff --git a/micro-async-data-writer/src/main/java/com/aol/micro/server/async/data/writer/ConfigureDataWriter.java b/micro-async-data-writer/src/main/java/com/aol/micro/server/async/data/writer/ConfigureDataWriter.java index 86c3effae..5c038c9c8 100644 --- a/micro-async-data-writer/src/main/java/com/aol/micro/server/async/data/writer/ConfigureDataWriter.java +++ b/micro-async-data-writer/src/main/java/com/aol/micro/server/async/data/writer/ConfigureDataWriter.java @@ -4,7 +4,7 @@ import java.util.concurrent.Executor; import java.util.concurrent.Executors; -import cyclops.collections.ListX; +import cyclops.collections.mutable.ListX; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; diff --git a/micro-async-data-writer/src/main/java/com/aol/micro/server/async/data/writer/MultiDataWriter.java b/micro-async-data-writer/src/main/java/com/aol/micro/server/async/data/writer/MultiDataWriter.java index 98e8cc8c1..f9b1c1217 100644 --- a/micro-async-data-writer/src/main/java/com/aol/micro/server/async/data/writer/MultiDataWriter.java +++ b/micro-async-data-writer/src/main/java/com/aol/micro/server/async/data/writer/MultiDataWriter.java @@ -3,7 +3,7 @@ import cyclops.async.Future; -import cyclops.collections.ListX; +import cyclops.collections.mutable.ListX; import lombok.AllArgsConstructor; @AllArgsConstructor diff --git a/micro-async-data-writer/src/main/java/com/aol/micro/server/async/data/writer/plugin/AsyncDataWriterPlugin.java b/micro-async-data-writer/src/main/java/com/aol/micro/server/async/data/writer/plugin/AsyncDataWriterPlugin.java index 31206aab8..e4379eb7b 100644 --- a/micro-async-data-writer/src/main/java/com/aol/micro/server/async/data/writer/plugin/AsyncDataWriterPlugin.java +++ b/micro-async-data-writer/src/main/java/com/aol/micro/server/async/data/writer/plugin/AsyncDataWriterPlugin.java @@ -6,7 +6,7 @@ import com.aol.micro.server.Plugin; import com.aol.micro.server.async.data.cleaner.ConfigureSchedulingAsyncDataWriter; import com.aol.micro.server.async.data.writer.ConfigureDataWriter; -import cyclops.collections.SetX; +import cyclops.collections.mutable.SetX; public class AsyncDataWriterPlugin implements Plugin { diff --git a/micro-async-data-writer/src/test/java/app/cleaner/off/scheduled/com/aol/micro/server/CouchbaseResource.java b/micro-async-data-writer/src/test/java/app/cleaner/off/scheduled/com/aol/micro/server/CouchbaseResource.java index 6bf20223f..9d30b5aaf 100644 --- a/micro-async-data-writer/src/test/java/app/cleaner/off/scheduled/com/aol/micro/server/CouchbaseResource.java +++ b/micro-async-data-writer/src/test/java/app/cleaner/off/scheduled/com/aol/micro/server/CouchbaseResource.java @@ -4,7 +4,7 @@ import javax.ws.rs.Path; import javax.ws.rs.Produces; -import cyclops.collections.immutable.PStackX; +import cyclops.collections.immutable.LinkedListX; import cyclops.control.Maybe; import org.springframework.beans.factory.annotation.Autowired; @@ -21,7 +21,7 @@ public class CouchbaseResource { private final DistributedMap client; - private volatile PStackX dataCleans = PStackX.empty(); + private volatile LinkedListX dataCleans = LinkedListX.empty(); @Autowired public CouchbaseResource(DistributedMap client, EventBus bus) { @@ -37,7 +37,7 @@ public synchronized void events(SystemData event) { @GET @Path("/cleaning-events") @Produces("application/json") - public synchronized PStackX cleaningEvents() { + public synchronized LinkedListX cleaningEvents() { return dataCleans; } diff --git a/micro-async-data-writer/src/test/java/app/cleaner/scheduled/com/aol/micro/server/CouchbaseResource.java b/micro-async-data-writer/src/test/java/app/cleaner/scheduled/com/aol/micro/server/CouchbaseResource.java index 4639a3c1a..cc0c3008e 100644 --- a/micro-async-data-writer/src/test/java/app/cleaner/scheduled/com/aol/micro/server/CouchbaseResource.java +++ b/micro-async-data-writer/src/test/java/app/cleaner/scheduled/com/aol/micro/server/CouchbaseResource.java @@ -4,7 +4,7 @@ import javax.ws.rs.Path; import javax.ws.rs.Produces; -import cyclops.collections.immutable.PStackX; +import cyclops.collections.immutable.LinkedListX; import cyclops.control.Maybe; import org.springframework.beans.factory.annotation.Autowired; @@ -21,7 +21,7 @@ public class CouchbaseResource { private final DistributedMap client; - private volatile PStackX dataCleans = PStackX.empty(); + private volatile LinkedListX dataCleans = LinkedListX.empty(); @Autowired public CouchbaseResource(DistributedMap client, EventBus bus) { @@ -37,7 +37,7 @@ public synchronized void events(SystemData event) { @GET @Path("/cleaning-events") @Produces("application/json") - public synchronized PStackX cleaningEvents() { + public synchronized LinkedListX cleaningEvents() { return dataCleans; } diff --git a/micro-async-data-writer/src/test/java/com/aol/micro/server/async/data/writer/MultiDataWriterTest.java b/micro-async-data-writer/src/test/java/com/aol/micro/server/async/data/writer/MultiDataWriterTest.java index c366009bb..321350e3b 100644 --- a/micro-async-data-writer/src/test/java/com/aol/micro/server/async/data/writer/MultiDataWriterTest.java +++ b/micro-async-data-writer/src/test/java/com/aol/micro/server/async/data/writer/MultiDataWriterTest.java @@ -3,7 +3,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.junit.Assert.assertThat; -import cyclops.collections.ListX; +import cyclops.collections.mutable.ListX; import org.junit.Before; import org.junit.Test; diff --git a/micro-client/src/main/java/com/aol/micro/server/rest/client/nio/ClientPlugin.java b/micro-client/src/main/java/com/aol/micro/server/rest/client/nio/ClientPlugin.java index 8269cc03a..9d0b7e30d 100644 --- a/micro-client/src/main/java/com/aol/micro/server/rest/client/nio/ClientPlugin.java +++ b/micro-client/src/main/java/com/aol/micro/server/rest/client/nio/ClientPlugin.java @@ -2,7 +2,7 @@ import com.aol.micro.server.Plugin; -import cyclops.collections.immutable.PSetX; +import cyclops.collections.immutable.PersistentSetX; /** * @@ -12,8 +12,8 @@ public class ClientPlugin implements Plugin{ @Override - public PSetX springClasses() { - return PSetX.of(SpringConfig.class); + public PersistentSetX springClasses() { + return PersistentSetX.of(SpringConfig.class); } diff --git a/micro-client/src/test/java/app/embedded/com/aol/micro/server/EmbeddedAppLocalMain.java b/micro-client/src/test/java/app/embedded/com/aol/micro/server/EmbeddedAppLocalMain.java index ec489d9f8..1c78d4229 100644 --- a/micro-client/src/test/java/app/embedded/com/aol/micro/server/EmbeddedAppLocalMain.java +++ b/micro-client/src/test/java/app/embedded/com/aol/micro/server/EmbeddedAppLocalMain.java @@ -4,7 +4,7 @@ import com.aol.micro.server.MicroserverApp; import com.aol.micro.server.config.Microserver; import com.aol.micro.server.module.EmbeddedModule; -import cyclops.collections.immutable.PStackX; +import cyclops.collections.immutable.LinkedListX; @Microserver(basePackages = { "app.embedded.com.aol.micro.server" }) public class EmbeddedAppLocalMain { @@ -13,8 +13,8 @@ public class EmbeddedAppLocalMain { public static void main(String[] args) throws InterruptedException { new MicroserverApp( - EmbeddedModule.tagInterfaceModule(PStackX.of(TestAppRestResource.class),"test-app"), - EmbeddedModule.tagInterfaceModule(PStackX.of(AltAppRestResource.class),"alternative-app")).start(); + EmbeddedModule.tagInterfaceModule(LinkedListX.of(TestAppRestResource.class),"test-app"), + EmbeddedModule.tagInterfaceModule(LinkedListX.of(AltAppRestResource.class),"alternative-app")).start(); diff --git a/micro-client/src/test/java/app/embedded/com/aol/micro/server/EmbeddedAppTest.java b/micro-client/src/test/java/app/embedded/com/aol/micro/server/EmbeddedAppTest.java index 767aff64a..174376f9d 100644 --- a/micro-client/src/test/java/app/embedded/com/aol/micro/server/EmbeddedAppTest.java +++ b/micro-client/src/test/java/app/embedded/com/aol/micro/server/EmbeddedAppTest.java @@ -10,7 +10,7 @@ import javax.ws.rs.NotFoundException; -import cyclops.collections.immutable.PStackX; +import cyclops.collections.immutable.LinkedListX; import jersey.repackaged.com.google.common.collect.ImmutableList; import org.junit.After; @@ -32,8 +32,8 @@ public class EmbeddedAppTest { @Before public void startServer(){ server = new MicroserverApp(EmbeddedAppLocalMain.class, - EmbeddedModule.tagInterfaceModule(PStackX.of(TestAppRestResource.class),"test-app"), - EmbeddedModule.tagInterfaceModule(PStackX.of(AltAppRestResource.class),"alternative-app")); + EmbeddedModule.tagInterfaceModule(LinkedListX.of(TestAppRestResource.class),"test-app"), + EmbeddedModule.tagInterfaceModule(LinkedListX.of(AltAppRestResource.class),"alternative-app")); server.start(); } diff --git a/micro-client/src/test/java/com/aol/micro/server/client/TestPlugin.java b/micro-client/src/test/java/com/aol/micro/server/client/TestPlugin.java index e3ebec376..7a86a1208 100644 --- a/micro-client/src/test/java/com/aol/micro/server/client/TestPlugin.java +++ b/micro-client/src/test/java/com/aol/micro/server/client/TestPlugin.java @@ -2,10 +2,10 @@ import com.aol.micro.server.Plugin; -import cyclops.collections.immutable.PStackX; +import cyclops.collections.immutable.LinkedListX; public class TestPlugin implements Plugin { - public PStackX providers(){ - return PStackX.empty(); + public LinkedListX providers(){ + return LinkedListX.empty(); } } diff --git a/micro-core/src/main/java/com/aol/micro/server/GlobalState.java b/micro-core/src/main/java/com/aol/micro/server/GlobalState.java index 12706f79f..b25ed260a 100644 --- a/micro-core/src/main/java/com/aol/micro/server/GlobalState.java +++ b/micro-core/src/main/java/com/aol/micro/server/GlobalState.java @@ -3,7 +3,7 @@ import com.aol.micro.server.module.Module; -import cyclops.collections.ListX; +import cyclops.collections.mutable.ListX; import lombok.Getter; import lombok.Setter; diff --git a/micro-core/src/main/java/com/aol/micro/server/MicroserverApp.java b/micro-core/src/main/java/com/aol/micro/server/MicroserverApp.java index 27bf84e43..eedac64db 100644 --- a/micro-core/src/main/java/com/aol/micro/server/MicroserverApp.java +++ b/micro-core/src/main/java/com/aol/micro/server/MicroserverApp.java @@ -4,8 +4,8 @@ import java.util.concurrent.CompletableFuture; import com.aol.cyclops2.util.ExceptionSoftener; -import cyclops.Streams; -import cyclops.collections.ListX; +import cyclops.companion.Streams; +import cyclops.collections.mutable.ListX; import cyclops.stream.ReactiveSeq; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/micro-core/src/main/java/com/aol/micro/server/Plugin.java b/micro-core/src/main/java/com/aol/micro/server/Plugin.java index 845ff3e7a..36514b7d7 100644 --- a/micro-core/src/main/java/com/aol/micro/server/Plugin.java +++ b/micro-core/src/main/java/com/aol/micro/server/Plugin.java @@ -19,9 +19,9 @@ import com.aol.micro.server.spring.SpringBuilder; import com.aol.micro.server.spring.SpringDBConfig; import com.fasterxml.jackson.databind.Module; -import cyclops.collections.immutable.PMapX; -import cyclops.collections.immutable.PSetX; -import cyclops.collections.immutable.PStackX; +import cyclops.collections.immutable.PersistentMapX; +import cyclops.collections.immutable.PersistentSetX; +import cyclops.collections.immutable.LinkedListX; /** * To implement a plugin for Microserver, implement this interface in your library and add the fully resolved class name to @@ -50,7 +50,7 @@ default Optional restServletConfiguration(){ * @return Jackson feature properties */ default Function> jacksonFeatureProperties(){ - return context->PMapX.empty(); + return context->PersistentMapX.empty(); } /** * @return jax-rs Application name @@ -69,25 +69,25 @@ default Optional serverApplicationFactory(){ * @return Jackson modules for this plugin */ default Set jacksonModules(){ - return PSetX.empty(); + return PersistentSetX.empty(); } /** * @return jax-rs Resources (Objects) for this plugin */ default Set jaxRsResourceObjects(){ - return PSetX.empty(); + return PersistentSetX.empty(); } /** * @return jax-rs Resources (Classes) for this plugin */ default Set> jaxRsResources(){ - return PSetX.empty(); + return PersistentSetX.empty(); } /** * @return jax-rs Packages for this plugin */ default Set jaxRsPackages(){ - return PSetX.empty(); + return PersistentSetX.empty(); } /** * @return Used for configuring Data Beans (or other Beans) directly into the ApplicationContext @@ -99,43 +99,43 @@ default Optional springDbConfigurer(){ * @return Spring configuration classes for this plugin */ default Set springClasses(){ - return PSetX.empty(); + return PersistentSetX.empty(); } /** * @return Servlet Context Listeners for this plugin */ default Set> servletContextListeners(){ - return PSetX.empty(); + return PersistentSetX.empty(); } /** * @return Servlet Request Listeners for this plugin */ default Set> servletRequestListeners(){ - return PSetX.empty(); + return PersistentSetX.empty(); } /** * @return Filters for this plugin */ default Function> filters(){ - return serverData -> PMapX.empty(); + return serverData -> PersistentMapX.empty(); } /** * @return Servlets for this plugin */ default Function> servlets(){ - return serverData -> PMapX.empty(); + return serverData -> PersistentMapX.empty(); } /** * @return jax-rs Providers for this plugin */ default List providers(){ - return PStackX.empty(); + return LinkedListX.empty(); } /** * @return Jersey server properties for this plugin */ default Map getServerProperties() { - return PMapX.empty(); + return PersistentMapX.empty(); } } diff --git a/micro-core/src/main/java/com/aol/micro/server/PluginLoader.java b/micro-core/src/main/java/com/aol/micro/server/PluginLoader.java index 7e19b1081..d8c57043b 100644 --- a/micro-core/src/main/java/com/aol/micro/server/PluginLoader.java +++ b/micro-core/src/main/java/com/aol/micro/server/PluginLoader.java @@ -3,7 +3,7 @@ import java.util.ServiceLoader; import java.util.function.Supplier; -import cyclops.collections.ListX; +import cyclops.collections.mutable.ListX; import cyclops.function.FluentFunctions; import cyclops.stream.ReactiveSeq; import lombok.AccessLevel; diff --git a/micro-core/src/main/java/com/aol/micro/server/module/ConfigurableModule.java b/micro-core/src/main/java/com/aol/micro/server/module/ConfigurableModule.java index 67d3c74f4..4e7852042 100644 --- a/micro-core/src/main/java/com/aol/micro/server/module/ConfigurableModule.java +++ b/micro-core/src/main/java/com/aol/micro/server/module/ConfigurableModule.java @@ -22,9 +22,9 @@ import com.aol.micro.server.servers.model.ServerData; import com.aol.micro.server.utility.HashMapBuilder; -import cyclops.collections.immutable.PMapX; -import cyclops.collections.immutable.PSetX; -import cyclops.collections.immutable.PStackX; +import cyclops.collections.immutable.PersistentMapX; +import cyclops.collections.immutable.PersistentSetX; +import cyclops.collections.immutable.LinkedListX; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.experimental.Wither; @@ -87,7 +87,7 @@ public ConfigurableModule withServerConfigManager(Consumer getJaxRsResourceObjects() { if (this.jaxRsResourceObjects != null) - return PSetX.fromCollection(concat(this.jaxRsResourceObjects, extract(() -> Module.super.getJaxRsResourceObjects()))); + return PersistentSetX.fromIterable(concat(this.jaxRsResourceObjects, extract(() -> Module.super.getJaxRsResourceObjects()))); return Module.super.getJaxRsResourceObjects(); } @@ -110,9 +110,9 @@ public Consumer> getResourceConfigManager() { @Override public List getDefaultJaxRsPackages() { if (defaultJaxRsPackages != null) - return PStackX.fromCollection(concat(defaultJaxRsPackages, extract(() -> Module.super.getDefaultJaxRsPackages()))); + return LinkedListX.fromIterable(concat(defaultJaxRsPackages, extract(() -> Module.super.getDefaultJaxRsPackages()))); - return PStackX.fromCollection(Module.super.getDefaultJaxRsPackages()); + return LinkedListX.fromIterable(Module.super.getDefaultJaxRsPackages()); } private Collection extract(Supplier> s) { @@ -130,7 +130,7 @@ private Map extractMap(Supplier> s) { @Override public Set> getRestResourceClasses() { if (restResourceClasses != null) - return PSetX.fromCollection(concat(restResourceClasses, extract(() -> Collections.singletonList(CommonRestResource.class)))); + return PersistentSetX.fromIterable(concat(restResourceClasses, extract(() -> Collections.singletonList(CommonRestResource.class)))); return Module.super.getRestResourceClasses(); } @@ -138,7 +138,7 @@ public Set> getRestResourceClasses() { @Override public Set> getRestAnnotationClasses() { if (restAnnotationClasses != null) - return PSetX.fromCollection(concat(restAnnotationClasses, extract(() -> Module.super.getRestAnnotationClasses()))); + return PersistentSetX.fromIterable(concat(restAnnotationClasses, extract(() -> Module.super.getRestAnnotationClasses()))); return Module.super.getRestAnnotationClasses(); } @@ -146,7 +146,7 @@ public Set> getRestAnnotationClasses() { @Override public List> getDefaultResources() { if (this.defaultResources != null) { - return PStackX.fromCollection((concat(this.defaultResources, extract(() -> Module.super.getDefaultResources())))); + return LinkedListX.fromIterable((concat(this.defaultResources, extract(() -> Module.super.getDefaultResources())))); } return Module.super.getDefaultResources(); @@ -155,7 +155,7 @@ public List> getDefaultResources() { @Override public List getListeners(ServerData data) { if (listeners != null) - return PStackX.fromCollection((concat(this.listeners, extract(() -> Module.super.getListeners(data))))); + return LinkedListX.fromIterable((concat(this.listeners, extract(() -> Module.super.getListeners(data))))); return Module.super.getListeners(data); } @@ -163,7 +163,7 @@ public List getListeners(ServerData data) { @Override public List getRequestListeners(ServerData data) { if (requestListeners != null) - return PStackX.fromCollection(concat(this.requestListeners, + return LinkedListX.fromIterable(concat(this.requestListeners, extract(() -> Module.super.getRequestListeners(data)))); return Module.super.getRequestListeners(data); @@ -172,7 +172,7 @@ public List getRequestListeners(ServerData data) { @Override public Map getFilters(ServerData data) { if (filters != null) - return PMapX.fromMap(filters).plusAll(extractMap(() -> Module.super.getFilters(data))); + return PersistentMapX.fromMap(filters).plusAll(extractMap(() -> Module.super.getFilters(data))); return Module.super.getFilters(data); } @@ -180,7 +180,7 @@ public Map getFilters(ServerData data) { @Override public Map getServlets(ServerData data) { if (servlets != null) - return PMapX.fromMap(servlets).plusAll(extractMap(() -> Module.super.getServlets(data))); + return PersistentMapX.fromMap(servlets).plusAll(extractMap(() -> Module.super.getServlets(data))); return Module.super.getServlets(data); } @@ -208,7 +208,7 @@ public String getContext() { @Override public Set> getSpringConfigurationClasses() { if (this.springConfigurationClasses != null) - return PSetX.fromCollection(concat(this.springConfigurationClasses, extract(() -> Module.super.getSpringConfigurationClasses()))); + return PersistentSetX.fromIterable(concat(this.springConfigurationClasses, extract(() -> Module.super.getSpringConfigurationClasses()))); return Module.super.getSpringConfigurationClasses(); } @@ -216,7 +216,7 @@ public Set> getSpringConfigurationClasses() { @Override public Map getServerProperties() { if (serverProperties != null) { - return PMapX.fromMap(serverProperties).plusAll(extractMap(() -> Module.super.getServerProperties())); + return PersistentMapX.fromMap(serverProperties).plusAll(extractMap(() -> Module.super.getServerProperties())); } else { return Module.super.getServerProperties(); } diff --git a/micro-core/src/main/java/com/aol/micro/server/module/EmbeddedModule.java b/micro-core/src/main/java/com/aol/micro/server/module/EmbeddedModule.java index 44819da02..dab3bf1e4 100644 --- a/micro-core/src/main/java/com/aol/micro/server/module/EmbeddedModule.java +++ b/micro-core/src/main/java/com/aol/micro/server/module/EmbeddedModule.java @@ -3,25 +3,25 @@ import java.lang.annotation.Annotation; -import cyclops.collections.immutable.PSetX; +import cyclops.collections.immutable.PersistentSetX; import lombok.Getter; @Getter public class EmbeddedModule implements Module { - private final PSetX> restAnnotationClasses; - private final PSetX> restResourceClasses; + private final PersistentSetX> restAnnotationClasses; + private final PersistentSetX> restResourceClasses; private final String context; private EmbeddedModule(Iterable> restAnnotationClasses, String context){ - this.restAnnotationClasses = PSetX.fromIterable(restAnnotationClasses); + this.restAnnotationClasses = PersistentSetX.fromIterable(restAnnotationClasses); this.context = context; - this.restResourceClasses = PSetX.empty(); + this.restResourceClasses = PersistentSetX.empty(); } private EmbeddedModule(String context, Iterable> restTagClasses){ this.context = context; - this.restResourceClasses = PSetX.fromIterable(restTagClasses); - this.restAnnotationClasses = PSetX.empty(); + this.restResourceClasses = PersistentSetX.fromIterable(restTagClasses); + this.restAnnotationClasses = PersistentSetX.empty(); } public static EmbeddedModule annotationModule(Iterable> restAnnotationClasses, String context){ diff --git a/micro-core/src/main/java/com/aol/micro/server/module/Module.java b/micro-core/src/main/java/com/aol/micro/server/module/Module.java index 05bc7841c..379892a81 100644 --- a/micro-core/src/main/java/com/aol/micro/server/module/Module.java +++ b/micro-core/src/main/java/com/aol/micro/server/module/Module.java @@ -6,12 +6,12 @@ import com.aol.micro.server.auto.discovery.RestResource; import com.aol.micro.server.config.Classes; import com.aol.micro.server.servers.model.ServerData; -import cyclops.Streams; -import cyclops.collections.ListX; -import cyclops.collections.SetX; -import cyclops.collections.immutable.PMapX; -import cyclops.collections.immutable.PSetX; -import cyclops.collections.immutable.PStackX; +import cyclops.companion.Streams; +import cyclops.collections.mutable.ListX; +import cyclops.collections.mutable.SetX; +import cyclops.collections.immutable.PersistentMapX; +import cyclops.collections.immutable.PersistentSetX; +import cyclops.collections.immutable.LinkedListX; import cyclops.stream.ReactiveSeq; import org.springframework.util.StringUtils; import org.springframework.web.context.ContextLoaderListener; @@ -30,11 +30,11 @@ public interface Module { default Set getJaxRsResourceObjects() { return PluginLoader.INSTANCE.plugins.get() .flatMap(Plugin::jaxRsResourceObjects) - .toPSetX(); + .to().persistentSetX(); } default Map getServerProperties() { - return PMapX.empty(); + return PersistentMapX.empty(); } default Consumer> getServerConfigManager() { @@ -48,19 +48,19 @@ default Consumer> getResourceConfigManager() { } default List getPackages() { - return PStackX.empty(); + return LinkedListX.empty(); } default Map getPropertyOverrides() { - return PMapX.empty(); + return PersistentMapX.empty(); } default Set> getSpringConfigurationClasses() { - return PSetX.of(Classes.CORE_CLASSES.getClasses()); + return PersistentSetX.of(Classes.CORE_CLASSES.getClasses()); } default Set> getRestResourceClasses() { - return PSetX.of(RestResource.class); + return PersistentSetX.of(RestResource.class); } default Set> getRestAnnotationClasses() { @@ -74,7 +74,7 @@ default List getDefaultJaxRsPackages() { .filter(module -> module.servletContextListeners() != null) .flatMapI(Plugin::jaxRsPackages) - .toPStackX(); + .to().linkedListX(); } @@ -82,7 +82,7 @@ default List> getDefaultResources() { return PluginLoader.INSTANCE.plugins.get() .stream() .flatMapI(Plugin::jaxRsResources) - .toPStackX(); + .to().linkedListX(); } @@ -95,11 +95,11 @@ default List getListeners(ServerData data) { ListX modules = PluginLoader.INSTANCE.plugins.get(); - PStackX listeners = modules.stream() + LinkedListX listeners = modules.stream() .filter(module -> module.servletContextListeners() != null) .flatMapI(Plugin::servletContextListeners) .map(fn -> fn.apply(data)) - .toPStackX(); + .to().linkedListX(); return listeners.plusAll(list); } @@ -111,7 +111,7 @@ default List getRequestListeners(ServerData data) { .filter(module -> module.servletRequestListeners() != null) .flatMapI(Plugin::servletRequestListeners) .map(fn -> fn.apply(data)) - .toPStackX(); + .to().linkedListX(); } @@ -124,7 +124,7 @@ default Map getFilters(ServerData data) { .map(module -> module.filters() .apply(data)) .forEach(pluginMap -> map.putAll(pluginMap)); - return PMapX.fromMap(map); + return PersistentMapX.fromMap(map); } default Map getServlets(ServerData data) { @@ -135,7 +135,7 @@ default Map getServlets(ServerData data) { .map(module -> module.servlets() .apply(data)) .forEach(pluginMap -> map.putAll(pluginMap)); - return PMapX.fromMap(map); + return PersistentMapX.fromMap(map); } diff --git a/micro-core/src/main/java/com/aol/micro/server/module/ModuleDataExtractor.java b/micro-core/src/main/java/com/aol/micro/server/module/ModuleDataExtractor.java index 7c6c5d241..34d322994 100644 --- a/micro-core/src/main/java/com/aol/micro/server/module/ModuleDataExtractor.java +++ b/micro-core/src/main/java/com/aol/micro/server/module/ModuleDataExtractor.java @@ -8,7 +8,7 @@ import javax.servlet.Filter; import javax.servlet.Servlet; -import cyclops.collections.immutable.PStackX; +import cyclops.collections.immutable.LinkedListX; import org.springframework.context.ApplicationContext; import org.springframework.web.filter.DelegatingFilterProxy; @@ -26,7 +26,7 @@ public class ModuleDataExtractor { private final Module module; - public PStackX getRestResources(ApplicationContext rootContext){ + public LinkedListX getRestResources(ApplicationContext rootContext){ List resources = new ArrayList<>(); module.getRestResourceClasses().forEach(it -> resources.addAll(rootContext.getBeansOfType(it).values())); @@ -34,7 +34,7 @@ public PStackX getRestResources(ApplicationContext rootContext){ rootContext.getBeansWithAnnotation(JaxRsResource.class).forEach((n,it)->resources.add(it)); rootContext.getBeansOfType(JaxRsResourceWrapper.class).forEach((n,it)->resources.add(it.getResource())); resources.addAll(module.getJaxRsResourceObjects()); - return PStackX.fromCollection(resources); + return LinkedListX.fromIterable(resources); } diff --git a/micro-core/src/main/java/com/aol/micro/server/module/RestResourceTagBuilder.java b/micro-core/src/main/java/com/aol/micro/server/module/RestResourceTagBuilder.java index ded3e6388..8e72d4d4b 100644 --- a/micro-core/src/main/java/com/aol/micro/server/module/RestResourceTagBuilder.java +++ b/micro-core/src/main/java/com/aol/micro/server/module/RestResourceTagBuilder.java @@ -8,7 +8,7 @@ import java.util.stream.Stream; import com.aol.cyclops2.util.ExceptionSoftener; -import cyclops.collections.immutable.PSetX; +import cyclops.collections.immutable.PersistentSetX; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -23,19 +23,19 @@ public class RestResourceTagBuilder { private final static Logger logger = LoggerFactory.getLogger(RestResourceTagBuilder.class); @Setter - private static PSetX> defaultTags= PSetX.of(CommonRestResource.class); + private static PersistentSetX> defaultTags= PersistentSetX.of(CommonRestResource.class); - public static PSetX> restResourceTags(String... classes){ - return (PSetX)PSetX.fromCollection(concat(Stream.of(classes).map(cl -> toClass(cl)).collect(Collectors.toList()),defaultTags)); + public static PersistentSetX> restResourceTags(String... classes){ + return (PersistentSetX)PersistentSetX.fromIterable(concat(Stream.of(classes).map(cl -> toClass(cl)).collect(Collectors.toList()),defaultTags)); } - public static PSetX> restResourceTags(Class... classes){ - return (PSetX)PSetX.fromCollection(concat((List)Stream.of(classes).collect(Collectors.toList()),defaultTags)); + public static PersistentSetX> restResourceTags(Class... classes){ + return (PersistentSetX)PersistentSetX.fromIterable(concat((List)Stream.of(classes).collect(Collectors.toList()),defaultTags)); } - public static PSetX> restAnnotations(String... classes){ - return (PSetX)PSetX.fromCollection(concat(Stream.of(classes).map(cl -> toClass(cl)).collect(Collectors.toList()),defaultTags)); + public static PersistentSetX> restAnnotations(String... classes){ + return (PersistentSetX)PersistentSetX.fromIterable(concat(Stream.of(classes).map(cl -> toClass(cl)).collect(Collectors.toList()),defaultTags)); } - public static PSetX> restAnnotations(Class... classes){ - return (PSetX)PSetX.fromCollection(concat(Stream.of(classes).collect(Collectors.toList()),defaultTags)); + public static PersistentSetX> restAnnotations(Class... classes){ + return (PersistentSetX)PersistentSetX.fromIterable(concat(Stream.of(classes).collect(Collectors.toList()),defaultTags)); } private static Class toClass(String cl) { diff --git a/micro-core/src/main/java/com/aol/micro/server/servers/JaxRsServletConfigurer.java b/micro-core/src/main/java/com/aol/micro/server/servers/JaxRsServletConfigurer.java index 3f1ecd34c..b59f85aed 100644 --- a/micro-core/src/main/java/com/aol/micro/server/servers/JaxRsServletConfigurer.java +++ b/micro-core/src/main/java/com/aol/micro/server/servers/JaxRsServletConfigurer.java @@ -11,7 +11,7 @@ import com.aol.micro.server.module.IncorrectJaxRsPluginsException; import com.aol.micro.server.rest.RestConfiguration; import com.aol.micro.server.servers.model.ServerData; -import cyclops.Streams; +import cyclops.companion.Streams; import cyclops.stream.ReactiveSeq; public class JaxRsServletConfigurer { diff --git a/micro-core/src/main/java/com/aol/micro/server/servers/model/ServerData.java b/micro-core/src/main/java/com/aol/micro/server/servers/model/ServerData.java index f88de5eb1..8d6d49b5e 100644 --- a/micro-core/src/main/java/com/aol/micro/server/servers/model/ServerData.java +++ b/micro-core/src/main/java/com/aol/micro/server/servers/model/ServerData.java @@ -5,7 +5,7 @@ import javax.ws.rs.Path; -import cyclops.collections.immutable.PStackX; +import cyclops.collections.immutable.LinkedListX; import cyclops.stream.ReactiveSeq; import lombok.Getter; import lombok.Builder; @@ -26,7 +26,7 @@ public class ServerData { private final int port; - private final PStackX resources; + private final LinkedListX resources; private final ApplicationContext rootContext; private final String baseUrlPattern; private final Module module; @@ -37,7 +37,7 @@ public ServerData(int port, List resources, this.port = port; this.module = module; - this.resources = resources==null ? PStackX.of() : PStackX.fromCollection(resources); + this.resources = resources==null ? LinkedListX.of() : LinkedListX.fromIterable(resources); this.rootContext = rootContext; this.baseUrlPattern = baseUrlPattern; } diff --git a/micro-core/src/main/java/com/aol/micro/server/spring/SpringApplicationConfigurator.java b/micro-core/src/main/java/com/aol/micro/server/spring/SpringApplicationConfigurator.java index 1cc575f8e..6587f7edc 100644 --- a/micro-core/src/main/java/com/aol/micro/server/spring/SpringApplicationConfigurator.java +++ b/micro-core/src/main/java/com/aol/micro/server/spring/SpringApplicationConfigurator.java @@ -2,7 +2,7 @@ import java.util.List; -import cyclops.Streams; +import cyclops.companion.Streams; import cyclops.stream.ReactiveSeq; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/micro-core/src/test/java/com/aol/micro/server/module/ConfigurableModuleTest.java b/micro-core/src/test/java/com/aol/micro/server/module/ConfigurableModuleTest.java index 1af566791..83b15b908 100644 --- a/micro-core/src/test/java/com/aol/micro/server/module/ConfigurableModuleTest.java +++ b/micro-core/src/test/java/com/aol/micro/server/module/ConfigurableModuleTest.java @@ -21,8 +21,8 @@ import javax.servlet.ServletContextListener; import javax.servlet.ServletRequestListener; -import cyclops.collections.SetX; -import cyclops.collections.immutable.PStackX; +import cyclops.collections.mutable.SetX; +import cyclops.collections.immutable.LinkedListX; import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -66,8 +66,8 @@ public void setup(){ defaultResources = new ArrayList<>(); filters = HashMapBuilder.map("/*1",new DummyQueryIPRetriever()).build(); jaxWsRsApplication = "jaxRsApp2"; - listeners = m.getListeners(ServerData.builder().resources(PStackX.empty()).build()); - requestListeners = m.getRequestListeners(ServerData.builder().resources(PStackX.empty()).build()); + listeners = m.getListeners(ServerData.builder().resources(LinkedListX.empty()).build()); + requestListeners = m.getRequestListeners(ServerData.builder().resources(LinkedListX.empty()).build()); providers = "providers2"; Module m = () -> "hello"; resourceClasses = SetX.empty(); @@ -178,60 +178,60 @@ public void testGetDefaultResourcesUnchanged() { @Test public void testGetListeners() { - assertThat(module.getListeners(ServerData.builder().resources(PStackX.of()).build()).size(), - is(m.getListeners(ServerData.builder().resources(PStackX.of()).build()).size()*2)); //doubled + assertThat(module.getListeners(ServerData.builder().resources(LinkedListX.of()).build()).size(), + is(m.getListeners(ServerData.builder().resources(LinkedListX.of()).build()).size()*2)); //doubled } @Test public void testGetListenersReset() { - assertThat(module.withResetAll(true).getListeners(ServerData.builder().resources(PStackX.of()).build()),is(this.listeners)); + assertThat(module.withResetAll(true).getListeners(ServerData.builder().resources(LinkedListX.of()).build()),is(this.listeners)); } @Test public void testGetListenersUnchanged() { - assertThat(unchanged.getListeners(ServerData.builder().resources(PStackX.empty()).build()).size() , - is(m.getListeners(ServerData.builder().resources(PStackX.empty()).build()).size())); + assertThat(unchanged.getListeners(ServerData.builder().resources(LinkedListX.empty()).build()).size() , + is(m.getListeners(ServerData.builder().resources(LinkedListX.empty()).build()).size())); } @Test public void testGetRequestListeners() { - assertThat(module.getRequestListeners(ServerData.builder().resources(PStackX.of()).build()).size(), - is(m.getRequestListeners(ServerData.builder().resources(PStackX.of()).build()).size()*2)); //doubled + assertThat(module.getRequestListeners(ServerData.builder().resources(LinkedListX.of()).build()).size(), + is(m.getRequestListeners(ServerData.builder().resources(LinkedListX.of()).build()).size()*2)); //doubled } @Test public void testGetRequestListenersReset() { - assertThat(module.withResetAll(true).getRequestListeners(ServerData.builder().resources(PStackX.of()).build()),is(this.requestListeners)); + assertThat(module.withResetAll(true).getRequestListeners(ServerData.builder().resources(LinkedListX.of()).build()),is(this.requestListeners)); } @Test public void testGetRequestListenersUnchanged() { - assertThat(unchanged.getRequestListeners(ServerData.builder().resources(PStackX.of()).build()).size() , - is(m.getRequestListeners(ServerData.builder().resources(PStackX.of()).build()).size())); + assertThat(unchanged.getRequestListeners(ServerData.builder().resources(LinkedListX.of()).build()).size() , + is(m.getRequestListeners(ServerData.builder().resources(LinkedListX.of()).build()).size())); } @Test public void testGetFilters() { - assertThat(module.getFilters(ServerData.builder().resources(PStackX.of()).build()).size(), + assertThat(module.getFilters(ServerData.builder().resources(LinkedListX.of()).build()).size(), is(1 )); } @Test public void testGetFiltersReset() { - assertThat(module.withResetAll(true).getFilters(ServerData.builder().resources(PStackX.of()).build()),is(this.filters)); + assertThat(module.withResetAll(true).getFilters(ServerData.builder().resources(LinkedListX.of()).build()),is(this.filters)); } @Test public void testGetFiltersUnchanged() { - assertThat(unchanged.getFilters(ServerData.builder().resources(PStackX.of()).build()).size(), - equalTo(m.getFilters( ServerData.builder().resources(PStackX.of()).build() ).size())); + assertThat(unchanged.getFilters(ServerData.builder().resources(LinkedListX.of()).build()).size(), + equalTo(m.getFilters( ServerData.builder().resources(LinkedListX.of()).build() ).size())); } @Test public void testGetServlets() { - assertThat(module.getServlets(ServerData.builder().resources(PStackX.of()).build()),is(this.servlets)); + assertThat(module.getServlets(ServerData.builder().resources(LinkedListX.of()).build()),is(this.servlets)); } @Test public void testGetServletsUnchanged() { - assertThat(unchanged.getServlets(ServerData.builder().resources(PStackX.of()).build()),is(m.getServlets(ServerData.builder().resources(PStackX.of()).build()))); + assertThat(unchanged.getServlets(ServerData.builder().resources(LinkedListX.of()).build()),is(m.getServlets(ServerData.builder().resources(LinkedListX.of()).build()))); } @Test @@ -293,21 +293,21 @@ public void testWithDefaultResources() { @Test public void testWithListeners() { - assertThat(unchanged.withListeners(this.listeners).getListeners(ServerData.builder().resources(PStackX.of()).build()).size(), - is(module.getListeners(ServerData.builder().resources(PStackX.of()).build()).size())); + assertThat(unchanged.withListeners(this.listeners).getListeners(ServerData.builder().resources(LinkedListX.of()).build()).size(), + is(module.getListeners(ServerData.builder().resources(LinkedListX.of()).build()).size())); } @Test public void testWithFilters() { - assertThat(unchanged.withFilters(this.filters).getFilters(ServerData.builder().resources(PStackX.of()).build()).size(), - is(module.getFilters(ServerData.builder().resources(PStackX.of()).build()).size())); + assertThat(unchanged.withFilters(this.filters).getFilters(ServerData.builder().resources(LinkedListX.of()).build()).size(), + is(module.getFilters(ServerData.builder().resources(LinkedListX.of()).build()).size())); } @Test public void testWithServlets() { - assertThat(unchanged.withServlets(this.servlets).getServlets(ServerData.builder().resources(PStackX.of()).build()).size(), - is(m.getServlets(ServerData.builder().resources(PStackX.of()).build()).size())); + assertThat(unchanged.withServlets(this.servlets).getServlets(ServerData.builder().resources(LinkedListX.of()).build()).size(), + is(m.getServlets(ServerData.builder().resources(LinkedListX.of()).build()).size())); } diff --git a/micro-core/src/test/java/com/aol/micro/server/module/ModuleDataExtractorTest.java b/micro-core/src/test/java/com/aol/micro/server/module/ModuleDataExtractorTest.java index 21080b8d7..5d89cfe11 100644 --- a/micro-core/src/test/java/com/aol/micro/server/module/ModuleDataExtractorTest.java +++ b/micro-core/src/test/java/com/aol/micro/server/module/ModuleDataExtractorTest.java @@ -13,7 +13,7 @@ import javax.servlet.Filter; import javax.servlet.http.HttpServlet; -import cyclops.collections.immutable.PStackX; +import cyclops.collections.immutable.LinkedListX; import org.junit.Before; import org.junit.Test; import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; @@ -41,7 +41,7 @@ public void setup(){ .build(); extractor = new ModuleDataExtractor(module); rootContext = mock(AnnotationConfigWebApplicationContext.class); - data = ServerData.builder().resources(PStackX.of()).module(module).build(); + data = ServerData.builder().resources(LinkedListX.of()).module(module).build(); } diff --git a/micro-core/src/test/java/com/aol/micro/server/module/MyPlugin.java b/micro-core/src/test/java/com/aol/micro/server/module/MyPlugin.java index 4602a15d6..197f56582 100644 --- a/micro-core/src/test/java/com/aol/micro/server/module/MyPlugin.java +++ b/micro-core/src/test/java/com/aol/micro/server/module/MyPlugin.java @@ -2,10 +2,10 @@ import com.aol.micro.server.Plugin; -import cyclops.collections.immutable.PStackX; +import cyclops.collections.immutable.LinkedListX; public class MyPlugin implements Plugin{ - public PStackX providers(){ - return PStackX.of("com.my.new.provider","com.my.new.provider2"); + public LinkedListX providers(){ + return LinkedListX.of("com.my.new.provider","com.my.new.provider2"); } } \ No newline at end of file diff --git a/micro-cors/src/main/java/com/aol/micro/server/web/cors/CorsPlugin.java b/micro-cors/src/main/java/com/aol/micro/server/web/cors/CorsPlugin.java index 5fcdd3489..d0161733b 100644 --- a/micro-cors/src/main/java/com/aol/micro/server/web/cors/CorsPlugin.java +++ b/micro-cors/src/main/java/com/aol/micro/server/web/cors/CorsPlugin.java @@ -2,13 +2,13 @@ import com.aol.micro.server.Plugin; -import cyclops.collections.immutable.PSetX; +import cyclops.collections.immutable.PersistentSetX; public class CorsPlugin implements Plugin { @Override - public PSetX springClasses() { - return PSetX.of(ConfigureBeans.class); + public PersistentSetX springClasses() { + return PersistentSetX.of(ConfigureBeans.class); } } diff --git a/micro-couchbase/src/main/java/com/aol/micro/server/couchbase/CouchbasePlugin.java b/micro-couchbase/src/main/java/com/aol/micro/server/couchbase/CouchbasePlugin.java index c80828b45..1e4f6d6e4 100644 --- a/micro-couchbase/src/main/java/com/aol/micro/server/couchbase/CouchbasePlugin.java +++ b/micro-couchbase/src/main/java/com/aol/micro/server/couchbase/CouchbasePlugin.java @@ -1,11 +1,11 @@ package com.aol.micro.server.couchbase; import com.aol.micro.server.Plugin; -import cyclops.collections.immutable.PSetX; +import cyclops.collections.immutable.PersistentSetX; public class CouchbasePlugin implements Plugin { - public PSetX springClasses() { - return PSetX.of(ConfigureCouchbase.class); + public PersistentSetX springClasses() { + return PersistentSetX.of(ConfigureCouchbase.class); } } diff --git a/micro-curator/src/main/java/com/aol/micro/server/curator/CuratorPlugin.java b/micro-curator/src/main/java/com/aol/micro/server/curator/CuratorPlugin.java index bc91cc875..ad65540e0 100644 --- a/micro-curator/src/main/java/com/aol/micro/server/curator/CuratorPlugin.java +++ b/micro-curator/src/main/java/com/aol/micro/server/curator/CuratorPlugin.java @@ -2,11 +2,11 @@ import com.aol.micro.server.Plugin; import com.aol.micro.server.curator.lock.CuratorDistributedLockServiceProvider; -import cyclops.collections.immutable.PSetX; +import cyclops.collections.immutable.PersistentSetX; public class CuratorPlugin implements Plugin { @Override - public PSetX springClasses() { - return PSetX.of(CuratorDistributedLockServiceProvider.class); + public PersistentSetX springClasses() { + return PersistentSetX.of(CuratorDistributedLockServiceProvider.class); } } diff --git a/micro-dbcp/src/main/java/com/aol/micro/server/spring/DBCPPlugin.java b/micro-dbcp/src/main/java/com/aol/micro/server/spring/DBCPPlugin.java index 687f5da7e..8ee589a50 100644 --- a/micro-dbcp/src/main/java/com/aol/micro/server/spring/DBCPPlugin.java +++ b/micro-dbcp/src/main/java/com/aol/micro/server/spring/DBCPPlugin.java @@ -10,7 +10,7 @@ import com.aol.micro.server.servers.model.ServerData; import com.aol.micro.server.spring.datasource.DBCPConfig; import com.aol.micro.server.spring.datasource.DBCPDataSourceBuilder; -import cyclops.collections.immutable.PSetX; +import cyclops.collections.immutable.PersistentSetX; /** * @@ -20,8 +20,8 @@ public class DBCPPlugin implements Plugin { @Override - public PSetX springClasses() { - return PSetX.of(DBCPConfig.class, DBCPDataSourceBuilder.class); + public PersistentSetX springClasses() { + return PersistentSetX.of(DBCPConfig.class, DBCPDataSourceBuilder.class); } diff --git a/micro-dist-lock/src/main/java/com/aol/micro/server/dist/lock/DistLockPlugin.java b/micro-dist-lock/src/main/java/com/aol/micro/server/dist/lock/DistLockPlugin.java index 2dc63a96d..d1be7f4d3 100644 --- a/micro-dist-lock/src/main/java/com/aol/micro/server/dist/lock/DistLockPlugin.java +++ b/micro-dist-lock/src/main/java/com/aol/micro/server/dist/lock/DistLockPlugin.java @@ -2,7 +2,7 @@ import com.aol.micro.server.Plugin; import com.aol.micro.server.dist.lock.rest.DistLockResource; -import cyclops.collections.immutable.PSetX; +import cyclops.collections.immutable.PersistentSetX; /** * @@ -11,8 +11,8 @@ */ public class DistLockPlugin implements Plugin { @Override - public PSetX springClasses() { - return PSetX.of(DistLockResource.class); + public PersistentSetX springClasses() { + return PersistentSetX.of(DistLockResource.class); } } diff --git a/micro-dist-lock/src/main/java/com/aol/micro/server/dist/lock/rest/DistLockResource.java b/micro-dist-lock/src/main/java/com/aol/micro/server/dist/lock/rest/DistLockResource.java index e56942e45..71027084f 100644 --- a/micro-dist-lock/src/main/java/com/aol/micro/server/dist/lock/rest/DistLockResource.java +++ b/micro-dist-lock/src/main/java/com/aol/micro/server/dist/lock/rest/DistLockResource.java @@ -10,7 +10,7 @@ import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; -import cyclops.collections.ListX; +import cyclops.collections.mutable.ListX; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; diff --git a/micro-elasticache/src/main/java/com/aol/micro/server/elasticache/ElasticachePlugin.java b/micro-elasticache/src/main/java/com/aol/micro/server/elasticache/ElasticachePlugin.java index fecd0d8b9..a028d9f10 100644 --- a/micro-elasticache/src/main/java/com/aol/micro/server/elasticache/ElasticachePlugin.java +++ b/micro-elasticache/src/main/java/com/aol/micro/server/elasticache/ElasticachePlugin.java @@ -1,12 +1,12 @@ package com.aol.micro.server.elasticache; import com.aol.micro.server.Plugin; -import cyclops.collections.immutable.PSetX; +import cyclops.collections.immutable.PersistentSetX; public class ElasticachePlugin implements Plugin { @Override - public PSetX springClasses() { - return PSetX.of(ConfigureElasticache.class); + public PersistentSetX springClasses() { + return PersistentSetX.of(ConfigureElasticache.class); } } \ No newline at end of file diff --git a/micro-error-codes/src/main/java/com/aol/micro/server/health/HealthStatus.java b/micro-error-codes/src/main/java/com/aol/micro/server/health/HealthStatus.java index 150a26602..18fe3cf2c 100644 --- a/micro-error-codes/src/main/java/com/aol/micro/server/health/HealthStatus.java +++ b/micro-error-codes/src/main/java/com/aol/micro/server/health/HealthStatus.java @@ -10,7 +10,7 @@ import javax.xml.bind.annotation.XmlType; -import cyclops.collections.QueueX; +import cyclops.collections.mutable.QueueX; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/micro-error-codes/src/main/java/com/aol/micro/server/plugin/ErrorsPlugin.java b/micro-error-codes/src/main/java/com/aol/micro/server/plugin/ErrorsPlugin.java index b52b1d83c..8b2940f53 100644 --- a/micro-error-codes/src/main/java/com/aol/micro/server/plugin/ErrorsPlugin.java +++ b/micro-error-codes/src/main/java/com/aol/micro/server/plugin/ErrorsPlugin.java @@ -4,13 +4,13 @@ import com.aol.micro.server.health.HealthCheck; import com.aol.micro.server.health.HealthChecker; import com.aol.micro.server.rest.HealthCheckResource; -import cyclops.collections.immutable.PSetX; +import cyclops.collections.immutable.PersistentSetX; public class ErrorsPlugin implements Plugin { @Override - public PSetX springClasses() { - return PSetX.of(HealthCheckResource.class, HealthChecker.class, HealthCheck.class); + public PersistentSetX springClasses() { + return PersistentSetX.of(HealthCheckResource.class, HealthChecker.class, HealthCheck.class); } } diff --git a/micro-event-metrics/src/main/java/com/aol/micro/server/event/metrics/MetricEventsPlugin.java b/micro-event-metrics/src/main/java/com/aol/micro/server/event/metrics/MetricEventsPlugin.java index 8921285ac..b7c59085d 100644 --- a/micro-event-metrics/src/main/java/com/aol/micro/server/event/metrics/MetricEventsPlugin.java +++ b/micro-event-metrics/src/main/java/com/aol/micro/server/event/metrics/MetricEventsPlugin.java @@ -2,7 +2,7 @@ import com.aol.micro.server.Plugin; -import cyclops.collections.immutable.PSetX; +import cyclops.collections.immutable.PersistentSetX; /** @@ -17,8 +17,8 @@ public class MetricEventsPlugin implements Plugin{ @Override - public PSetX springClasses() { - return PSetX.of( + public PersistentSetX springClasses() { + return PersistentSetX.of( Configuration.class, MetricsCatcher.class); } diff --git a/micro-event-metrics/src/test/java/app/event/metrics/com/aol/micro/server/EventStatusResource.java b/micro-event-metrics/src/test/java/app/event/metrics/com/aol/micro/server/EventStatusResource.java index 9049a00b0..32e282650 100644 --- a/micro-event-metrics/src/test/java/app/event/metrics/com/aol/micro/server/EventStatusResource.java +++ b/micro-event-metrics/src/test/java/app/event/metrics/com/aol/micro/server/EventStatusResource.java @@ -6,7 +6,7 @@ import javax.ws.rs.Path; import javax.ws.rs.Produces; -import cyclops.collections.MapX; +import cyclops.collections.mutable.MapX; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; diff --git a/micro-events/src/main/java/com/aol/micro/server/events/RequestTypes.java b/micro-events/src/main/java/com/aol/micro/server/events/RequestTypes.java index 6ef6ce892..e17be567c 100644 --- a/micro-events/src/main/java/com/aol/micro/server/events/RequestTypes.java +++ b/micro-events/src/main/java/com/aol/micro/server/events/RequestTypes.java @@ -10,7 +10,7 @@ import com.google.common.eventbus.EventBus; import com.google.common.eventbus.Subscribe; -import cyclops.collections.MapX; +import cyclops.collections.mutable.MapX; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.Builder; diff --git a/micro-events/src/main/java/com/aol/micro/server/events/plugin/EventsPlugin.java b/micro-events/src/main/java/com/aol/micro/server/events/plugin/EventsPlugin.java index 495a1fcce..c6216b03a 100644 --- a/micro-events/src/main/java/com/aol/micro/server/events/plugin/EventsPlugin.java +++ b/micro-events/src/main/java/com/aol/micro/server/events/plugin/EventsPlugin.java @@ -4,7 +4,7 @@ import com.aol.micro.server.Plugin; import com.aol.micro.server.events.ConfigureActiveJobsAspect; import com.aol.micro.server.rest.resources.ConfigureResources; -import cyclops.collections.immutable.PSetX; +import cyclops.collections.immutable.PersistentSetX; /** @@ -19,8 +19,8 @@ public class EventsPlugin implements Plugin{ @Override - public PSetX springClasses() { - return PSetX.of( + public PersistentSetX springClasses() { + return PersistentSetX.of( ConfigureActiveJobsAspect.class, ConfigureResources.class); } diff --git a/micro-events/src/main/java/com/aol/micro/server/rest/resources/ActiveResource.java b/micro-events/src/main/java/com/aol/micro/server/rest/resources/ActiveResource.java index 9bf54e768..894badf69 100644 --- a/micro-events/src/main/java/com/aol/micro/server/rest/resources/ActiveResource.java +++ b/micro-events/src/main/java/com/aol/micro/server/rest/resources/ActiveResource.java @@ -41,8 +41,8 @@ public void activeRequests(@Suspended AsyncResponse asyncResponse, @QueryParam(" .map(typeToUse -> activeQueries.getMap() .get(typeToUse) .toString()) - .futureOperations(WorkerThreads.ioExecutor.get()) - .forEachX(Long.MAX_VALUE,result -> asyncResponse.resume(result)); + .foldFuture(WorkerThreads.ioExecutor.get(), + s->s.forEach(Long.MAX_VALUE,result -> asyncResponse.resume(result))); } @@ -52,8 +52,8 @@ public void activeRequests(@Suspended AsyncResponse asyncResponse, @QueryParam(" public void allActiveRequests(@Suspended AsyncResponse asyncResponse) { ReactiveSeq.of(activeQueries.toString()) - .futureOperations(WorkerThreads.ioExecutor.get()) - .forEachX(Long.MAX_VALUE,result -> asyncResponse.resume(result)); + .foldFuture(WorkerThreads.ioExecutor.get(), + s->s.forEach(Long.MAX_VALUE,result -> asyncResponse.resume(result))); } @@ -64,8 +64,8 @@ public void activeJobs(@Suspended AsyncResponse asyncResponse) { ReactiveSeq.of(this.activeJobs) .map(JobsBeingExecuted::toString) - .futureOperations(WorkerThreads.ioExecutor.get()) - .forEachX(Long.MAX_VALUE,str -> asyncResponse.resume(str)); + .foldFuture(WorkerThreads.ioExecutor.get(), + s->s.forEach(Long.MAX_VALUE,str -> asyncResponse.resume(str))); } diff --git a/micro-events/src/main/java/com/aol/micro/server/rest/resources/ManifestResource.java b/micro-events/src/main/java/com/aol/micro/server/rest/resources/ManifestResource.java index 69c280422..444de7593 100644 --- a/micro-events/src/main/java/com/aol/micro/server/rest/resources/ManifestResource.java +++ b/micro-events/src/main/java/com/aol/micro/server/rest/resources/ManifestResource.java @@ -40,8 +40,8 @@ public void mainfest(@Suspended AsyncResponse asyncResponse, @Context ServletCon ReactiveSeq.of("/META-INF/MANIFEST.MF") .map(url->context.getResourceAsStream(url)) .map(this::getManifest) - .futureOperations(WorkerThreads.ioExecutor.get()) - .forEachX(Long.MAX_VALUE,result->asyncResponse.resume(result)); + .foldFuture(WorkerThreads.ioExecutor.get(), + s->s.forEach(Long.MAX_VALUE,result->asyncResponse.resume(result))); } diff --git a/micro-general-exception-mapper/src/main/java/com/aol/micro/server/general/exception/mapper/ExceptionMapperPlugin.java b/micro-general-exception-mapper/src/main/java/com/aol/micro/server/general/exception/mapper/ExceptionMapperPlugin.java index a8c4e5fda..84b93bc47 100644 --- a/micro-general-exception-mapper/src/main/java/com/aol/micro/server/general/exception/mapper/ExceptionMapperPlugin.java +++ b/micro-general-exception-mapper/src/main/java/com/aol/micro/server/general/exception/mapper/ExceptionMapperPlugin.java @@ -5,7 +5,7 @@ import com.aol.micro.server.Plugin; -import cyclops.collections.immutable.PSetX; +import cyclops.collections.immutable.PersistentSetX; /** * @@ -19,14 +19,14 @@ public class ExceptionMapperPlugin implements Plugin{ @Override - public PSetX jaxRsPackages() { - return PSetX.of("com.aol.micro.server.general.exception.mapper"); + public PersistentSetX jaxRsPackages() { + return PersistentSetX.of("com.aol.micro.server.general.exception.mapper"); } @Override - public PSetX springClasses() { - return PSetX.of(MapOfExceptionsToErrorCodes.class); + public PersistentSetX springClasses() { + return PersistentSetX.of(MapOfExceptionsToErrorCodes.class); } diff --git a/micro-grizzly-with-jersey/src/test/java/app/async/com/aol/micro/server/AsyncResource.java b/micro-grizzly-with-jersey/src/test/java/app/async/com/aol/micro/server/AsyncResource.java index 93f53a313..62f1ac0da 100644 --- a/micro-grizzly-with-jersey/src/test/java/app/async/com/aol/micro/server/AsyncResource.java +++ b/micro-grizzly-with-jersey/src/test/java/app/async/com/aol/micro/server/AsyncResource.java @@ -35,7 +35,7 @@ public class AsyncResource implements RestResource{ @Produces("text/plain") public void expensive(@Suspended AsyncResponse asyncResponse){ - FutureStream.lazyFutureStreamFromIterable(urls) + FutureStream.builder().fromIterable(urls) .then(it->client.get(it)) .onFail(it -> "") .peek(it -> diff --git a/micro-grizzly-with-jersey/src/test/java/app/custom/binder/resource/objects/BinderTest.java b/micro-grizzly-with-jersey/src/test/java/app/custom/binder/resource/objects/BinderTest.java index 167841397..887855a8b 100644 --- a/micro-grizzly-with-jersey/src/test/java/app/custom/binder/resource/objects/BinderTest.java +++ b/micro-grizzly-with-jersey/src/test/java/app/custom/binder/resource/objects/BinderTest.java @@ -6,7 +6,7 @@ import java.util.concurrent.ExecutionException; -import cyclops.collections.immutable.PSetX; +import cyclops.collections.immutable.PersistentSetX; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -26,7 +26,7 @@ public class BinderTest { public void startServer(){ - server = new MicroserverApp(ConfigurableModule.builder().context("binder").jaxRsResourceObjects(PSetX.of(new CustomBinder3())).build()); + server = new MicroserverApp(ConfigurableModule.builder().context("binder").jaxRsResourceObjects(PersistentSetX.of(new CustomBinder3())).build()); server.start(); diff --git a/micro-grizzly-with-jersey/src/test/java/app/embedded/com/aol/micro/server/TestAppResource.java b/micro-grizzly-with-jersey/src/test/java/app/embedded/com/aol/micro/server/TestAppResource.java index b21062cae..3a79ad2d7 100644 --- a/micro-grizzly-with-jersey/src/test/java/app/embedded/com/aol/micro/server/TestAppResource.java +++ b/micro-grizzly-with-jersey/src/test/java/app/embedded/com/aol/micro/server/TestAppResource.java @@ -38,7 +38,7 @@ public String ping() { @Path("/rest-calls") public String restCallResult(){ - return FutureStream.lazyFutureStreamFromIterable(urls) + return FutureStream.builder().fromIterable(urls) .map(it ->template.get(it)) .then(it -> "*"+it) .peek(loadedAndModified -> System.out.println(loadedAndModified)) diff --git a/micro-grizzly-with-jersey/src/test/java/app/publisher/binder/direct/AsyncResource.java b/micro-grizzly-with-jersey/src/test/java/app/publisher/binder/direct/AsyncResource.java index 6f22f806b..2fc2d6044 100644 --- a/micro-grizzly-with-jersey/src/test/java/app/publisher/binder/direct/AsyncResource.java +++ b/micro-grizzly-with-jersey/src/test/java/app/publisher/binder/direct/AsyncResource.java @@ -35,7 +35,7 @@ public Future myEndPoint() { @GET @Path("async2") public ReactiveSeq async2() { - return Spouts.publishOn(Stream.of("hello"), Executors.newFixedThreadPool(1)); + return Spouts.reactive(Stream.of("hello"), Executors.newFixedThreadPool(1)); } diff --git a/micro-grizzly-with-jersey/src/test/java/app/publisher/binder/direct/LazyTest.java b/micro-grizzly-with-jersey/src/test/java/app/publisher/binder/direct/LazyTest.java new file mode 100644 index 000000000..d294d9fc4 --- /dev/null +++ b/micro-grizzly-with-jersey/src/test/java/app/publisher/binder/direct/LazyTest.java @@ -0,0 +1,33 @@ +package app.publisher.binder.direct; + +import cyclops.collections.mutable.ListX; +import cyclops.stream.ReactiveSeq; +import org.junit.Test; + +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + + +public class LazyTest { + + @Test + public void jdkSteam(){ + List list = Stream.of(1,2,3) + .peek(System.out::println) + .collect(Collectors.toList()); + } + @Test + public void lazy(){ + ListX list = ReactiveSeq.of(1,2,3) + .peek(System.out::println) + .toListX(); + + + list.size(); + System.out.println("List " + list); + + + + } +} diff --git a/micro-grizzly/src/test/java/app/async/com/aol/micro/server/AsyncResource.java b/micro-grizzly/src/test/java/app/async/com/aol/micro/server/AsyncResource.java index be4345d0e..f8205e399 100644 --- a/micro-grizzly/src/test/java/app/async/com/aol/micro/server/AsyncResource.java +++ b/micro-grizzly/src/test/java/app/async/com/aol/micro/server/AsyncResource.java @@ -34,7 +34,7 @@ public class AsyncResource implements RestResource{ @Produces("text/plain") public void expensive(@Suspended AsyncResponse asyncResponse){ - FutureStream.lazyFutureStreamFromIterable(urls) + FutureStream.builder().fromIterable(urls) .then(it->client.get(it)) .onFail(it -> "") .peek(it -> diff --git a/micro-grizzly/src/test/java/app/embedded/com/aol/micro/server/TestAppResource.java b/micro-grizzly/src/test/java/app/embedded/com/aol/micro/server/TestAppResource.java index b21062cae..3a79ad2d7 100644 --- a/micro-grizzly/src/test/java/app/embedded/com/aol/micro/server/TestAppResource.java +++ b/micro-grizzly/src/test/java/app/embedded/com/aol/micro/server/TestAppResource.java @@ -38,7 +38,7 @@ public String ping() { @Path("/rest-calls") public String restCallResult(){ - return FutureStream.lazyFutureStreamFromIterable(urls) + return FutureStream.builder().fromIterable(urls) .map(it ->template.get(it)) .then(it -> "*"+it) .peek(loadedAndModified -> System.out.println(loadedAndModified)) diff --git a/micro-guava/src/main/java/com/aol/micro/server/guava/GuavaPlugin.java b/micro-guava/src/main/java/com/aol/micro/server/guava/GuavaPlugin.java index eaa84f95d..964cd4fae 100644 --- a/micro-guava/src/main/java/com/aol/micro/server/guava/GuavaPlugin.java +++ b/micro-guava/src/main/java/com/aol/micro/server/guava/GuavaPlugin.java @@ -5,7 +5,7 @@ import com.aol.micro.server.guava.spring.GuavaConfig; import com.fasterxml.jackson.databind.Module; import com.fasterxml.jackson.datatype.guava.GuavaModule; -import cyclops.collections.immutable.PSetX; +import cyclops.collections.immutable.PersistentSetX; /** * @@ -19,12 +19,12 @@ public class GuavaPlugin implements Plugin{ @Override - public PSetX springClasses() { - return PSetX.of(GuavaConfig.class); + public PersistentSetX springClasses() { + return PersistentSetX.of(GuavaConfig.class); } @Override - public PSetX jacksonModules(){ - return PSetX.of(new GuavaModule()); + public PersistentSetX jacksonModules(){ + return PersistentSetX.of(new GuavaModule()); } diff --git a/micro-guava/src/test/java/app/embedded/com/aol/micro/server/TestAppResource.java b/micro-guava/src/test/java/app/embedded/com/aol/micro/server/TestAppResource.java index f5e7c8337..462573a38 100644 --- a/micro-guava/src/test/java/app/embedded/com/aol/micro/server/TestAppResource.java +++ b/micro-guava/src/test/java/app/embedded/com/aol/micro/server/TestAppResource.java @@ -36,7 +36,7 @@ public String ping() { @Path("/rest-calls") public String restCallResult(){ - return FutureStream.lazyFutureStreamFromIterable(urls) + return FutureStream.builder().fromIterable(urls) .map(it ->template.get(it)) .then(it -> "*"+it) .peek(loadedAndModified -> System.out.println(loadedAndModified)) diff --git a/micro-hibernate/src/main/java/com/aol/micro/server/spring/HibernatePlugin.java b/micro-hibernate/src/main/java/com/aol/micro/server/spring/HibernatePlugin.java index 000bca4a9..1550c2491 100644 --- a/micro-hibernate/src/main/java/com/aol/micro/server/spring/HibernatePlugin.java +++ b/micro-hibernate/src/main/java/com/aol/micro/server/spring/HibernatePlugin.java @@ -8,7 +8,7 @@ import com.aol.micro.server.spring.datasource.hibernate.HibernateConfig; import com.aol.micro.server.spring.datasource.hibernate.SpringDataConfig; import com.aol.micro.server.spring.datasource.jdbc.SQL; -import cyclops.collections.immutable.PSetX; +import cyclops.collections.immutable.PersistentSetX; /** * @@ -27,8 +27,8 @@ public Optional springDbConfigurer() { } @Override - public PSetX springClasses() { - return PSetX.of(JdbcConfig.class, SQL.class, SpringDataConfig.class, HibernateConfig.class); + public PersistentSetX springClasses() { + return PersistentSetX.of(JdbcConfig.class, SQL.class, SpringDataConfig.class, HibernateConfig.class); } diff --git a/micro-hikaricp/src/main/java/com/aol/micro/server/spring/HikariCPPlugin.java b/micro-hikaricp/src/main/java/com/aol/micro/server/spring/HikariCPPlugin.java index 4b16c6716..8884bca75 100644 --- a/micro-hikaricp/src/main/java/com/aol/micro/server/spring/HikariCPPlugin.java +++ b/micro-hikaricp/src/main/java/com/aol/micro/server/spring/HikariCPPlugin.java @@ -4,7 +4,7 @@ import com.aol.micro.server.Plugin; import com.aol.micro.server.spring.datasource.HikariCPConfig; import com.aol.micro.server.spring.datasource.HikariCPDataSourceBuilder; -import cyclops.collections.immutable.PSetX; +import cyclops.collections.immutable.PersistentSetX; /** * @@ -14,8 +14,8 @@ public class HikariCPPlugin implements Plugin { @Override - public PSetX springClasses() { - return PSetX.of(HikariCPConfig.class, HikariCPDataSourceBuilder.class); + public PersistentSetX springClasses() { + return PersistentSetX.of(HikariCPConfig.class, HikariCPDataSourceBuilder.class); } diff --git a/micro-ip-tracker/src/main/java/com/aol/micro/server/ip/tracker/IPTrackerPlugin.java b/micro-ip-tracker/src/main/java/com/aol/micro/server/ip/tracker/IPTrackerPlugin.java index 739e34c37..57555d736 100644 --- a/micro-ip-tracker/src/main/java/com/aol/micro/server/ip/tracker/IPTrackerPlugin.java +++ b/micro-ip-tracker/src/main/java/com/aol/micro/server/ip/tracker/IPTrackerPlugin.java @@ -1,14 +1,14 @@ package com.aol.micro.server.ip.tracker; import com.aol.micro.server.Plugin; -import cyclops.collections.immutable.PSetX; +import cyclops.collections.immutable.PersistentSetX; public class IPTrackerPlugin implements Plugin{ @Override - public PSetX springClasses() { - return PSetX.of(BeanConfiguration.class); + public PersistentSetX springClasses() { + return PersistentSetX.of(BeanConfiguration.class); } diff --git a/micro-jackson-configuration/src/main/java/com/aol/micro/server/jackson/JacksonPlugin.java b/micro-jackson-configuration/src/main/java/com/aol/micro/server/jackson/JacksonPlugin.java index a4f4d5cca..5bec88c2d 100644 --- a/micro-jackson-configuration/src/main/java/com/aol/micro/server/jackson/JacksonPlugin.java +++ b/micro-jackson-configuration/src/main/java/com/aol/micro/server/jackson/JacksonPlugin.java @@ -5,27 +5,27 @@ import com.aol.micro.server.rest.jackson.JacksonFeature; import com.fasterxml.jackson.databind.Module; import com.fasterxml.jackson.datatype.pcollections.PCollectionsModule; -import cyclops.collections.immutable.PSetX; +import cyclops.collections.immutable.PersistentSetX; public class JacksonPlugin implements Plugin { @Override - public PSetX> jaxRsResources() { + public PersistentSetX> jaxRsResources() { - return PSetX.of(JacksonFeature.class); + return PersistentSetX.of(JacksonFeature.class); } @Override - public PSetX springClasses() { + public PersistentSetX springClasses() { - return PSetX.of(CoreJacksonConfigurator.class, JacksonConfigurers.class); + return PersistentSetX.of(CoreJacksonConfigurator.class, JacksonConfigurers.class); } @Override - public PSetX jacksonModules() { - return PSetX.of(new PCollectionsModule()); + public PersistentSetX jacksonModules() { + return PersistentSetX.of(new PCollectionsModule()); } } diff --git a/micro-jackson-configuration/src/test/java/com/aol/micro/server/rest/JacksonUtilTest.java b/micro-jackson-configuration/src/test/java/com/aol/micro/server/rest/JacksonUtilTest.java index d092dcdd0..69da4a269 100644 --- a/micro-jackson-configuration/src/test/java/com/aol/micro/server/rest/JacksonUtilTest.java +++ b/micro-jackson-configuration/src/test/java/com/aol/micro/server/rest/JacksonUtilTest.java @@ -13,7 +13,7 @@ import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; -import cyclops.collections.immutable.PStackX; +import cyclops.collections.immutable.LinkedListX; import org.junit.Test; import org.pcollections.ConsPStack; import org.pcollections.PStack; @@ -52,7 +52,7 @@ public void serialiseAndDeserialise() { @Test public void serializeToPStack() { - PStackX list = PStackX.of(1, 2, 3, 4); + LinkedListX list = LinkedListX.of(1, 2, 3, 4); String jsonString = JacksonUtil.serializeToJson(list); PStack stack = JacksonUtil.convertFromJson(jsonString, ConsPStack.class); diff --git a/micro-jdbc/src/main/java/com/aol/micro/server/spring/JdbcPlugin.java b/micro-jdbc/src/main/java/com/aol/micro/server/spring/JdbcPlugin.java index 3de3db513..4bc257666 100644 --- a/micro-jdbc/src/main/java/com/aol/micro/server/spring/JdbcPlugin.java +++ b/micro-jdbc/src/main/java/com/aol/micro/server/spring/JdbcPlugin.java @@ -6,7 +6,7 @@ import com.aol.micro.server.Plugin; import com.aol.micro.server.spring.datasource.JdbcConfig; import com.aol.micro.server.spring.datasource.jdbc.SQL; -import cyclops.collections.immutable.PSetX; +import cyclops.collections.immutable.PersistentSetX; /** * @@ -25,8 +25,8 @@ public Optional springDbConfigurer() { } @Override - public PSetX springClasses() { - return PSetX.of(JdbcConfig.class, SQL.class); + public PersistentSetX springClasses() { + return PersistentSetX.of(JdbcConfig.class, SQL.class); } diff --git a/micro-jersey/src/main/java/com/aol/micro/server/rest/jersey/AsyncDispatcher.java b/micro-jersey/src/main/java/com/aol/micro/server/rest/jersey/AsyncDispatcher.java index bc2a4a69e..3b48ff33b 100644 --- a/micro-jersey/src/main/java/com/aol/micro/server/rest/jersey/AsyncDispatcher.java +++ b/micro-jersey/src/main/java/com/aol/micro/server/rest/jersey/AsyncDispatcher.java @@ -1,5 +1,6 @@ package com.aol.micro.server.rest.jersey; +import com.aol.cyclops2.types.mixins.Printable; import cyclops.stream.ReactiveSeq; import cyclops.stream.Spouts; import lombok.AllArgsConstructor; @@ -22,6 +23,7 @@ import javax.ws.rs.core.Context; import javax.ws.rs.core.Response; import java.lang.reflect.InvocationHandler; +import java.util.Collection; import java.util.Set; import java.util.stream.Collectors; @@ -47,7 +49,7 @@ static class AsyncDispatcherProvider implements Provider{ @Override public ResourceMethodDispatcher create(Invocable method, InvocationHandler handler, ConfiguredValidator validator) { final Class returnType = method.getHandlingMethod().getReturnType(); - if(Publisher.class.isAssignableFrom(returnType)){ + if(Publisher.class.isAssignableFrom(returnType) & !Collection.class.isAssignableFrom(returnType)){ Set providers = serviceLocator.getAllServiceHandles(ResourceMethodDispatcher.Provider.class) .stream() .filter(h->!h.getActiveDescriptor() diff --git a/micro-jersey/src/main/java/com/aol/micro/server/rest/jersey/JerseyPlugin.java b/micro-jersey/src/main/java/com/aol/micro/server/rest/jersey/JerseyPlugin.java index e8153adf4..9650126b3 100644 --- a/micro-jersey/src/main/java/com/aol/micro/server/rest/jersey/JerseyPlugin.java +++ b/micro-jersey/src/main/java/com/aol/micro/server/rest/jersey/JerseyPlugin.java @@ -7,9 +7,9 @@ import javax.servlet.ServletContextListener; import javax.ws.rs.core.FeatureContext; -import cyclops.collections.MapXs; -import cyclops.collections.immutable.PMapX; -import cyclops.collections.immutable.PSetX; +import cyclops.companion.MapXs; +import cyclops.collections.immutable.PersistentMapX; +import cyclops.collections.immutable.PersistentSetX; import org.glassfish.jersey.CommonProperties; @@ -26,7 +26,7 @@ public Optional restServletConfiguration(){ } @Override public Function> jacksonFeatureProperties(){ - return context-> PMapX.fromMap(MapXs.of( CommonProperties.MOXY_JSON_FEATURE_DISABLE + '.' + return context-> PersistentMapX.fromMap(MapXs.of( CommonProperties.MOXY_JSON_FEATURE_DISABLE + '.' + context.getConfiguration().getRuntimeType().name().toLowerCase(),true)); } @@ -35,9 +35,9 @@ public Optional jaxWsRsApplication(){ return Optional.of(JerseyRestApplication.class.getCanonicalName()); } @Override - public PSetX> servletContextListeners(){ + public PersistentSetX> servletContextListeners(){ Function f = serverData ->new JerseySpringIntegrationContextListener(serverData); - return PSetX.of(f); + return PersistentSetX.of(f); } diff --git a/micro-jersey/src/test/java/com/aol/micro/server/rest/jersey/JerseySpringIntegrationContextListenerTest.java b/micro-jersey/src/test/java/com/aol/micro/server/rest/jersey/JerseySpringIntegrationContextListenerTest.java index 500c76c59..206e8c640 100644 --- a/micro-jersey/src/test/java/com/aol/micro/server/rest/jersey/JerseySpringIntegrationContextListenerTest.java +++ b/micro-jersey/src/test/java/com/aol/micro/server/rest/jersey/JerseySpringIntegrationContextListenerTest.java @@ -5,7 +5,7 @@ import java.util.Arrays; -import cyclops.collections.immutable.PStackX; +import cyclops.collections.immutable.LinkedListX; import org.junit.Before; import org.junit.Test; @@ -17,7 +17,7 @@ public class JerseySpringIntegrationContextListenerTest { ServerData serverData; @Before public void setup (){ - serverData = ServerData.builder().module(()->"hello").resources(PStackX.of()).build(); + serverData = ServerData.builder().module(()->"hello").resources(LinkedListX.of()).build(); listener = new JerseySpringIntegrationContextListener(serverData); } diff --git a/micro-jmx-metrics/src/main/java/com/aol/micro/server/application/metrics/jmx/JmxMetricsAcquirer.java b/micro-jmx-metrics/src/main/java/com/aol/micro/server/application/metrics/jmx/JmxMetricsAcquirer.java index e2be804ae..5df70c258 100644 --- a/micro-jmx-metrics/src/main/java/com/aol/micro/server/application/metrics/jmx/JmxMetricsAcquirer.java +++ b/micro-jmx-metrics/src/main/java/com/aol/micro/server/application/metrics/jmx/JmxMetricsAcquirer.java @@ -16,8 +16,8 @@ import javax.management.ReflectionException; import javax.management.openmbean.CompositeData; -import cyclops.collections.MapX; -import cyclops.collections.SetX; +import cyclops.collections.mutable.MapX; +import cyclops.collections.mutable.SetX; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; diff --git a/micro-jmx-metrics/src/main/java/com/aol/micro/server/application/metrics/jmx/JmxMetricsPlugin.java b/micro-jmx-metrics/src/main/java/com/aol/micro/server/application/metrics/jmx/JmxMetricsPlugin.java index dbf4fdb2f..2908aabf3 100644 --- a/micro-jmx-metrics/src/main/java/com/aol/micro/server/application/metrics/jmx/JmxMetricsPlugin.java +++ b/micro-jmx-metrics/src/main/java/com/aol/micro/server/application/metrics/jmx/JmxMetricsPlugin.java @@ -1,13 +1,13 @@ package com.aol.micro.server.application.metrics.jmx; import com.aol.micro.server.Plugin; -import cyclops.collections.immutable.PSetX; +import cyclops.collections.immutable.PersistentSetX; public class JmxMetricsPlugin implements Plugin { @Override - public PSetX springClasses() { - return PSetX.of(JmxMetricsAcquirer.class); + public PersistentSetX springClasses() { + return PersistentSetX.of(JmxMetricsAcquirer.class); } } diff --git a/micro-log-streamer/src/main/java/com/aol/micro/server/log/LogTailerPlugin.java b/micro-log-streamer/src/main/java/com/aol/micro/server/log/LogTailerPlugin.java index 78fdf96e7..a509651a6 100644 --- a/micro-log-streamer/src/main/java/com/aol/micro/server/log/LogTailerPlugin.java +++ b/micro-log-streamer/src/main/java/com/aol/micro/server/log/LogTailerPlugin.java @@ -3,13 +3,13 @@ import com.aol.micro.server.Plugin; import com.aol.micro.server.log.rest.LogStreamer; -import cyclops.collections.immutable.PSetX; +import cyclops.collections.immutable.PersistentSetX; public class LogTailerPlugin implements Plugin { @Override - public PSetX springClasses() { - return PSetX.of(LogTailer.class, LogStreamer.class); + public PersistentSetX springClasses() { + return PersistentSetX.of(LogTailer.class, LogStreamer.class); } } diff --git a/micro-log4j/src/main/java/com/aol/micro/server/log4j/Log4jPlugin.java b/micro-log4j/src/main/java/com/aol/micro/server/log4j/Log4jPlugin.java index 3a5261e17..8623bf605 100644 --- a/micro-log4j/src/main/java/com/aol/micro/server/log4j/Log4jPlugin.java +++ b/micro-log4j/src/main/java/com/aol/micro/server/log4j/Log4jPlugin.java @@ -5,7 +5,7 @@ import com.aol.micro.server.log4j.rest.Log4jLoggerResource; import com.aol.micro.server.log4j.rest.Log4jRootLoggerResource; import com.aol.micro.server.log4j.service.Log4jRootLoggerChecker; -import cyclops.collections.immutable.PSetX; +import cyclops.collections.immutable.PersistentSetX; /** * @@ -14,8 +14,8 @@ */ public class Log4jPlugin implements Plugin { @Override - public PSetX springClasses() { - return PSetX.of(Log4jRootLoggerResource.class, Log4jLoggerResource.class, Log4jRootLoggerChecker.class); + public PersistentSetX springClasses() { + return PersistentSetX.of(Log4jRootLoggerResource.class, Log4jLoggerResource.class, Log4jRootLoggerChecker.class); } } diff --git a/micro-logback/src/main/java/com/aol/micro/server/logback/LogbackPlugin.java b/micro-logback/src/main/java/com/aol/micro/server/logback/LogbackPlugin.java index 876036ef8..7c4a21311 100644 --- a/micro-logback/src/main/java/com/aol/micro/server/logback/LogbackPlugin.java +++ b/micro-logback/src/main/java/com/aol/micro/server/logback/LogbackPlugin.java @@ -5,7 +5,7 @@ import com.aol.micro.server.logback.rest.LogbackLoggerResource; import com.aol.micro.server.logback.rest.LogbackRootLoggerResource; import com.aol.micro.server.logback.service.LogbackRootLoggerChecker; -import cyclops.collections.immutable.PSetX; +import cyclops.collections.immutable.PersistentSetX; /** * @@ -14,8 +14,8 @@ */ public class LogbackPlugin implements Plugin { @Override - public PSetX springClasses() { - return PSetX.of(LogbackRootLoggerResource.class, LogbackRootLoggerChecker.class, LogbackLoggerResource.class); + public PersistentSetX springClasses() { + return PersistentSetX.of(LogbackRootLoggerResource.class, LogbackRootLoggerChecker.class, LogbackLoggerResource.class); } } diff --git a/micro-machine-stats/src/main/java/com/aol/micro/server/machine/stats/sigar/CpuStats.java b/micro-machine-stats/src/main/java/com/aol/micro/server/machine/stats/sigar/CpuStats.java index df13cc1e6..df41d96cc 100644 --- a/micro-machine-stats/src/main/java/com/aol/micro/server/machine/stats/sigar/CpuStats.java +++ b/micro-machine-stats/src/main/java/com/aol/micro/server/machine/stats/sigar/CpuStats.java @@ -10,7 +10,7 @@ import javax.xml.bind.annotation.XmlType; -import cyclops.collections.MapXs; +import cyclops.companion.MapXs; import lombok.Getter; import lombok.ToString; import lombok.Builder; diff --git a/micro-machine-stats/src/main/java/com/aol/micro/server/machine/stats/sigar/MachineStats.java b/micro-machine-stats/src/main/java/com/aol/micro/server/machine/stats/sigar/MachineStats.java index e80804526..c6dc05427 100644 --- a/micro-machine-stats/src/main/java/com/aol/micro/server/machine/stats/sigar/MachineStats.java +++ b/micro-machine-stats/src/main/java/com/aol/micro/server/machine/stats/sigar/MachineStats.java @@ -10,7 +10,7 @@ import javax.xml.bind.annotation.XmlType; -import cyclops.collections.MapXs; +import cyclops.companion.MapXs; import lombok.Getter; import lombok.ToString; import lombok.Builder; diff --git a/micro-machine-stats/src/main/java/com/aol/micro/server/machine/stats/sigar/MemoryStats.java b/micro-machine-stats/src/main/java/com/aol/micro/server/machine/stats/sigar/MemoryStats.java index 31184025b..6eaf1ef2c 100644 --- a/micro-machine-stats/src/main/java/com/aol/micro/server/machine/stats/sigar/MemoryStats.java +++ b/micro-machine-stats/src/main/java/com/aol/micro/server/machine/stats/sigar/MemoryStats.java @@ -10,7 +10,7 @@ import javax.xml.bind.annotation.XmlType; -import cyclops.collections.MapXs; +import cyclops.companion.MapXs; import lombok.Getter; import lombok.ToString; import lombok.Builder; diff --git a/micro-machine-stats/src/main/java/com/aol/micro/server/machine/stats/sigar/SigarStats.java b/micro-machine-stats/src/main/java/com/aol/micro/server/machine/stats/sigar/SigarStats.java index 489143a1f..a5f1fc7c0 100644 --- a/micro-machine-stats/src/main/java/com/aol/micro/server/machine/stats/sigar/SigarStats.java +++ b/micro-machine-stats/src/main/java/com/aol/micro/server/machine/stats/sigar/SigarStats.java @@ -2,7 +2,7 @@ import java.util.Map; -import cyclops.collections.MapXs; +import cyclops.companion.MapXs; import org.hyperic.sigar.Sigar; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; diff --git a/micro-machine-stats/src/main/java/com/aol/micro/server/machine/stats/sigar/SwapStats.java b/micro-machine-stats/src/main/java/com/aol/micro/server/machine/stats/sigar/SwapStats.java index e714d5dd5..7ac332be5 100644 --- a/micro-machine-stats/src/main/java/com/aol/micro/server/machine/stats/sigar/SwapStats.java +++ b/micro-machine-stats/src/main/java/com/aol/micro/server/machine/stats/sigar/SwapStats.java @@ -10,7 +10,7 @@ import javax.xml.bind.annotation.XmlType; -import cyclops.collections.MapXs; +import cyclops.companion.MapXs; import lombok.Getter; import lombok.ToString; import lombok.Builder; diff --git a/micro-machine-stats/src/main/java/com/aol/micro/server/machine/stats/sigar/plugin/MachineStatsPlugin.java b/micro-machine-stats/src/main/java/com/aol/micro/server/machine/stats/sigar/plugin/MachineStatsPlugin.java index 2bf4cf7f9..fa4e4f557 100644 --- a/micro-machine-stats/src/main/java/com/aol/micro/server/machine/stats/sigar/plugin/MachineStatsPlugin.java +++ b/micro-machine-stats/src/main/java/com/aol/micro/server/machine/stats/sigar/plugin/MachineStatsPlugin.java @@ -6,7 +6,7 @@ import com.aol.micro.server.machine.stats.sigar.SigarStats; import com.aol.micro.server.machine.stats.sigar.StatsServletContextListener; import com.aol.micro.server.machine.stats.sigar.rest.StatsResource; -import cyclops.collections.immutable.PSetX; +import cyclops.collections.immutable.PersistentSetX; /** * @@ -20,8 +20,8 @@ public class MachineStatsPlugin implements Plugin { @Override - public PSetX springClasses() { - return PSetX.of(StatsResource.class, MachineStatsChecker.class, StatsServletContextListener.class, + public PersistentSetX springClasses() { + return PersistentSetX.of(StatsResource.class, MachineStatsChecker.class, StatsServletContextListener.class, SigarStats.class); } diff --git a/micro-metrics-datadog/src/main/java/com/aol/micro/server/datadog/metrics/DatadogMetricsPlugin.java b/micro-metrics-datadog/src/main/java/com/aol/micro/server/datadog/metrics/DatadogMetricsPlugin.java index b2228a5d9..e9fbc135c 100644 --- a/micro-metrics-datadog/src/main/java/com/aol/micro/server/datadog/metrics/DatadogMetricsPlugin.java +++ b/micro-metrics-datadog/src/main/java/com/aol/micro/server/datadog/metrics/DatadogMetricsPlugin.java @@ -1,7 +1,7 @@ package com.aol.micro.server.datadog.metrics; import com.aol.micro.server.Plugin; -import cyclops.collections.immutable.PSetX; +import cyclops.collections.immutable.PersistentSetX; /** * @@ -15,7 +15,7 @@ public class DatadogMetricsPlugin implements Plugin { @Override - public PSetX springClasses() { - return PSetX.of( DatadogMetricsConfigurer.class); + public PersistentSetX springClasses() { + return PersistentSetX.of( DatadogMetricsConfigurer.class); } } diff --git a/micro-metrics/src/main/java/com/aol/micro/server/spring/metrics/MetricsPlugin.java b/micro-metrics/src/main/java/com/aol/micro/server/spring/metrics/MetricsPlugin.java index 874adf791..3ab917828 100644 --- a/micro-metrics/src/main/java/com/aol/micro/server/spring/metrics/MetricsPlugin.java +++ b/micro-metrics/src/main/java/com/aol/micro/server/spring/metrics/MetricsPlugin.java @@ -4,7 +4,7 @@ import com.aol.micro.server.Plugin; import com.aol.micro.server.spring.metrics.health.HealthCheckRunner; import com.aol.micro.server.spring.metrics.health.HealthResource; -import cyclops.collections.immutable.PSetX; +import cyclops.collections.immutable.PersistentSetX; /** * @@ -18,8 +18,8 @@ public class MetricsPlugin implements Plugin { @Override - public PSetX springClasses() { - return PSetX.of(CodahaleMetricsConfigurer.class, HealthCheckRunner.class, HealthResource.class); + public PersistentSetX springClasses() { + return PersistentSetX.of(CodahaleMetricsConfigurer.class, HealthCheckRunner.class, HealthResource.class); } } diff --git a/micro-metrics/src/main/java/com/aol/micro/server/spring/metrics/health/HealthCheckRunner.java b/micro-metrics/src/main/java/com/aol/micro/server/spring/metrics/health/HealthCheckRunner.java index 55d8252fa..62491034a 100644 --- a/micro-metrics/src/main/java/com/aol/micro/server/spring/metrics/health/HealthCheckRunner.java +++ b/micro-metrics/src/main/java/com/aol/micro/server/spring/metrics/health/HealthCheckRunner.java @@ -1,6 +1,6 @@ package com.aol.micro.server.spring.metrics.health; -import cyclops.Semigroups; +import cyclops.companion.Semigroups; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; diff --git a/micro-mysql/src/main/java/com/aol/micro/server/mysql/distlock/MySqlPlugin.java b/micro-mysql/src/main/java/com/aol/micro/server/mysql/distlock/MySqlPlugin.java index d925359aa..8d35316dc 100644 --- a/micro-mysql/src/main/java/com/aol/micro/server/mysql/distlock/MySqlPlugin.java +++ b/micro-mysql/src/main/java/com/aol/micro/server/mysql/distlock/MySqlPlugin.java @@ -4,11 +4,11 @@ import com.aol.micro.server.Plugin; import com.aol.micro.server.mysql.distlock.datasource.JdbcConfigDistLock; import com.aol.micro.server.mysql.distlock.datasource.MysqlDataSourceBuilder; -import cyclops.collections.immutable.PSetX; +import cyclops.collections.immutable.PersistentSetX; public class MySqlPlugin implements Plugin { - public PSetX springClasses(){ - return PSetX.of(DistributedLockServiceMySqlImpl.class, + public PersistentSetX springClasses(){ + return PersistentSetX.of(DistributedLockServiceMySqlImpl.class, MysqlDataSourceBuilder.class,JdbcConfigDistLock.class); } } diff --git a/micro-reactive/readme.md b/micro-reactive/readme.md index aa8367246..9135ce1af 100644 --- a/micro-reactive/readme.md +++ b/micro-reactive/readme.md @@ -124,18 +124,18 @@ ListX.fromPublisher(Flux.just(1,2,3)); Flux.just(1,2,3).collect(ListX::empty,(l,e)->l.add(e)); ``` - From a Flux to a PStackX + From a Flux to a LinkedListX ```java -PStackX.fromPublisher(Flux.just(1,2,3)); +LinkedListX.fromPublisher(Flux.just(1,2,3)); ``` - From a Flux to a PStackX + From a Flux to a LinkedListX ```java Flux.just(1,2,3) - .map(PStackX::of) - .reduce(Reducers.toPStackX()); + .map(LinkedListX::of) + .reduce(Reducers.toLinkedListX()); ``` ## To use diff --git a/micro-reactive/src/main/java/com/aol/micro/server/reactive/EventQueueManager.java b/micro-reactive/src/main/java/com/aol/micro/server/reactive/EventQueueManager.java index 19bc01638..c2490605a 100644 --- a/micro-reactive/src/main/java/com/aol/micro/server/reactive/EventQueueManager.java +++ b/micro-reactive/src/main/java/com/aol/micro/server/reactive/EventQueueManager.java @@ -7,7 +7,7 @@ import cyclops.async.Future; import cyclops.async.LazyReact; import cyclops.async.Pipes; -import cyclops.async.QueueFactory; +import cyclops.async.adapters.QueueFactory; import cyclops.control.Eval; import cyclops.control.Maybe; import cyclops.function.FluentFunctions; @@ -57,9 +57,8 @@ public void forEach(String key,Consumer reactor){ if(!pipes.get(key).isPresent()) pipes.register(key, factory.build()); pipes.reactiveSeq(key) - .get() - .futureOperations(ex) - .forEachX(Long.MAX_VALUE,reactor); + .get().foldFuture(ex, + s->s.forEach(Long.MAX_VALUE,reactor)); } /** * @param key Register a new queue with supplied key diff --git a/micro-reactive/src/main/java/com/aol/micro/server/reactive/ReactivePlugin.java b/micro-reactive/src/main/java/com/aol/micro/server/reactive/ReactivePlugin.java index 17cf82de0..da54af046 100644 --- a/micro-reactive/src/main/java/com/aol/micro/server/reactive/ReactivePlugin.java +++ b/micro-reactive/src/main/java/com/aol/micro/server/reactive/ReactivePlugin.java @@ -2,14 +2,14 @@ import com.aol.micro.server.Plugin; -import cyclops.collections.immutable.PSetX; +import cyclops.collections.immutable.PersistentSetX; public class ReactivePlugin implements Plugin{ @Override - public PSetX springClasses() { - return PSetX.of(ResponderConfigurer.class); + public PersistentSetX springClasses() { + return PersistentSetX.of(ResponderConfigurer.class); } diff --git a/micro-reactive/src/main/java/com/aol/micro/server/reactive/ResponderConfigurer.java b/micro-reactive/src/main/java/com/aol/micro/server/reactive/ResponderConfigurer.java index e9b50e3a9..ed9b3ba6b 100644 --- a/micro-reactive/src/main/java/com/aol/micro/server/reactive/ResponderConfigurer.java +++ b/micro-reactive/src/main/java/com/aol/micro/server/reactive/ResponderConfigurer.java @@ -3,7 +3,7 @@ import java.util.concurrent.Executors; import cyclops.async.QueueFactories; -import cyclops.async.QueueFactory; +import cyclops.async.adapters.QueueFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Value; diff --git a/micro-reactive/src/test/java/app/async/com/aol/micro/server/AsyncResource.java b/micro-reactive/src/test/java/app/async/com/aol/micro/server/AsyncResource.java index 84179da1e..4ab884338 100644 --- a/micro-reactive/src/test/java/app/async/com/aol/micro/server/AsyncResource.java +++ b/micro-reactive/src/test/java/app/async/com/aol/micro/server/AsyncResource.java @@ -36,7 +36,7 @@ public class AsyncResource implements RestResource{ @Produces("text/plain") public void expensive(@Suspended AsyncResponse asyncResponse){ - FutureStream.lazyFutureStreamFromIterable(urls) + FutureStream.builder().fromIterable(urls) .then(it->client.get(it)) .onFail(it -> "") .peek(it -> diff --git a/micro-reactive/src/test/java/app/bus/com/aol/micro/server/MyQueueFactoryConfig.java b/micro-reactive/src/test/java/app/bus/com/aol/micro/server/MyQueueFactoryConfig.java index b890b476d..af4c4c2e8 100644 --- a/micro-reactive/src/test/java/app/bus/com/aol/micro/server/MyQueueFactoryConfig.java +++ b/micro-reactive/src/test/java/app/bus/com/aol/micro/server/MyQueueFactoryConfig.java @@ -1,7 +1,7 @@ package app.bus.com.aol.micro.server; import cyclops.async.QueueFactories; -import cyclops.async.QueueFactory; +import cyclops.async.adapters.QueueFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/micro-reactive/src/test/java/app/streaming/com/aol/micro/server/MyQueueFactoryConfig.java b/micro-reactive/src/test/java/app/streaming/com/aol/micro/server/MyQueueFactoryConfig.java index d60173327..d4d5a52d1 100644 --- a/micro-reactive/src/test/java/app/streaming/com/aol/micro/server/MyQueueFactoryConfig.java +++ b/micro-reactive/src/test/java/app/streaming/com/aol/micro/server/MyQueueFactoryConfig.java @@ -1,7 +1,7 @@ package app.streaming.com.aol.micro.server; import cyclops.async.QueueFactories; -import cyclops.async.QueueFactory; +import cyclops.async.adapters.QueueFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/micro-reactive/src/test/java/com/aol/micro/server/reactive/EventQueueManagerTest.java b/micro-reactive/src/test/java/com/aol/micro/server/reactive/EventQueueManagerTest.java index d4310ebc4..e389c95a6 100644 --- a/micro-reactive/src/test/java/com/aol/micro/server/reactive/EventQueueManagerTest.java +++ b/micro-reactive/src/test/java/com/aol/micro/server/reactive/EventQueueManagerTest.java @@ -67,8 +67,8 @@ public void testStream() throws InterruptedException { manager.stream("2") - .futureOperations(ex) - .forEachX(Long.MAX_VALUE,a->recieved= a); + .foldFuture(ex, + s->s.forEach(Long.MAX_VALUE,a->recieved= a)); manager.push("2", "world"); @@ -84,8 +84,8 @@ public void testLazyValue() { ReactiveSeq.generate(()->"input") .onePer(1,TimeUnit.SECONDS) - .futureOperations(ex) - .forEachX(Long.MAX_VALUE,n->manager.push("lazy",n)); + .foldFuture(ex, + s->s.forEach(Long.MAX_VALUE,n->manager.push("lazy",n))); Eval lazy = manager.lazy("lazy"); @@ -109,8 +109,8 @@ public void testMaybe() { .onePer(1,TimeUnit.SECONDS) .map(s->s+":"+count.incrementAndGet()) .peek(System.out::println) - .futureOperations(ex) - .forEachX(Long.MAX_VALUE,n->manager.push("lazy",n)); + .foldFuture(ex, + s->s.forEach(Long.MAX_VALUE,n->manager.push("lazy",n))); Maybe lazy1 = manager.maybe("lazy"); Maybe lazy2 = manager.maybe("lazy"); diff --git a/micro-s3/src/main/java/com/aol/micro/server/s3/plugin/S3Plugin.java b/micro-s3/src/main/java/com/aol/micro/server/s3/plugin/S3Plugin.java index 6904dde41..41866fa45 100644 --- a/micro-s3/src/main/java/com/aol/micro/server/s3/plugin/S3Plugin.java +++ b/micro-s3/src/main/java/com/aol/micro/server/s3/plugin/S3Plugin.java @@ -6,13 +6,13 @@ import com.aol.micro.server.s3.S3Configuration; import com.aol.micro.server.s3.data.S3DistributedMapClient; import com.aol.micro.server.s3.data.S3Utils; -import cyclops.collections.immutable.PSetX; +import cyclops.collections.immutable.PersistentSetX; public class S3Plugin implements Plugin { @Override - public PSetX springClasses() { - return PSetX.of(S3ManifestComparatorProvider.class, S3DistributedMapClient.class, S3Configuration.class, + public PersistentSetX springClasses() { + return PersistentSetX.of(S3ManifestComparatorProvider.class, S3DistributedMapClient.class, S3Configuration.class, S3ClientProvider.class, S3Utils.class, S3TransferManagerProvider.class, DirectoryCleaner.class); } diff --git a/micro-slack/build.gradle b/micro-slack/build.gradle index 29f2a8ed2..019c5a08c 100644 --- a/micro-slack/build.gradle +++ b/micro-slack/build.gradle @@ -1,8 +1,8 @@ description = 'micro-slack' dependencies { - compile 'com.aol.microservices:micro-grizzly-with-jersey:0.87' - compile 'com.aol.microservices:micro-general-exception-mapper:0.87' + compile project(':micro-grizzly-with-jersey') + compile project(':micro-general-exception-mapper') testCompile group: 'junit', name: 'junit', version:'4.10' testCompile 'org.springframework.boot:spring-boot-starter-test:1.1.5.RELEASE' diff --git a/micro-slack/src/main/java/com/aol/micro/server/slack/plugin/SlackPlugin.java b/micro-slack/src/main/java/com/aol/micro/server/slack/plugin/SlackPlugin.java index 6b418c539..2cc80b45f 100644 --- a/micro-slack/src/main/java/com/aol/micro/server/slack/plugin/SlackPlugin.java +++ b/micro-slack/src/main/java/com/aol/micro/server/slack/plugin/SlackPlugin.java @@ -1,13 +1,14 @@ package com.aol.micro.server.slack.plugin; -import com.aol.cyclops.data.collections.extensions.persistent.PSetX; + import com.aol.micro.server.Plugin; import com.aol.micro.server.slack.*; +import cyclops.collections.immutable.PersistentSetX; public class SlackPlugin implements Plugin { @Override - public PSetX springClasses() { - return PSetX.of(SlackConfiguration.class, SlackMessageSender.class); + public PersistentSetX springClasses() { + return PersistentSetX.of(SlackConfiguration.class, SlackMessageSender.class); } } diff --git a/micro-spring-boot/src/main/java/com/aol/micro/server/spring/boot/BootFrontEndApplicationConfigurator.java b/micro-spring-boot/src/main/java/com/aol/micro/server/spring/boot/BootFrontEndApplicationConfigurator.java index b16174bb8..93131cfcb 100644 --- a/micro-spring-boot/src/main/java/com/aol/micro/server/spring/boot/BootFrontEndApplicationConfigurator.java +++ b/micro-spring-boot/src/main/java/com/aol/micro/server/spring/boot/BootFrontEndApplicationConfigurator.java @@ -10,7 +10,7 @@ import javax.servlet.ServletException; import javax.servlet.ServletRequestListener; -import cyclops.collections.immutable.PStackX; +import cyclops.collections.immutable.LinkedListX; import org.pcollections.PStack; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -83,11 +83,11 @@ public void onStartup(ServletContext webappContext) throws ServletException { rootContext, fullRestResource, module); List filterDataList = extractor.createFilteredDataList(serverData); List servletDataList = extractor.createServletDataList(serverData); - new ServletConfigurer(serverData, PStackX.fromIterable(servletDataList)).addServlets(webappContext); + new ServletConfigurer(serverData, LinkedListX.fromIterable(servletDataList)).addServlets(webappContext); - new FilterConfigurer(serverData, PStackX.fromIterable(filterDataList)).addFilters(webappContext); - PStack servletContextListenerData = PStackX.fromCollection(module.getListeners(serverData)).filter(i->!(i instanceof ContextLoader)); - PStack servletRequestListenerData = PStackX.fromCollection(module.getRequestListeners(serverData)); + new FilterConfigurer(serverData, LinkedListX.fromIterable(filterDataList)).addFilters(webappContext); + PStack servletContextListenerData = LinkedListX.fromIterable(module.getListeners(serverData)).filter(i->!(i instanceof ContextLoader)); + PStack servletRequestListenerData = LinkedListX.fromIterable(module.getRequestListeners(serverData)); new ServletContextListenerConfigurer(serverData, servletContextListenerData, servletRequestListenerData).addListeners(webappContext); diff --git a/micro-spring-boot/src/main/java/com/aol/micro/server/spring/boot/BootPlugin.java b/micro-spring-boot/src/main/java/com/aol/micro/server/spring/boot/BootPlugin.java index 10f9a7241..a1501532d 100644 --- a/micro-spring-boot/src/main/java/com/aol/micro/server/spring/boot/BootPlugin.java +++ b/micro-spring-boot/src/main/java/com/aol/micro/server/spring/boot/BootPlugin.java @@ -5,9 +5,9 @@ import javax.ws.rs.core.FeatureContext; -import cyclops.collections.MapXs; -import cyclops.collections.immutable.PMapX; -import cyclops.collections.immutable.PSetX; +import cyclops.companion.MapXs; +import cyclops.collections.immutable.PersistentMapX; +import cyclops.collections.immutable.PersistentSetX; import org.glassfish.jersey.CommonProperties; @@ -31,14 +31,14 @@ public SpringBuilder springBuilder(){ } @Override - public PSetX springClasses() { - return PSetX.of(SpringBootJerseyRestApplication.class); + public PersistentSetX springClasses() { + return PersistentSetX.of(SpringBootJerseyRestApplication.class); } @Override public Function> jacksonFeatureProperties(){ - return context-> PMapX.fromMap(MapXs.of( CommonProperties.MOXY_JSON_FEATURE_DISABLE + '.' + return context-> PersistentMapX.fromMap(MapXs.of( CommonProperties.MOXY_JSON_FEATURE_DISABLE + '.' + context.getConfiguration().getRuntimeType().name().toLowerCase(),true)); } diff --git a/micro-spring-boot/src/test/java/app/custom/binder/resource/objects/BinderTest.java b/micro-spring-boot/src/test/java/app/custom/binder/resource/objects/BinderTest.java index 0dc4cfade..68fb33f7b 100644 --- a/micro-spring-boot/src/test/java/app/custom/binder/resource/objects/BinderTest.java +++ b/micro-spring-boot/src/test/java/app/custom/binder/resource/objects/BinderTest.java @@ -6,7 +6,7 @@ import java.util.concurrent.ExecutionException; -import cyclops.collections.immutable.PSetX; +import cyclops.collections.immutable.PersistentSetX; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -26,7 +26,7 @@ public class BinderTest { public void startServer(){ - server = new MicroserverApp(ConfigurableModule.builder().context("binder").jaxRsResourceObjects(PSetX.of(new CustomBinder3())).build()); + server = new MicroserverApp(ConfigurableModule.builder().context("binder").jaxRsResourceObjects(PersistentSetX.of(new CustomBinder3())).build()); diff --git a/micro-swagger/src/main/java/com/aol/micro/server/rest/swagger/SwaggerPlugin.java b/micro-swagger/src/main/java/com/aol/micro/server/rest/swagger/SwaggerPlugin.java index de56158fd..1ceb390f3 100644 --- a/micro-swagger/src/main/java/com/aol/micro/server/rest/swagger/SwaggerPlugin.java +++ b/micro-swagger/src/main/java/com/aol/micro/server/rest/swagger/SwaggerPlugin.java @@ -13,7 +13,7 @@ import com.wordnik.swagger.jaxrs.listing.ApiListingResourceJSON; import com.wordnik.swagger.jersey.listing.JerseyApiDeclarationProvider; import com.wordnik.swagger.jersey.listing.JerseyResourceListingProvider; -import cyclops.collections.immutable.PSetX; +import cyclops.collections.immutable.PersistentSetX; import cyclops.function.Lambda; /** @@ -28,25 +28,25 @@ public class SwaggerPlugin implements Plugin{ @Override - public PSetX springClasses() { - return PSetX.empty(); + public PersistentSetX springClasses() { + return PersistentSetX.empty(); } @Override - public PSetX> servletContextListeners(){ - return PSetX.of(Lambda.l1(serverData -> new SwaggerInitializer(serverData))); + public PersistentSetX> servletContextListeners(){ + return PersistentSetX.of(Lambda.l1(serverData -> new SwaggerInitializer(serverData))); } @Override - public PSetX> jaxRsResources() { - return PSetX.of(ApiListingResourceJSON.class,JerseyApiDeclarationProvider.class, + public PersistentSetX> jaxRsResources() { + return PersistentSetX.of(ApiListingResourceJSON.class,JerseyApiDeclarationProvider.class, JerseyResourceListingProvider.class); } @Override - public PSetX jaxRsPackages() { - return PSetX.of("com.wordnik.swagger.sample.resource", + public PersistentSetX jaxRsPackages() { + return PersistentSetX.of("com.wordnik.swagger.sample.resource", "com.wordnik.swagger.sample.util" ); } } diff --git a/micro-swagger/src/test/java/com/aol/micro/server/rest/swagger/SwaggerInitializerTest.java b/micro-swagger/src/test/java/com/aol/micro/server/rest/swagger/SwaggerInitializerTest.java index 43c2b7691..78b0dabb6 100644 --- a/micro-swagger/src/test/java/com/aol/micro/server/rest/swagger/SwaggerInitializerTest.java +++ b/micro-swagger/src/test/java/com/aol/micro/server/rest/swagger/SwaggerInitializerTest.java @@ -1,6 +1,6 @@ package com.aol.micro.server.rest.swagger; -import cyclops.collections.immutable.PStackX; +import cyclops.collections.immutable.LinkedListX; import org.junit.Test; @@ -11,7 +11,7 @@ public class SwaggerInitializerTest { @Test public void testContextInitialized() { - SwaggerInitializer initializer = new SwaggerInitializer(ServerData.builder().resources(PStackX.of(new ServletStatusResource())).build()); + SwaggerInitializer initializer = new SwaggerInitializer(ServerData.builder().resources(LinkedListX.of(new ServletStatusResource())).build()); ServerData serverData = new ServerData(8080, ImmutableList.of(new ServletStatusResource()), null, "url", () -> "context"); initializer.contextInitialized(null); diff --git a/micro-tomcat-with-jersey/src/test/java/app/async/com/aol/micro/server/AsyncResource.java b/micro-tomcat-with-jersey/src/test/java/app/async/com/aol/micro/server/AsyncResource.java index 93f53a313..62f1ac0da 100644 --- a/micro-tomcat-with-jersey/src/test/java/app/async/com/aol/micro/server/AsyncResource.java +++ b/micro-tomcat-with-jersey/src/test/java/app/async/com/aol/micro/server/AsyncResource.java @@ -35,7 +35,7 @@ public class AsyncResource implements RestResource{ @Produces("text/plain") public void expensive(@Suspended AsyncResponse asyncResponse){ - FutureStream.lazyFutureStreamFromIterable(urls) + FutureStream.builder().fromIterable(urls) .then(it->client.get(it)) .onFail(it -> "") .peek(it -> diff --git a/micro-tomcat-with-jersey/src/test/java/app/embedded/com/aol/micro/server/TestAppResource.java b/micro-tomcat-with-jersey/src/test/java/app/embedded/com/aol/micro/server/TestAppResource.java index 49563fb00..e0ed8c1e2 100644 --- a/micro-tomcat-with-jersey/src/test/java/app/embedded/com/aol/micro/server/TestAppResource.java +++ b/micro-tomcat-with-jersey/src/test/java/app/embedded/com/aol/micro/server/TestAppResource.java @@ -37,7 +37,7 @@ public String ping() { @Path("/rest-calls") public String restCallResult(){ - return FutureStream.lazyFutureStreamFromIterable(urls) + return FutureStream.builder().fromIterable(urls) .map(it ->template.get(it)) .then(it -> "*"+it) .peek(loadedAndModified -> System.out.println(loadedAndModified)) diff --git a/micro-tomcat/src/test/java/app/async/com/aol/micro/server/AsyncResource.java b/micro-tomcat/src/test/java/app/async/com/aol/micro/server/AsyncResource.java index 93f53a313..62f1ac0da 100644 --- a/micro-tomcat/src/test/java/app/async/com/aol/micro/server/AsyncResource.java +++ b/micro-tomcat/src/test/java/app/async/com/aol/micro/server/AsyncResource.java @@ -35,7 +35,7 @@ public class AsyncResource implements RestResource{ @Produces("text/plain") public void expensive(@Suspended AsyncResponse asyncResponse){ - FutureStream.lazyFutureStreamFromIterable(urls) + FutureStream.builder().fromIterable(urls) .then(it->client.get(it)) .onFail(it -> "") .peek(it -> diff --git a/micro-tomcat/src/test/java/app/embedded/com/aol/micro/server/TestAppResource.java b/micro-tomcat/src/test/java/app/embedded/com/aol/micro/server/TestAppResource.java index b21062cae..3a79ad2d7 100644 --- a/micro-tomcat/src/test/java/app/embedded/com/aol/micro/server/TestAppResource.java +++ b/micro-tomcat/src/test/java/app/embedded/com/aol/micro/server/TestAppResource.java @@ -38,7 +38,7 @@ public String ping() { @Path("/rest-calls") public String restCallResult(){ - return FutureStream.lazyFutureStreamFromIterable(urls) + return FutureStream.builder().fromIterable(urls) .map(it ->template.get(it)) .then(it -> "*"+it) .peek(loadedAndModified -> System.out.println(loadedAndModified)) diff --git a/micro-transactions/src/main/java/com/aol/micro/server/transactions/TransactionsPlugin.java b/micro-transactions/src/main/java/com/aol/micro/server/transactions/TransactionsPlugin.java index 543c05aed..a3b58af15 100644 --- a/micro-transactions/src/main/java/com/aol/micro/server/transactions/TransactionsPlugin.java +++ b/micro-transactions/src/main/java/com/aol/micro/server/transactions/TransactionsPlugin.java @@ -1,7 +1,7 @@ package com.aol.micro.server.transactions; import com.aol.micro.server.Plugin; -import cyclops.collections.immutable.PSetX; +import cyclops.collections.immutable.PersistentSetX; /** * @@ -11,8 +11,8 @@ public class TransactionsPlugin implements Plugin{ @Override - public PSetX springClasses() { - return PSetX.of(TransactionConfiguration.class); + public PersistentSetX springClasses() { + return PersistentSetX.of(TransactionConfiguration.class); }