Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions sdk/src/main/java/io/dapr/actors/client/ActorProxyAsyncClient.java

This file was deleted.

17 changes: 4 additions & 13 deletions sdk/src/main/java/io/dapr/actors/client/ActorProxyBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import io.dapr.actors.ActorId;
import io.dapr.actors.runtime.ActorStateSerializer;
import io.dapr.client.DaprClientBuilder;
import okhttp3.OkHttpClient;

/**
* Builder to generate an ActorProxy instance.
Expand All @@ -16,7 +18,7 @@ public class ActorProxyBuilder {
/**
* Builder for the Dapr client.
*/
private final ActorProxyClientBuilder clientBuilder = new ActorProxyClientBuilder();
private final DaprClientBuilder clientBuilder = new DaprClientBuilder();

/**
* Actor's type.
Expand All @@ -28,17 +30,6 @@ public class ActorProxyBuilder {
*/
private ActorId actorId;

/**
* Changes build config to use specific port.
*
* @param port Port to be used.
* @return Same builder object.
*/
public ActorProxyBuilder withPort(int port) {
this.clientBuilder.withPort(port);
return this;
}

/**
* Changes build config to use given Actor's type.
*
Expand Down Expand Up @@ -80,7 +71,7 @@ public ActorProxy build() {
this.actorType,
this.actorId,
SERIALIZER,
this.clientBuilder.buildAsyncClient());
this.clientBuilder.build());
}

}

This file was deleted.

This file was deleted.

5 changes: 3 additions & 2 deletions sdk/src/main/java/io/dapr/actors/client/ActorProxyImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import io.dapr.actors.ActorId;
import io.dapr.actors.runtime.ActorStateSerializer;
import io.dapr.client.DaprClient;
import reactor.core.publisher.Mono;

import java.io.IOException;
Expand Down Expand Up @@ -29,7 +30,7 @@ class ActorProxyImpl implements ActorProxy {
/**
* Client to talk to the Dapr's API.
*/
private final ActorProxyAsyncClient daprClient;
private final DaprClient daprClient;

/**
* Creates a new instance of {@link ActorProxyAsyncClient}.
Expand All @@ -39,7 +40,7 @@ class ActorProxyImpl implements ActorProxy {
* @param serializer Serializer and deserializer for method calls.
* @param daprClient Dapr client.
*/
ActorProxyImpl(String actorType, ActorId actorId, ActorStateSerializer serializer, ActorProxyAsyncClient daprClient) {
ActorProxyImpl(String actorType, ActorId actorId, ActorStateSerializer serializer, DaprClient daprClient) {
this.actorType = actorType;
this.actorId = actorId;
this.daprClient = daprClient;
Expand Down
6 changes: 3 additions & 3 deletions sdk/src/main/java/io/dapr/actors/runtime/AbstractActor.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ protected <T> Mono<Void> registerReminder(
String data = this.actorRuntimeContext.getActorSerializer().serialize(state);
ActorReminderParams params = new ActorReminderParams(data, dueTime, period);
String serialized = this.actorRuntimeContext.getActorSerializer().serialize(params);
return this.actorRuntimeContext.getDaprClient().registerReminder(
return this.actorRuntimeContext.getDaprClient().registerActorReminder(
this.actorRuntimeContext.getActorTypeInformation().getName(),
this.id.toString(),
reminderName,
Expand Down Expand Up @@ -142,7 +142,7 @@ protected <T> Mono<Void> registerActorTimer(
String serializedTimer = this.actorRuntimeContext.getActorSerializer().serialize(actorTimer);

this.timers.put(name, actorTimer);
return this.actorRuntimeContext.getDaprClient().registerTimer(
return this.actorRuntimeContext.getDaprClient().registerActorTimer(
this.actorRuntimeContext.getActorTypeInformation().getName(),
this.id.toString(),
name,
Expand All @@ -159,7 +159,7 @@ protected <T> Mono<Void> registerActorTimer(
* @return Asynchronous void response.
*/
protected Mono<Void> unregister(ActorTimer actorTimer) {
return this.actorRuntimeContext.getDaprClient().unregisterTimer(
return this.actorRuntimeContext.getDaprClient().unregisterActorTimer(
this.actorRuntimeContext.getActorTypeInformation().getName(),
this.id.toString(),
actorTimer.getName())
Expand Down
12 changes: 7 additions & 5 deletions sdk/src/main/java/io/dapr/actors/runtime/ActorRuntime.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

import io.dapr.actors.ActorId;
import io.dapr.actors.ActorTrace;
import io.dapr.client.DaprClient;
import io.dapr.client.DaprClientBuilder;
import reactor.core.publisher.Mono;

import java.util.Collection;
Expand Down Expand Up @@ -37,7 +39,7 @@ public class ActorRuntime {
/**
* A client used to communicate from the actor to the Dapr runtime.
*/
private final AppToDaprAsyncClient appToDaprAsyncClient;
private final DaprClient daprClient;

/**
* State provider for Dapr.
Expand Down Expand Up @@ -65,9 +67,9 @@ private ActorRuntime() throws IllegalStateException {
}

this.actorManagers = Collections.synchronizedMap(new HashMap<>());
this.appToDaprAsyncClient = new AppToDaprClientBuilder().buildAsyncClient();
this.daprClient = new DaprClientBuilder().build();
this.actorSerializer = new ActorStateSerializer();
this.daprStateProvider = new DaprStateAsyncProvider(this.appToDaprAsyncClient, this.actorSerializer);
this.daprStateProvider = new DaprStateAsyncProvider(this.daprClient, this.actorSerializer);
}

/**
Expand Down Expand Up @@ -126,8 +128,8 @@ public <T extends AbstractActor> Mono<Void> registerActor(Class<T> clazz, ActorF
this.actorSerializer,
actualActorFactory,
actorTypeInfo,
this.appToDaprAsyncClient,
new DaprStateAsyncProvider(this.appToDaprAsyncClient, this.actorSerializer));
this.daprClient,
new DaprStateAsyncProvider(this.daprClient, this.actorSerializer));

// Create ActorManagers, override existing entry if registered again.
this.actorManagers.put(actorTypeInfo.getName(), new ActorManager<T>(context));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
package io.dapr.actors.runtime;

import io.dapr.actors.ActorTrace;
import io.dapr.client.DaprClient;

/**
* Provides the context for the Actor's runtime.
Expand Down Expand Up @@ -42,7 +43,7 @@ public class ActorRuntimeContext<T extends AbstractActor> {
/**
* Client to communicate to Dapr's API.
*/
private final AppToDaprAsyncClient daprClient;
private final DaprClient daprClient;

/**
* State provider for given Actor Type.
Expand All @@ -63,7 +64,7 @@ public class ActorRuntimeContext<T extends AbstractActor> {
ActorStateSerializer actorSerializer,
ActorFactory<T> actorFactory,
ActorTypeInformation<T> actorTypeInformation,
AppToDaprAsyncClient daprClient,
DaprClient daprClient,
DaprStateAsyncProvider stateProvider) {
this.actorRuntime = actorRuntime;
this.actorSerializer = actorSerializer;
Expand Down Expand Up @@ -124,7 +125,7 @@ ActorTrace getActorTrace() {
*
* @return Client to communicate to Dapr's API.
*/
AppToDaprAsyncClient getDaprClient() {
DaprClient getDaprClient() {
return this.daprClient;
}

Expand Down
75 changes: 0 additions & 75 deletions sdk/src/main/java/io/dapr/actors/runtime/AppToDaprAsyncClient.java

This file was deleted.

This file was deleted.

Loading