Uploaded image for project: 'MINA'
  1. MINA
  2. DIRMINA-572

Add Spring support for Mina statemachine

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: 2.0.8
    • Component/s: Statemachine
    • Labels:
      None
    • Environment:
      All environment

      Description

      Currently, the configuring the Mina statemachine using Spring is not a trivial process. The API should be improved to provide convience classes and methods to allow for easier Spring 2.x configuration.

      1. IoFilterStateMachineProxyFactoryBean.java
        2 kB
        simon trudeau
      2. PasswordProtectionStateContextFactory.java
        0.4 kB
        simon trudeau
      3. StateMachineFactoryBean.java
        1 kB
        simon trudeau

        Activity

        Hide
        elecharny Emmanuel Lecharny added a comment -

        Unless someone spend some time maintaining the StateMachine module, and reopen this issue, I won't see how we can get it fixed.

        Closed atm.

        Show
        elecharny Emmanuel Lecharny added a comment - Unless someone spend some time maintaining the StateMachine module, and reopen this issue, I won't see how we can get it fixed. Closed atm.
        Hide
        elecharny Emmanuel Lecharny added a comment -

        Postponed

        Show
        elecharny Emmanuel Lecharny added a comment - Postponed
        Hide
        simontrudeau simon trudeau added a comment - - edited

        Currently, to configure the mina statemachine using spring one of the ways of doing this is to declare the following in your applicationContext.xml file. This is an example. Please note that the referenced factorybeans classes are included as attachment.

        <bean id="passwordProtectionStateMachine" class="filter.passwordprotection.StateMachineFactoryBean">
        		<property name="startState">
        			<util:constant static-field="filter.passwordprotection.PasswordProtection.PASSWORD_AUTHENTICATION" />
        		</property>
        		<property name="stateMachineImpl">
        			<bean class="filter.passwordprotection.PasswordProtection" />
        		</property>
        		<property name="transitionAnnotation" value="org.apache.mina.statemachine.annotation.IoFilterTransition" />
        	</bean>
        	
        	<bean id="passwordProtectionIoFilterStateMachine" class="filter.passwordprotection.IoFilterStateMachineProxyFactoryBean">
        		<property name="ignoreStateContextLookupFailure" value="true" />
        		<property name="ignoreUnhandledEvents" value="true" />
        		<property name="stateContextLookup" ref="ioSessionStateContextLookup" />
        		<property name="stateMachine" ref="passwordProtectionStateMachine" />
        	</bean>
        	
        	<bean id="ioSessionStateContextLookup"
        		class="org.apache.mina.statemachine.context.IoSessionStateContextLookup">
        		<constructor-arg index="0">
        			<bean class="filter.passwordprotection.PasswordProtectionStateContextFactory" />
        		</constructor-arg>
        		<constructor-arg index="1" value="passwordProtectionContext" />
        	</bean>
        
        Show
        simontrudeau simon trudeau added a comment - - edited Currently, to configure the mina statemachine using spring one of the ways of doing this is to declare the following in your applicationContext.xml file. This is an example . Please note that the referenced factorybeans classes are included as attachment. <bean id= "passwordProtectionStateMachine" class= "filter.passwordprotection.StateMachineFactoryBean" > <property name= "startState" > <util:constant static -field= "filter.passwordprotection.PasswordProtection.PASSWORD_AUTHENTICATION" /> </property> <property name= "stateMachineImpl" > <bean class= "filter.passwordprotection.PasswordProtection" /> </property> <property name= "transitionAnnotation" value= "org.apache.mina.statemachine.annotation.IoFilterTransition" /> </bean> <bean id= "passwordProtectionIoFilterStateMachine" class= "filter.passwordprotection.IoFilterStateMachineProxyFactoryBean" > <property name= "ignoreStateContextLookupFailure" value= " true " /> <property name= "ignoreUnhandledEvents" value= " true " /> <property name= "stateContextLookup" ref= "ioSessionStateContextLookup" /> <property name= "stateMachine" ref= "passwordProtectionStateMachine" /> </bean> <bean id= "ioSessionStateContextLookup" class= "org.apache.mina.statemachine.context.IoSessionStateContextLookup" > <constructor-arg index= "0" > <bean class= "filter.passwordprotection.PasswordProtectionStateContextFactory" /> </constructor-arg> <constructor-arg index= "1" value= "passwordProtectionContext" /> </bean>

          People

          • Assignee:
            Unassigned
            Reporter:
            simontrudeau simon trudeau
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development