Search in sources :

Example 1 with SimpleMarshallingConfigurationRepository

use of org.wildfly.clustering.marshalling.jboss.SimpleMarshallingConfigurationRepository in project wildfly by wildfly.

the class DistributableSessionManagerFactoryBuilder method build.

@Override
public ServiceBuilder<SessionManagerFactory> build(CapabilityServiceSupport support, ServiceTarget target, ServiceName name, DistributableSessionManagerConfiguration config) {
    Module module = config.getModule();
    MarshallingContext context = new SimpleMarshallingContextFactory().createMarshallingContext(new SimpleMarshallingConfigurationRepository(MarshallingVersion.class, MarshallingVersion.CURRENT, module), module.getClassLoader());
    MarshalledValueFactory<MarshallingContext> factory = new SimpleMarshalledValueFactory(context);
    SessionManagerFactoryConfiguration<MarshallingContext> configuration = new SessionManagerFactoryConfiguration<MarshallingContext>() {

        @Override
        public int getMaxActiveSessions() {
            return config.getMaxActiveSessions();
        }

        @Override
        public SessionAttributePersistenceStrategy getAttributePersistenceStrategy() {
            return strategies.get(config.getGranularity());
        }

        @Override
        public String getDeploymentName() {
            return config.getDeploymentName();
        }

        @Override
        public String getCacheName() {
            return config.getCacheName();
        }

        @Override
        public MarshalledValueFactory<MarshallingContext> getMarshalledValueFactory() {
            return factory;
        }

        @Override
        public MarshallingContext getMarshallingContext() {
            return context;
        }
    };
    Builder<org.wildfly.clustering.web.session.SessionManagerFactory<Batch>> builder = this.provider.getBuilder(configuration).configure(support);
    builder.build(target).install();
    return target.addService(name, new ValueService<>(this)).addDependency(builder.getServiceName(), org.wildfly.clustering.web.session.SessionManagerFactory.class, this.factory).setInitialMode(ServiceController.Mode.ON_DEMAND);
}
Also used : SessionManagerFactoryConfiguration(org.wildfly.clustering.web.session.SessionManagerFactoryConfiguration) SimpleMarshallingConfigurationRepository(org.wildfly.clustering.marshalling.jboss.SimpleMarshallingConfigurationRepository) SimpleMarshallingContextFactory(org.wildfly.clustering.marshalling.jboss.SimpleMarshallingContextFactory) SimpleMarshalledValueFactory(org.wildfly.clustering.marshalling.jboss.SimpleMarshalledValueFactory) SessionManagerFactory(io.undertow.servlet.api.SessionManagerFactory) MarshallingContext(org.wildfly.clustering.marshalling.jboss.MarshallingContext) Module(org.jboss.modules.Module)

Example 2 with SimpleMarshallingConfigurationRepository

use of org.wildfly.clustering.marshalling.jboss.SimpleMarshallingConfigurationRepository in project wildfly by wildfly.

the class SSOManagerBuilder method start.

@Override
public void start(StartContext context) throws StartException {
    SSOManagerFactory<A, D, S, Batch> factory = this.factory.getValue();
    Module module = Module.forClass(this.getClass());
    this.context = new SimpleMarshallingContextFactory().createMarshallingContext(new SimpleMarshallingConfigurationRepository(MarshallingVersion.class, MarshallingVersion.CURRENT, module), null);
    this.manager = factory.createSSOManager(this);
    this.manager.start();
}
Also used : Batch(org.wildfly.clustering.ee.Batch) SimpleMarshallingConfigurationRepository(org.wildfly.clustering.marshalling.jboss.SimpleMarshallingConfigurationRepository) SimpleMarshallingContextFactory(org.wildfly.clustering.marshalling.jboss.SimpleMarshallingContextFactory) Module(org.jboss.modules.Module)

Aggregations

Module (org.jboss.modules.Module)2 SimpleMarshallingConfigurationRepository (org.wildfly.clustering.marshalling.jboss.SimpleMarshallingConfigurationRepository)2 SimpleMarshallingContextFactory (org.wildfly.clustering.marshalling.jboss.SimpleMarshallingContextFactory)2 SessionManagerFactory (io.undertow.servlet.api.SessionManagerFactory)1 Batch (org.wildfly.clustering.ee.Batch)1 MarshallingContext (org.wildfly.clustering.marshalling.jboss.MarshallingContext)1 SimpleMarshalledValueFactory (org.wildfly.clustering.marshalling.jboss.SimpleMarshalledValueFactory)1 SessionManagerFactoryConfiguration (org.wildfly.clustering.web.session.SessionManagerFactoryConfiguration)1