当前位置: 首页>>代码示例>>Java>>正文


Java StateMachine类代码示例

本文整理汇总了Java中org.apache.mina.statemachine.StateMachine的典型用法代码示例。如果您正苦于以下问题:Java StateMachine类的具体用法?Java StateMachine怎么用?Java StateMachine使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


StateMachine类属于org.apache.mina.statemachine包,在下文中一共展示了StateMachine类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getIsdnClientStateMachineHandler

import org.apache.mina.statemachine.StateMachine; //导入依赖的package包/类
public static ChannelHandler getIsdnClientStateMachineHandler(IsdnChannel channel, String handlerName) {

        StateMachine sm = StateMachineFactory.getInstance(Transition.class).create(IsdnConnectionHandler.PLCI_IDLE,
                new IsdnConnectionHandler());

        StateContextLookup stateContextLookup = new ChannelHandlerContextLookup(new DefaultStateContextFactory(),
                channel, handlerName);

        StateMachineProxyBuilder proxyBuilder = new StateMachineProxyBuilder();
        proxyBuilder.setName("IsdnClientChannelStateMachine");
        proxyBuilder.setStateContextLookup(stateContextLookup);
        // proxyBuilder.setEventArgumentsInterceptor(new
        // NettyEventInterceptor());
        proxyBuilder.setEventFactory(new NettyEventFactory());

        IStateMachineChannelHandler engine = proxyBuilder.create(IStateMachineChannelHandler.class, sm);
        return new ChannelAllCoverageWrapper(new DefaultStateMachineChannelHandler(engine));

    }
 
开发者ID:rmarins,项目名称:netty-isdn-transport,代码行数:20,代码来源:IsdnHandlerFactory.java

示例2: getAcceptedChannelStateMachineHandler

import org.apache.mina.statemachine.StateMachine; //导入依赖的package包/类
public static ChannelHandler getAcceptedChannelStateMachineHandler(IsdnChannel channel, String handlerName) {

        StateMachine sm = StateMachineFactory.getInstance(Transition.class).create(
                IsdnConnectionHandler.P4_WF_CONNECT_ACTIVE_IND, new IsdnConnectionHandler());

        StateContextLookup stateContextLookup = new ChannelHandlerContextLookup(new DefaultStateContextFactory(),
                channel, handlerName);

        StateMachineProxyBuilder proxyBuilder = new StateMachineProxyBuilder();
        proxyBuilder.setName("IsdnAcceptedChannelStateMachine");
        proxyBuilder.setStateContextLookup(stateContextLookup);
        // proxyBuilder.setEventArgumentsInterceptor(new
        // NettyEventInterceptor());
        proxyBuilder.setEventFactory(new NettyEventFactory());

        IStateMachineChannelHandler engine = proxyBuilder.create(IStateMachineChannelHandler.class, sm);
        return new ChannelAllCoverageWrapper(new DefaultStateMachineChannelHandler(engine));

    }
 
开发者ID:rmarins,项目名称:netty-isdn-transport,代码行数:20,代码来源:IsdnHandlerFactory.java

示例3: createIoHandler

import org.apache.mina.statemachine.StateMachine; //导入依赖的package包/类
private static IoHandler createIoHandler() {
	StateMachine sm = StateMachineFactory.getInstance(
			IoHandlerTransition.class).create(ServerHandler.NOT_CONNECTED,
			new ServerHandler());
	return new StateMachineProxyBuilder().setStateContextLookup(
			new IoSessionStateContextLookup(new StateContextFactory() {
				public StateContext create() {
					return new ServerHandler.TetrisServerContext();
				}
			})).create(IoHandler.class, sm);
}
 
开发者ID:jptiancai,项目名称:TetrisMina,代码行数:12,代码来源:TetrisServer.java

示例4: ConstructionProject

import org.apache.mina.statemachine.StateMachine; //导入依赖的package包/类
ConstructionProject(ConstructionType constructionType, MapAnalyzer mapAnalyzer, InteractionHandler interactionHandler, UnitInventory myInventory, Queue<Project> projects, TilePosition constructionSite, SCV builder) {
	
	this.constructionSMImpl = new ConstructionStateMachineImpl(constructionType, mapAnalyzer, interactionHandler, myInventory, projects, constructionSite, builder);
	StateMachine stateMachine = StateMachineFactory.getInstance(Transition.class).create(ConstructionStateMachineImpl.QUEUED, this.constructionSMImpl);
	this.constructionSM = new StateMachineProxyBuilder().create(ConstructionStateMachine.class, stateMachine);
}
 
开发者ID:OpenBW,项目名称:TSBW4J,代码行数:7,代码来源:ConstructionProject.java


注:本文中的org.apache.mina.statemachine.StateMachine类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。