Skip to content

Commit

Permalink
refactor: Rename HttpRequestScoped to OtpServerRequestScope
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Gran <[email protected]>
  • Loading branch information
t2gran committed Jan 24, 2024
1 parent b0b45ec commit 103e08e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
import org.opentripplanner.routing.api.request.StreetMode;
import org.opentripplanner.routing.error.PathNotFoundException;
import org.opentripplanner.routing.impl.GraphPathFinder;
import org.opentripplanner.standalone.api.HttpRequestScoped;
import org.opentripplanner.standalone.api.OtpServerRequestContext;
import org.opentripplanner.standalone.api.OtpServerRequestScope;
import org.opentripplanner.street.model.edge.Edge;
import org.opentripplanner.street.model.vertex.Vertex;
import org.opentripplanner.street.search.TemporaryVerticesContainer;
import org.opentripplanner.street.search.state.State;
import org.opentripplanner.transit.service.TransitService;

@HttpRequestScoped
@OtpServerRequestScope
public class DirectStreetRouter {

private final OtpServerRequestContext serverContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@
* for the synchronization. Only request scoped components need to be synchronized - they are
* potentially lazy initialized.
*/
@HttpRequestScoped
@OtpServerRequestScope
public interface OtpServerRequestContext {
/**
* A RouteRequest containing default parameters that will be cloned when handling each request.
*/
@HttpRequestScoped
@OtpServerRequestScope
RouteRequest defaultRouteRequest();

/**
Expand All @@ -68,7 +68,7 @@ public interface OtpServerRequestContext {

Graph graph();

@HttpRequestScoped
@OtpServerRequestScope
@Deprecated
TransitService transitService();

Expand All @@ -78,7 +78,7 @@ public interface OtpServerRequestContext {
* realtime update that happens during the request will not affect the returned service and will
* not be visible to the request.
*/
@HttpRequestScoped
@OtpServerRequestScope
RoutingService routingService();

/**
Expand Down Expand Up @@ -111,7 +111,7 @@ public interface OtpServerRequestContext {
* Callback which is injected into the {@code DirectStreetRouter}, used to visualize the
* search.
*/
@HttpRequestScoped
@OtpServerRequestScope
TraverseVisitor<State, Edge> traverseVisitor();

default GraphFinder graphFinder() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
@Target({ ElementType.METHOD, ElementType.TYPE })
@Retention(RetentionPolicy.SOURCE)
@Inherited
public @interface HttpRequestScoped {
public @interface OtpServerRequestScope {
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
import org.opentripplanner.service.realtimevehicles.RealtimeVehicleService;
import org.opentripplanner.service.vehiclerental.VehicleRentalService;
import org.opentripplanner.service.worldenvelope.WorldEnvelopeService;
import org.opentripplanner.standalone.api.HttpRequestScoped;
import org.opentripplanner.standalone.api.OtpServerRequestContext;
import org.opentripplanner.standalone.api.OtpServerRequestScope;
import org.opentripplanner.standalone.config.routerconfig.TransitRoutingConfig;
import org.opentripplanner.standalone.config.sandbox.FlexConfig;
import org.opentripplanner.transit.service.TransitService;

@HttpRequestScoped
@OtpServerRequestScope
public class DefaultServerRequestContext implements OtpServerRequestContext {

private final List<RideHailingService> rideHailingServices;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

import dagger.Binds;
import dagger.Module;
import org.opentripplanner.standalone.api.HttpRequestScoped;
import org.opentripplanner.standalone.api.OtpServerRequestScope;
import org.opentripplanner.transit.service.DefaultTransitService;
import org.opentripplanner.transit.service.TransitService;

@Module
public abstract class TransitModule {

@Binds
@HttpRequestScoped
@OtpServerRequestScope
abstract TransitService bind(DefaultTransitService service);
}

0 comments on commit 103e08e

Please sign in to comment.