<?xml version="1.0" ?>
<!--
  ~ Copyright The WildFly Authors
  ~ SPDX-License-Identifier: Apache-2.0
  -->

<layer-spec xmlns="urn:jboss:galleon:layer-spec:2.0" name="ejb-lite">
    <!-- Aggregates the functionality roughly associated with the EJB Lite concept.
         Note that the timer-service feature provides persistent timers which goes beyond EJB Lite requirements. -->
    <props>
        <prop name="org.wildfly.rule.annotations" value="jakarta.ejb"/>
        <prop name="org.wildfly.rule.class" value="jakarta.ejb"/>
    </props>
    <dependencies>
        <layer name="transactions"/>
        <!-- SFSB requires a cache, so we depend on a layer for local infinispan caching.
             Users can exclude this layer and include ejb-dist-cache to get
             a distributed cache.  But some cache must be configured. -->
        <layer name="ejb-local-cache" optional="true"/>
        <layer name="naming"/>
    </dependencies>
    <feature spec="subsystem.discovery"/>
    <feature spec="subsystem.ejb3">
        <param name="default-security-domain" value="other"/>
        <feature spec="subsystem.ejb3.application-security-domain">
            <param name="application-security-domain" value="other"/>
            <param name="security-domain" value="ApplicationDomain"/>
        </feature>
        <param name="log-system-exceptions" value="true"/>
        <param name="statistics-enabled" value="${wildfly.ejb3.statistics-enabled:${wildfly.statistics-enabled:false}}"/>
        <param name="default-slsb-instance-pool" value="slsb-strict-max-pool"/>
        <param name="default-singleton-bean-access-timeout" value="5000"/>
        <param name="default-missing-method-permissions-deny-access" value="true"/>
        <feature spec="subsystem.ejb3.strict-max-bean-instance-pool">
            <param name="strict-max-bean-instance-pool" value="slsb-strict-max-pool"/>
            <param name="derive-size" value="from-worker-pools"/>
            <param name="timeout" value="5"/>
            <param name="timeout-unit" value="MINUTES"/>
        </feature>
        <param name="default-sfsb-passivation-disabled-cache" value="simple"/>
        <param name="default-stateful-bean-access-timeout" value="5000"/>
        <feature spec="subsystem.ejb3.simple-cache">
            <param name="simple-cache" value="simple"/>
        </feature>
        <feature spec="subsystem.ejb3.distributable-cache">
            <param name="distributable-cache" value="distributable"/>
        </feature>
        <feature spec="subsystem.ejb3.service.async">
            <param name="thread-pool-name" value="default"/>
        </feature>
        <feature spec="subsystem.ejb3.thread-pool">
            <param name="thread-pool" value="default"/>
            <param name="max-threads" value="10"/>
            <feature spec="subsystem.ejb3.thread-pool.keepalive-time">
                <param name="time" value="60"/>
                <param name="unit" value="SECONDS"/>
            </feature>
        </feature>
        <feature spec="subsystem.ejb3.service.timer-service">
            <param name="default-data-store" value="default-file-store"/>
            <param name="thread-pool-name" value="default"/>
            <feature spec="subsystem.ejb3.service.timer-service.file-data-store">
                <param name="file-data-store" value="default-file-store"/>
                <param name="path" value="timer-service-data" />
                <param name="relative-to" value="jboss.server.data.dir" />
            </feature>
        </feature>
    </feature>
    <feature spec="subsystem.elytron.permission-set.permissions">
        <param name="subsystem" value="elytron"/>
        <param name="permission-set" value="default-permissions"/>
        <param name="module" value="org.jboss.ejb-client"/>
        <param name="class-name" value="org.jboss.ejb.client.RemoteEJBPermission"/>
    </feature>
</layer-spec>
