<?xml version="1.0" encoding="UTF-8"?>
<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns="urn:jboss:bean-deployer:2.0">
	
	<bean name="Mobicents.JAINSLEE.CacheConfig" class="org.jboss.cache.config.Configuration">  
      <property name="runtimeConfig">
         <bean name="MobicentsJAINSLEEJBossCacheRuntimeConfig" class="org.jboss.cache.config.RuntimeConfig">
            <property name="transactionManager">
               <inject bean="RealTransactionManager"/>
            </property>
         </bean>
      </property>
      <property name="cacheMode">LOCAL</property>
      <property name="lockAcquisitionTimeout">30000</property>
      <property name="useLockStriping">false</property>
      <property name="exposeManagementStatistics">false</property> 
      <property name="shutdownHookBehavior">DONT_REGISTER</property>   
   </bean>
   
	<bean name="Mobicents.JAINSLEE.Cache" class="org.mobicents.cache.MobicentsCache">
		<constructor>
          <parameter class="org.jboss.cache.config.Configuration"><inject bean="Mobicents.JAINSLEE.CacheConfig"/></parameter> 
     	</constructor>		
	</bean>
   	
	<bean name="Mobicents.JAINSLEE.Cluster" class="org.mobicents.cluster.DefaultMobicentsCluster">
		<constructor>
			<parameter><inject bean="Mobicents.JAINSLEE.Cache"/></parameter>
			<parameter><inject bean="RealTransactionManager"/></parameter>
			<parameter><null/></parameter>
		</constructor>	
	</bean>
	
	<bean name="Mobicents.JAINSLEE.TransactionManagerMBean"
		class="org.mobicents.slee.runtime.transaction.SleeTransactionManagerImpl"
		autowire-candidate="false">
		<constructor>
			<parameter>
				<inject bean="RealTransactionManager" />
			</parameter>
		</constructor>
	</bean>

	<bean name="Mobicents.JAINSLEE.TraceMBean"
		class="org.mobicents.slee.container.management.jmx.TraceMBeanImpl">
		<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="javax.slee.management:name=Trace",exposedInterface=javax.slee.management.TraceMBean.class,registerDirectly=true)</annotation>
		<constructor>
			<parameter>
				<inject bean="Mobicents.JAINSLEE.TransactionManagerMBean" />
			</parameter>
		</constructor>
	</bean>

	<bean name="Mobicents.JAINSLEE.AlarmMBean"
		class="org.mobicents.slee.container.management.jmx.AlarmMBeanImpl">
		<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="javax.slee.management:name=Alarm",exposedInterface=javax.slee.management.AlarmMBean.class,registerDirectly=true)</annotation>
		<constructor>
			<parameter>
				<inject bean="Mobicents.JAINSLEE.TransactionManagerMBean" />
			</parameter>
			<parameter>
				<inject bean="Mobicents.JAINSLEE.TraceMBean" />
			</parameter>
		</constructor>
	</bean>

	<bean name="Mobicents.JAINSLEE.Profiles.JPA.HSQLDBConfig" class="org.mobicents.slee.container.deployment.profile.jpa.Configuration">
		<property name="persistProfiles">true</property>
		<property name="clusteredProfiles">false</property>
		<property name="hibernateDatasource">java:/DefaultDS</property>
		<property name="hibernateDialect">org.hibernate.dialect.HSQLDialect</property>
		<depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
	</bean>
	
	<bean name="Mobicents.JAINSLEE.Profiles.JPA.PostgreSQLConfig" class="org.mobicents.slee.container.deployment.profile.jpa.Configuration">
		<property name="persistProfiles">true</property>
		<property name="clusteredProfiles">false</property>
		<property name="hibernateDatasource">java:/PostgresDS</property>
		<property name="hibernateDialect">org.hibernate.dialect.PostgreSQLDialect</property>
	</bean>
	
	<bean name="Mobicents.JAINSLEE.MobicentsManagement"
		class="org.mobicents.slee.container.management.jmx.MobicentsManagement">
		<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="org.mobicents.slee:service=MobicentsManagement",exposedInterface=org.mobicents.slee.container.management.jmx.MobicentsManagementMBean.class,registerDirectly=true)</annotation>
		<!-- 0 means entities are not removed by force -->
		<property name="entitiesRemovalDelay">1</property>
	</bean>
		
	<bean name="Mobicents.JAINSLEE.ComponentsManagement"
		class="org.mobicents.slee.container.component.ComponentManagementImpl" />
		
	<bean name="Mobicents.JAINSLEE.SbbManagement"
		class="org.mobicents.slee.container.management.SbbManagementImpl" />
		
	<bean name="Mobicents.JAINSLEE.ServiceManagement"
		class="org.mobicents.slee.container.management.ServiceManagementImpl" />
	
	<bean name="Mobicents.JAINSLEE.ResourceManagement"
		class="org.mobicents.slee.container.management.ResourceManagementImpl">
		<constructor factoryMethod="getInstance"/>		
	</bean>	
		
	<bean name="Mobicents.JAINSLEE.ProfileManagement"
		class="org.mobicents.slee.container.management.ProfileManagementImpl">
		<constructor>
			<parameter>
				<inject bean="Mobicents.JAINSLEE.Profiles.JPA.HSQLDBConfig" />
				<!-- <inject bean="Mobicents.JAINSLEE.Profiles.JPA.PostgreSQLConfig" /> -->
			</parameter>
		</constructor>
	</bean>	
	
	<bean name="Mobicents.JAINSLEE.EventRouterConfiguration"
		class="org.mobicents.slee.container.management.jmx.EventRouterConfiguration">
		<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="org.mobicents.slee:name=EventRouterConfiguration",exposedInterface=org.mobicents.slee.container.management.jmx.EventRouterConfigurationMBean.class,registerDirectly=true)</annotation>
		<property name="eventRouterThreads">8</property>
		<property name="collectStats">true</property>
		<property name="confirmSbbEntityAttachement">true</property>		
		<property name="executorMapperClassName">org.mobicents.slee.runtime.eventrouter.mapping.ActivityHashingEventRouterExecutorMapper</property>
	</bean>
		
	<bean name="Mobicents.JAINSLEE.EventRouter"
		class="org.mobicents.slee.runtime.eventrouter.EventRouterImpl">
		<constructor>
			<parameter>
				<inject bean="Mobicents.JAINSLEE.EventRouterConfiguration" />
			</parameter>
		</constructor>	
	</bean>			
	
	<bean name="Mobicents.JAINSLEE.EventRouterStatistics"
		class="org.mobicents.slee.container.management.jmx.EventRouterStatistics">
		<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="org.mobicents.slee:name=EventRouterStatistics",exposedInterface=org.mobicents.slee.container.management.jmx.EventRouterStatisticsMBean.class,registerDirectly=true)</annotation>
		<constructor>
			<parameter>
				<inject bean="Mobicents.JAINSLEE.EventRouter" />
			</parameter>
		</constructor>	
	</bean>		
		
	<bean name="Mobicents.JAINSLEE.TimerFacilityConfiguration"
		class="org.mobicents.slee.container.management.jmx.TimerFacilityConfiguration">
		<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="org.mobicents.slee:name=TimerFacilityConfiguration",exposedInterface=org.mobicents.slee.container.management.jmx.TimerFacilityConfigurationMBean.class,registerDirectly=true)</annotation>
		<property name="timerThreads">4</property>
		<property name="purgePeriod">0</property>
	</bean>
	
	<bean name="Mobicents.JAINSLEE.TimerFacility"
		class="org.mobicents.slee.runtime.facilities.TimerFacilityImpl">
		<constructor>
			<parameter>
				<inject bean="Mobicents.JAINSLEE.TimerFacilityConfiguration" />
			</parameter>
		</constructor>	
	</bean>	
	
	<bean name="Mobicents.JAINSLEE.ActivityManagementConfiguration"
		class="org.mobicents.slee.runtime.activity.ActivityManagementConfiguration">
		<!-- values in min -->
		<property name="timeBetweenLivenessQueries">60</property>
		<property name="maxTimeIdle">60</property>
		<property name="minTimeBetweenUpdates">15</property>
	</bean>		
	
	<bean name="Mobicents.JAINSLEE.ActivityContextFactory"
		class="org.mobicents.slee.runtime.activity.ActivityContextFactoryImpl">
		<constructor>
			<parameter>
				<inject bean="Mobicents.JAINSLEE.ActivityManagementConfiguration" />
			</parameter>
		</constructor>
	</bean>			
	
	<bean name="Mobicents.JAINSLEE.NullActivityContextInterfaceFactory"
		class="org.mobicents.slee.runtime.facilities.nullactivity.NullActivityContextInterfaceFactoryImpl" />
		
	<bean name="Mobicents.JAINSLEE.NullActivityFactory"
		class="org.mobicents.slee.runtime.facilities.nullactivity.NullActivityFactoryImpl" />
		
	<bean name="Mobicents.JAINSLEE.ActivityContextNamingFacility"
		class="org.mobicents.slee.runtime.facilities.ActivityContextNamingFacilityImpl" />
		
	<bean name="Mobicents.JAINSLEE.SleeConnectionService"
		class="org.mobicents.slee.connector.local.SleeConnectionServiceImpl">
	</bean>	
	
	<bean name="Mobicents.JAINSLEE.SleeConnectionFactory"
		class="org.mobicents.slee.connector.local.MobicentsSleeConnectionFactoryImpl">
		<!-- 
			<property name="jndiName">/MobicentsConnectionFactory</property>
		 -->
	</bean>	
	
 	<bean name="Mobicents.JAINSLEE.RmiServerInterface"
		class="org.mobicents.slee.container.rmi.RmiServerInterfaceImpl">		
		<property name="jndiName">/slee-rmi-connector</property>
	</bean>	
	
	<bean name="Mobicents.JAINSLEE.UsageParametersManagement"
		class="org.mobicents.slee.container.management.UsageParametersManagementImpl" />
		
	<bean name="Mobicents.JAINSLEE.SbbEntityFactory"
		class="org.mobicents.slee.runtime.sbbentity.SbbEntityFactoryImpl" />
	
	<bean name="Mobicents.JAINSLEE.EventContextFactoryDataSource"
		class="org.mobicents.slee.container.event.DefaultEventContextFactoryDataSource" />
		
	<bean name="Mobicents.JAINSLEE.EventContextFactoryConfiguration"
		class="org.mobicents.slee.container.management.jmx.EventContextFactoryConfiguration">
		<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="org.mobicents.slee:name=EventContextFactoryConfiguration",exposedInterface=org.mobicents.slee.container.management.jmx.EventContextFactoryConfigurationMBean.class,registerDirectly=true)</annotation>
		<property name="defaultEventContextSuspensionTimeout">10000</property>
	</bean>
		
	<bean name="Mobicents.JAINSLEE.EventContextFactory"
		class="org.mobicents.slee.container.event.EventContextFactoryImpl">
		<constructor>
			<parameter>
				<inject bean="Mobicents.JAINSLEE.EventContextFactoryDataSource" />				
			</parameter>
			<parameter>
				<inject bean="Mobicents.JAINSLEE.EventContextFactoryConfiguration" />
			</parameter>
		</constructor>
	</bean>	
	
	<bean name="Mobicents.JAINSLEE.CongestionControlConfiguration"
		class="org.mobicents.slee.container.management.jmx.CongestionControlConfiguration">
		<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="org.mobicents.slee:name=CongestionControlConfiguration",exposedInterface=org.mobicents.slee.container.management.jmx.CongestionControlConfigurationMBean.class,registerDirectly=true)</annotation>
		<property name="periodBetweenChecks">0</property> <!-- 0 means congestion control off -->
		<property name="minFreeMemoryToTurnOn">10</property>
		<property name="minFreeMemoryToTurnOff">20</property>
		<property name="refuseStartActivity">true</property>
		<property name="refuseFireEvent">false</property>
	</bean>
	
	<bean name="Mobicents.JAINSLEE.CongestionControl"
		class="org.mobicents.slee.container.congestion.CongestionControlImpl">
		<constructor>
			<parameter>
				<inject bean="Mobicents.JAINSLEE.CongestionControlConfiguration" />
			</parameter>
		</constructor>	
	</bean>	
			
	<bean name="Mobicents.JAINSLEE.InternalDeployer"
		class="org.mobicents.slee.container.deployment.jboss.SleeContainerDeployerImpl">
		<property name="externalDeployer"><inject bean="Mobicents.JAINSLEE.ExternalDeployer" /></property>
	</bean>				
	
	<bean name="Mobicents.JAINSLEE.DeployerMBean"
		class="org.mobicents.slee.container.deployment.jboss.DeploymentManagerMBeanImpl">
		<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="org.mobicents.slee:name=DeployerMBean",exposedInterface=org.mobicents.slee.container.deployment.jboss.DeploymentManagerMBean.class,registerDirectly=true)</annotation>
		<constructor>
			<parameter>
				<inject bean="Mobicents.JAINSLEE.InternalDeployer" />				
			</parameter>
		</constructor>
	</bean>
	
	<bean name="Mobicents.JAINSLEE.DeploymentMBean"
		class="org.mobicents.slee.container.management.jmx.DeploymentMBeanImpl">
		<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="javax.slee.management:name=Deployment",exposedInterface=org.mobicents.slee.container.management.jmx.DeploymentMBeanImplMBean.class,registerDirectly=true)</annotation>
		<constructor>
			<parameter>
				<inject bean="Mobicents.JAINSLEE.InternalDeployer" />				
			</parameter>
		</constructor>
	</bean>
						
	<bean name="Mobicents.JAINSLEE.Container" class="org.mobicents.slee.container.SleeContainer">
		<constructor>
			<parameter><inject bean="JMXKernel" property="mbeanServer"/></parameter>
			<parameter><inject bean="Mobicents.JAINSLEE.ComponentsManagement" /></parameter>
			<parameter><inject bean="Mobicents.JAINSLEE.SbbManagement" /></parameter>
			<parameter><inject bean="Mobicents.JAINSLEE.ServiceManagement" /></parameter>
			<parameter><inject bean="Mobicents.JAINSLEE.ResourceManagement" /></parameter>
			<parameter><inject bean="Mobicents.JAINSLEE.ProfileManagement" /></parameter>
			<parameter><inject bean="Mobicents.JAINSLEE.EventContextFactory" /></parameter>
			<parameter><inject bean="Mobicents.JAINSLEE.EventRouter" /></parameter>
			<parameter><inject bean="Mobicents.JAINSLEE.TimerFacility" /></parameter>
			<parameter><inject bean="Mobicents.JAINSLEE.ActivityContextFactory" /></parameter>
			<parameter><inject bean="Mobicents.JAINSLEE.ActivityContextNamingFacility" /></parameter>
			<parameter><inject bean="Mobicents.JAINSLEE.NullActivityContextInterfaceFactory" /></parameter>
			<parameter><inject bean="Mobicents.JAINSLEE.NullActivityFactory" /></parameter>
			<parameter><inject bean="Mobicents.JAINSLEE.RmiServerInterface" /></parameter>
			<parameter><inject bean="Mobicents.JAINSLEE.TransactionManagerMBean" /></parameter>
			<parameter><inject bean="Mobicents.JAINSLEE.Cluster" /></parameter>
			<parameter><inject bean="Mobicents.JAINSLEE.AlarmMBean" /></parameter>
			<parameter><inject bean="Mobicents.JAINSLEE.TraceMBean" /></parameter>
			<parameter><inject bean="Mobicents.JAINSLEE.UsageParametersManagement" /></parameter>
			<parameter><inject bean="Mobicents.JAINSLEE.SbbEntityFactory" /></parameter>
			<parameter><inject bean="Mobicents.JAINSLEE.CongestionControl" /></parameter>
			<parameter><inject bean="Mobicents.JAINSLEE.SleeConnectionService" /></parameter>
			<parameter><inject bean="Mobicents.JAINSLEE.SleeConnectionFactory" /></parameter>
			<parameter><inject bean="Mobicents.JAINSLEE.InternalDeployer" /></parameter>			
		</constructor>
		<demand>Mobicents.JAINSLEE.MobicentsManagement</demand>
	</bean>

	<bean name="Mobicents.JAINSLEE.ServiceManagementMBean"
		class="org.mobicents.slee.container.management.jmx.ServiceManagementMBeanImpl">
		<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="javax.slee.management:name=ServiceManagement",exposedInterface=org.mobicents.slee.container.management.jmx.ServiceManagementMBeanImplMBean.class,registerDirectly=true)</annotation>
		<constructor>
			<parameter>
				<inject bean="Mobicents.JAINSLEE.Container" />
			</parameter>
		</constructor>
	</bean>

	<bean name="Mobicents.JAINSLEE.ProfileProvisoningMBean"
		class="org.mobicents.slee.container.management.jmx.ProfileProvisioningMBeanImpl">
		<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="javax.slee.management:name=ProfileProvisioning",exposedInterface=javax.slee.management.ProfileProvisioningMBean.class,registerDirectly=true)</annotation>
		<constructor>
			<parameter>
				<inject bean="Mobicents.JAINSLEE.Container" />
			</parameter>
		</constructor>
	</bean>

	<bean name="Mobicents.JAINSLEE.ResourceManagementMBean"
		class="org.mobicents.slee.container.management.jmx.ResourceManagementMBeanImpl">
		<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="javax.slee.management:name=ResourceManagement",exposedInterface=org.mobicents.slee.container.management.jmx.ResourceManagementMBeanImplMBean.class,registerDirectly=true)</annotation>
		<constructor>
			<parameter>
				<inject bean="Mobicents.JAINSLEE.Container" />
			</parameter>
		</constructor>
	</bean>

	<bean name="Mobicents.JAINSLEE.SbbEntitiesMBean"
		class="org.mobicents.slee.container.management.jmx.SbbEntitiesMBeanImpl">
		<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="org.mobicents.slee:name=SbbEntitiesMBean",exposedInterface=org.mobicents.slee.container.management.jmx.SbbEntitiesMBeanImplMBean.class,registerDirectly=true)</annotation>
		<constructor>
			<parameter>
				<inject bean="Mobicents.JAINSLEE.Container" />
			</parameter>
		</constructor>
	</bean>

	<bean name="Mobicents.JAINSLEE.ActivityManagementMBean"
		class="org.mobicents.slee.container.management.jmx.ActivityManagementMBeanImpl">
		<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="org.mobicents.slee:name=ActivityManagementMBean",exposedInterface=org.mobicents.slee.container.management.jmx.ActivityManagementMBeanImplMBean.class,registerDirectly=true)</annotation>
		<constructor>
			<parameter>
				<inject bean="Mobicents.JAINSLEE.Container" />
			</parameter>
		</constructor>
	</bean>

	<bean name="Mobicents.JAINSLEE.SleeManagement"
		class="org.mobicents.slee.container.management.jmx.SleeManagementMBeanImpl">
		<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="javax.slee.management:name=SleeManagement",exposedInterface=org.mobicents.slee.container.management.jmx.SleeManagementMBeanImplMBean.class,registerDirectly=true)</annotation>
		<constructor>
			<parameter>
				<inject bean="Mobicents.JAINSLEE.Container" />
			</parameter>
		</constructor>
		<property name="deploymentMBean">
			<value-factory bean="Mobicents.JAINSLEE.DeploymentMBean"
				method="getObjectName" />
		</property>
		<property name="serviceManagementMBean">
			<value-factory bean="Mobicents.JAINSLEE.ServiceManagementMBean"
				method="getObjectName" />
		</property>
		<property name="profileProvisioningMBean">
			<value-factory bean="Mobicents.JAINSLEE.ProfileProvisoningMBean"
				method="getObjectName" />
		</property>
		<property name="resourceManagementMBean">
			<value-factory bean="Mobicents.JAINSLEE.ResourceManagementMBean"
				method="getObjectName" />
		</property>
		<property name="sbbEntitiesMBean">
			<value-factory bean="Mobicents.JAINSLEE.SbbEntitiesMBean"
				method="getObjectName" />
		</property>
		<property name="activityManagementMBean">
			<value-factory bean="Mobicents.JAINSLEE.ActivityManagementMBean"
				method="getObjectName" />
		</property>
		<start method="startSlee"/>
    	<stop method="stopSlee"/>
	</bean>	
	
	<bean name="Mobicents.JAINSLEE.LogManagementMBean"
		class="org.mobicents.slee.container.management.jmx.log.MobicentsLogManagerMBeanImpl">
		<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="org.mobicents.slee:name=LogManagementMBean",exposedInterface=org.mobicents.slee.container.management.jmx.log.MobicentsLogManagerMBeanImplMBean.class,registerDirectly=true)</annotation>
		<demand>Mobicents.JAINSLEE.SleeManagement</demand>
	</bean>

	<bean name="Mobicents.JAINSLEE.PolicyManagementMBean"
		class="org.mobicents.slee.container.component.management.jmx.PolicyMBeanImpl">
		<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="org.mobicents.slee:name=PolicyManagementMBean",exposedInterface=org.mobicents.slee.container.component.management.jmx.PolicyMBeanImplMBean.class,registerDirectly=true)</annotation>
		<demand>Mobicents.JAINSLEE.SleeManagement</demand>
		<property name="useMPolicy">true</property>
	</bean>

</deployment>