本文整理汇总了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);
}
示例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);
}
}
示例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);
}
示例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;
}
});
}
}