Search in sources :

Example 1 with ClientScope

use of com.canoo.platform.server.spring.ClientScope in project dolphin-platform by canoo.

the class SpringBeanFactory method createClientSession.

@Bean(name = "clientSession")
@ClientScope
protected ClientSession createClientSession() {
    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) ClientScope(com.canoo.platform.server.spring.ClientScope) Bean(org.springframework.context.annotation.Bean)

Example 2 with ClientScope

use of com.canoo.platform.server.spring.ClientScope in project dolphin-platform by canoo.

the class RemotingSpringBeanFactory method createRemotingContext.

@Bean(name = "remotingContext")
@ClientScope
protected 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) ClientScope(com.canoo.platform.server.spring.ClientScope) Bean(org.springframework.context.annotation.Bean)

Aggregations

ClientScope (com.canoo.platform.server.spring.ClientScope)2 Bean (org.springframework.context.annotation.Bean)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