Search in sources :

Example 1 with ClientScoped

use of com.canoo.platform.server.javaee.ClientScoped in project dolphin-platform by canoo.

the class CdiBeanFactory method createDolphinSession.

@Produces
@ClientScoped
public ClientSession createDolphinSession() {
    final ClientSessionProvider provider = PlatformBootstrap.getServerCoreComponents().getInstance(ClientSessionProvider.class);
    Assert.requireNonNull(provider, "provider");
    return provider.getCurrentClientSession();
}
Also used : ClientSessionProvider(com.canoo.dp.impl.server.client.ClientSessionProvider) Produces(javax.enterprise.inject.Produces) ClientScoped(com.canoo.platform.server.javaee.ClientScoped)

Example 2 with ClientScoped

use of com.canoo.platform.server.javaee.ClientScoped in project dolphin-platform by canoo.

the class RemotingCdiBeanFactory method createRemotingContext.

@Produces
@ClientScoped
public RemotingContext createRemotingContext(RemotingEventBus eventBus) {
    Assert.requireNonNull(eventBus, "eventBus");
    final DolphinContextProvider contextProvider = PlatformBootstrap.getServerCoreComponents().getInstance(DolphinContextProvider.class);
    Assert.requireNonNull(contextProvider, "contextProvider");
    final DolphinContext context = contextProvider.getCurrentDolphinContext();
    Assert.requireNonNull(context, "context");
    return new RemotingContextImpl(context, eventBus);
}
Also used : DolphinContext(com.canoo.dp.impl.server.context.DolphinContext) DolphinContextProvider(com.canoo.dp.impl.server.context.DolphinContextProvider) RemotingContextImpl(com.canoo.dp.impl.server.context.RemotingContextImpl) Produces(javax.enterprise.inject.Produces) ClientScoped(com.canoo.platform.server.javaee.ClientScoped)

Aggregations

ClientScoped (com.canoo.platform.server.javaee.ClientScoped)2 Produces (javax.enterprise.inject.Produces)2 ClientSessionProvider (com.canoo.dp.impl.server.client.ClientSessionProvider)1 DolphinContext (com.canoo.dp.impl.server.context.DolphinContext)1 DolphinContextProvider (com.canoo.dp.impl.server.context.DolphinContextProvider)1 RemotingContextImpl (com.canoo.dp.impl.server.context.RemotingContextImpl)1