private static Factory.Builder newFactoryBuilder(String serverId, Optional<String> bladeId, Optional<String> threadLocalId, String mode) { Factory.Builder builder = newFactoryBuilder(serverId); if (threadLocalId.isPresent()) { builder.addLocalMachines(Factory.LocalMachines.threadLocalFrom(threadLocalId.get())); } if (bladeId.isPresent()) { builder.addLocalMachines(Factory.LocalMachines.contextLocal(Blade.contextId(serverId, bladeId.get()))); } builder.addMachine(new SingletonFactoryMachine<>( -100000, NamedComponent.of(String.class, "restx.mode", mode))); return builder; }
private static Factory.Builder newFactoryBuilder(String serverId, Optional<String> bladeId, Optional<String> threadLocalId, String mode) { Factory.Builder builder = newFactoryBuilder(serverId); if (threadLocalId.isPresent()) { builder.addLocalMachines(Factory.LocalMachines.threadLocalFrom(threadLocalId.get())); } if (bladeId.isPresent()) { builder.addLocalMachines(Factory.LocalMachines.contextLocal(Blade.contextId(serverId, bladeId.get()))); } builder.addMachine(new SingletonFactoryMachine<>( -100000, NamedComponent.of(String.class, "restx.mode", mode))); return builder; }