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


Java MuxUpHandler类代码示例

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


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

示例1: SolverServerImplementation

import org.jgroups.blocks.mux.MuxUpHandler; //导入依赖的package包/类
public SolverServerImplementation(boolean local, JChannel channel) {
	super();
	
	iLocal = local;
	iChannel = channel;
	// iChannel.setReceiver(this);
	iChannel.setUpHandler(new MuxUpHandler());
	iDispatcher = new MuxRpcDispatcher(SCOPE_SERVER, channel, this, this, this);
	
	iCourseSolverContainer = new CourseSolverContainerRemote(channel, SCOPE_COURSE, local);
	iExamSolverContainer = new ExaminationSolverContainerRemote(channel, SCOPE_EXAM);
	iStudentSolverContainer = new StudentSolverContainerRemote(channel, SCOPE_STUDENT);
	iInstructorSchedulingContainer = new InstructorSchedulingContainerRemote(channel, SCOPE_INSTRUCTOR);
	iOnlineStudentSchedulingContainer = new OnlineStudentSchedulingContainerRemote(channel, SCOPE_ONLINE);
	iRemoteRoomAvailability = new RemoteRoomAvailability(channel, SCOPE_AVAILABILITY);
	iUpdater = new OnlineStudentSchedulingGenericUpdater(iDispatcher, iOnlineStudentSchedulingContainer);
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:18,代码来源:SolverServerImplementation.java

示例2: setUp

import org.jgroups.blocks.mux.MuxUpHandler; //导入依赖的package包/类
@BeforeClass
void setUp() throws Exception {
    channels[0] = createChannel(true);
    channels[1] = createChannel(channels[0]);
    
    for (int i = 0; i < dispatchers.length; i++) {
        dispatchers[i] = new MessageDispatcher(channels[i], null, null, new MuxRequestListener("dispatcher[" + i + "]"));
        channels[i].setUpHandler(new MuxUpHandler(dispatchers[i].getProtocolAdapter()));

        for (int j = 0; j < muxDispatchers[i].length; j++) {
            muxDispatchers[i][j] = new MuxMessageDispatcher((short) j, channels[i], null, null, new MuxRequestListener("muxDispatcher[" + i + "][" + j + "]"));
        }
        channels[i].connect("MuxMessageDispatcherTest");
        Util.sleep(1000);
    }
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:17,代码来源:MuxMessageDispatcherTest.java

示例3: setUp

import org.jgroups.blocks.mux.MuxUpHandler; //导入依赖的package包/类
@BeforeMethod
void setUp() throws Exception {
    channels       = new JChannel[2];
    dispatchers    = new RpcDispatcher[2];
    muxDispatchers = new RpcDispatcher[2][2];

    channels[0] = createChannel(true, 2, "A");
    channels[1] = createChannel(channels[0], "B");
    
    for (int i = 0; i < dispatchers.length; i++) {

        dispatchers[i] = new RpcDispatcher(channels[i], new Server("dispatcher[" + i + "]"));

        channels[i].setUpHandler(new MuxUpHandler(dispatchers[i].getProtocolAdapter()));

        for (int j = 0; j < muxDispatchers[i].length; j++) {
            muxDispatchers[i][j] = new MuxRpcDispatcher((short) j, channels[i], null, null, new Server("muxDispatcher[" + i + "][" + j + "]"));
        }
 
        channels[i].connect("MuxRpcDispatcherTest");

        Util.sleep(1000);
    }

    Util.waitUntilAllChannelsHaveSameSize(10000, 1000, channels);
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:27,代码来源:MuxRpcDispatcherTest.java

示例4: startServer

import org.jgroups.blocks.mux.MuxUpHandler; //导入依赖的package包/类
protected void startServer() {
	final Session session = Session.getSessionUsingInitiativeYearTerm(
               ApplicationProperties.getProperty("initiative", "woebegon"),
               ApplicationProperties.getProperty("year","2010"),
               ApplicationProperties.getProperty("term","Fal")
               );
       
       boolean remote = "true".equalsIgnoreCase(ApplicationProperties.getProperty("remote", "true"));

       if (session==null) {
           sLog.error("Academic session not found, use properties initiative, year, and term to set academic session.");
           System.exit(0);
       } else {
           sLog.info("Session: "+session);
       }
       
       iSessionId = session.getUniqueId();
       
       OnlineSectioningLogger.getInstance().setEnabled(false);

       if (remote) {
           try {
           	iChannel = new JChannel(JGroupsUtils.getConfigurator(ApplicationProperty.SolverClusterConfiguration.value()));
           	iChannel.setUpHandler(new MuxUpHandler());
       		
       		iSolverServer = new DummySolverServer(iChannel);
       		
       		iChannel.connect("UniTime:rpc");
       		iChannel.getState(null, 0);
       		
               if (getServer() == null)
               	throw new Exception(session.getLabel() + " is not available");
           } catch (Exception e) {
           	sLog.error("Failed to access the solver server: " + e.getMessage(), e);
           	if (iChannel != null && iChannel.isConnected()) iChannel.disconnect();
           	if (iChannel != null && iChannel.isOpen()) iChannel.close();
           	System.exit(0);
           }
       } else {
           iServer = new InMemoryServer(new OnlineSectioningServerContext() {
   			@Override
   			public boolean isWaitTillStarted() {
   				return true;
   			}
   			
   			@Override
   			public EmbeddedCacheManager getCacheManager() {
   				return null;
   			}
   			
   			@Override
   			public Long getAcademicSessionId() {
   				return session.getUniqueId();
   			}

   			@Override
   			public LockService getLockService() {
   				return null;
   			}
   		});
       }
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:63,代码来源:OnlineSectioningTestFwk.java


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