Skip to content

Commit

Permalink
rename.
Browse files Browse the repository at this point in the history
  • Loading branch information
portlek committed Sep 30, 2024
1 parent 2398b7b commit 687d9e6
Show file tree
Hide file tree
Showing 52 changed files with 245 additions and 245 deletions.
4 changes: 2 additions & 2 deletions common/src/main/java/net/infumia/frame/Frame.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import net.infumia.frame.context.view.ContextRender;
import net.infumia.frame.logger.Logger;
import net.infumia.frame.pipeline.Pipelined;
import net.infumia.frame.pipeline.executor.PipelineExecutorManager;
import net.infumia.frame.pipeline.executor.PipelineExecutorFrame;
import net.infumia.frame.task.TaskFactory;
import net.infumia.frame.typedkey.TypedKeyStorageFactory;
import net.infumia.frame.typedkey.TypedKeyStorageImmutableBuilder;
Expand All @@ -18,7 +18,7 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public interface Frame extends Pipelined<PipelineExecutorManager> {
public interface Frame extends Pipelined<PipelineExecutorFrame> {
@NotNull
static Frame create(@NotNull final Plugin plugin) {
return Internal.factory().create(plugin);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

public interface Context extends StateFactory {
@NotNull
Frame manager();
Frame frame();

@NotNull
TypedKeyStorage instances();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@
import net.infumia.frame.view.View;
import org.jetbrains.annotations.NotNull;

public interface PipelineContextManager extends PipelineContext {
public interface PipelineContextFrame extends PipelineContext {
@NotNull
Frame frame();

interface ViewCreated extends PipelineContextManager {
interface ViewCreated extends PipelineContextFrame {
@NotNull
Collection<Class<?>> registeredViews();
}

interface ViewRegistered extends PipelineContextManager {
interface ViewRegistered extends PipelineContextFrame {
@NotNull
Collection<Object> registeredViews();

@NotNull
Consumer<TypedKeyStorageImmutableBuilder> instanceConfigurer();
}

interface ListenerRegistered extends PipelineContextManager {}
interface ListenerRegistered extends PipelineContextFrame {}

interface ViewUnregistered extends PipelineContextManager {
interface ViewUnregistered extends PipelineContextFrame {
@NotNull
Collection<View> unregisteredViews();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

public interface PipelineContextState extends PipelineContext {
@NotNull
Frame manager();
Frame frame();

@NotNull
State<?> state();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
import java.util.Collection;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import net.infumia.frame.pipeline.context.PipelineContextManager;
import net.infumia.frame.pipeline.context.PipelineContextFrame;
import net.infumia.frame.service.ConsumerService;
import net.infumia.frame.service.Implementation;
import net.infumia.frame.typedkey.TypedKeyStorageImmutableBuilder;
import net.infumia.frame.view.View;
import org.jetbrains.annotations.NotNull;

public interface PipelineExecutorManager {
public interface PipelineExecutorFrame {
@NotNull
CompletableFuture<Collection<Object>> executeViewCreated(
@NotNull Collection<Class<?>> registeredViews
Expand All @@ -32,28 +32,28 @@ CompletableFuture<ConsumerService.State> executeViewUnregistered(

void applyViewCreated(
@NotNull Implementation<
PipelineContextManager.ViewCreated,
PipelineContextFrame.ViewCreated,
Collection<Object>
> implementation
);

void applyViewRegistered(
@NotNull Implementation<
PipelineContextManager.ViewRegistered,
PipelineContextFrame.ViewRegistered,
Collection<View>
> implementation
);

void applyListenersRegistered(
@NotNull Implementation<
PipelineContextManager.ListenerRegistered,
PipelineContextFrame.ListenerRegistered,
ConsumerService.State
> implementation
);

void applyViewUnregistered(
@NotNull Implementation<
PipelineContextManager.ViewUnregistered,
PipelineContextFrame.ViewUnregistered,
ConsumerService.State
> implementation
);
Expand Down
8 changes: 4 additions & 4 deletions core/src/main/java/net/infumia/frame/FrameImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import net.infumia.frame.logger.Logger;
import net.infumia.frame.metadata.MetadataAccessFactory;
import net.infumia.frame.metadata.MetadataAccessFactoryImpl;
import net.infumia.frame.pipeline.executor.PipelineExecutorManager;
import net.infumia.frame.pipeline.executor.PipelineExecutorManagerImpl;
import net.infumia.frame.pipeline.executor.PipelineExecutorFrame;
import net.infumia.frame.pipeline.executor.PipelineExecutorFrameImpl;
import net.infumia.frame.task.TaskFactory;
import net.infumia.frame.task.TaskFactoryImpl;
import net.infumia.frame.typedkey.TypedKeyStorageFactory;
Expand All @@ -44,7 +44,7 @@ final class FrameImpl implements FrameRich {
private final Collection<Class<?>> unregisteredViews = ConcurrentHashMap.newKeySet();
private final Map<Class<?>, View> registeredViews = new ConcurrentHashMap<>();
private final AtomicBoolean registered = new AtomicBoolean(false);
private final PipelineExecutorManager pipelines = new PipelineExecutorManagerImpl(this);
private final PipelineExecutorFrame pipelines = new PipelineExecutorFrameImpl(this);
private final ViewCreator viewCreator = new ViewCreatorImpl();
private final Logger logger;
private final TaskFactory taskFactory;
Expand Down Expand Up @@ -256,7 +256,7 @@ public Frame with(@NotNull final Class<?> viewClass) {

@NotNull
@Override
public PipelineExecutorManager pipelines() {
public PipelineExecutorFrame pipelines() {
return this.pipelines;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public boolean sharedView() {
public CompletableFuture<@Nullable ContextRender> openForEveryone(
@NotNull final Class<?> viewClass
) {
return this.manager()
return this.frame()
.open(
this.viewers().stream().map(Viewer::player).collect(Collectors.toSet()),
viewClass
Expand All @@ -127,7 +127,7 @@ public boolean sharedView() {
@NotNull final Class<?> viewClass,
@NotNull final Consumer<TypedKeyStorageImmutableBuilder> initialDataConfigurer
) {
return this.manager()
return this.frame()
.open(
this.viewers().stream().map(Viewer::player).collect(Collectors.toSet()),
viewClass,
Expand All @@ -140,7 +140,7 @@ public boolean sharedView() {
public CompletableFuture<@Nullable ContextRender> openForViewer(
@NotNull final Class<?> viewClass
) {
return this.manager().open(this.viewerOrThrow("openForViewer").player(), viewClass);
return this.frame().open(this.viewerOrThrow("openForViewer").player(), viewClass);
}

@NotNull
Expand All @@ -149,7 +149,7 @@ public boolean sharedView() {
@NotNull final Class<?> viewClass,
@NotNull final Consumer<TypedKeyStorageImmutableBuilder> initialData
) {
return this.manager()
return this.frame()
.open(this.viewerOrThrow("openForViewer").player(), viewClass, initialData);
}

Expand Down
12 changes: 6 additions & 6 deletions core/src/main/java/net/infumia/frame/context/ContextImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,29 @@

public class ContextImpl extends StateFactoryImpl implements ContextRich {

private final Frame manager;
private final Frame frame;
private final TypedKeyStorage instances;
private final StateRegistry stateRegistry;

public ContextImpl(
@NotNull final Frame manager,
@NotNull final Frame frame,
@NotNull final TypedKeyStorage instances,
@NotNull final StateRegistry stateRegistry
) {
super(stateRegistry);
this.manager = manager;
this.frame = frame;
this.instances = instances;
this.stateRegistry = stateRegistry;
}

public ContextImpl(@NotNull final Context context) {
this(context.manager(), context.instances(), ((ContextRich) context).stateRegistry());
this(context.frame(), context.instances(), ((ContextRich) context).stateRegistry());
}

@NotNull
@Override
public Frame manager() {
return this.manager;
public Frame frame() {
return this.frame;
}

@NotNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,15 @@ public void back() {
metadata.remove(MetadataKeyHolder.PREVIOUS_VIEWS);
}
CompletableFutureExtensions.logError(
this.manager()
this.frame()
.openActive(viewer.player(), previousContext)
.thenCompose(__ ->
((ContextRenderRich) previousContext).simulateResume(
this,
Collections.singleton(viewer)
)
),
this.manager().logger(),
this.frame().logger(),
"An error occurred while going back to view '%s'.",
previousContext.view().instance()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public void switchTo(final int pageIndex) {
}
CompletableFutureExtensions.logError(
this.pipelines.executeUpdate(host, false),
this.parent().manager().logger(),
this.parent().frame().logger(),
"An error occurred while updating the pagination '%s'.",
this
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
import net.infumia.frame.view.View;
import org.jetbrains.annotations.NotNull;

public interface PipelineContextManagers {
final class ViewCreated implements PipelineContextManager.ViewCreated {
public interface PipelineContextFrames {
final class ViewCreated implements PipelineContextFrame.ViewCreated {

private final Frame manager;
private final Frame frame;
private final Collection<Class<?>> registeredViews;

public ViewCreated(
@NotNull final Frame manager,
@NotNull final Frame frame,
@NotNull final Collection<Class<?>> registeredViews
) {
this.manager = manager;
this.frame = frame;
this.registeredViews = registeredViews;
}

Expand All @@ -30,30 +30,30 @@ public Collection<Class<?>> registeredViews() {
@NotNull
@Override
public Frame frame() {
return this.manager;
return this.frame;
}
}

final class ViewRegistered implements PipelineContextManager.ViewRegistered {
final class ViewRegistered implements PipelineContextFrame.ViewRegistered {

private final Frame manager;
private final Frame frame;
private final Collection<Object> registeredViews;
private final Consumer<TypedKeyStorageImmutableBuilder> storageConfigurer;

public ViewRegistered(
@NotNull final Frame manager,
@NotNull final Frame frame,
@NotNull final Collection<Object> registeredViews,
@NotNull final Consumer<TypedKeyStorageImmutableBuilder> storageConfigurer
) {
this.manager = manager;
this.frame = frame;
this.registeredViews = registeredViews;
this.storageConfigurer = storageConfigurer;
}

@NotNull
@Override
public Frame frame() {
return this.manager;
return this.frame;
}

@NotNull
Expand All @@ -69,38 +69,38 @@ public Consumer<TypedKeyStorageImmutableBuilder> instanceConfigurer() {
}
}

final class ListenerRegistered implements PipelineContextManager.ListenerRegistered {
final class ListenerRegistered implements PipelineContextFrame.ListenerRegistered {

private final Frame manager;
private final Frame frame;

public ListenerRegistered(@NotNull final Frame manager) {
this.manager = manager;
public ListenerRegistered(@NotNull final Frame frame) {
this.frame = frame;
}

@NotNull
@Override
public Frame frame() {
return this.manager;
return this.frame;
}
}

final class ViewUnregistered implements PipelineContextManager.ViewUnregistered {
final class ViewUnregistered implements PipelineContextFrame.ViewUnregistered {

private final Frame manager;
private final Frame frame;
private final Collection<View> unregisteredViews;

public ViewUnregistered(
@NotNull final Frame manager,
@NotNull final Frame frame,
@NotNull final Collection<View> unregisteredViews
) {
this.manager = manager;
this.frame = frame;
this.unregisteredViews = unregisteredViews;
}

@NotNull
@Override
public Frame frame() {
return this.manager;
return this.frame;
}

@NotNull
Expand Down
Loading

0 comments on commit 687d9e6

Please sign in to comment.