當前位置: 首頁>>代碼示例>>Java>>正文


Java Container.findChild方法代碼示例

本文整理匯總了Java中org.apache.catalina.Container.findChild方法的典型用法代碼示例。如果您正苦於以下問題:Java Container.findChild方法的具體用法?Java Container.findChild怎麽用?Java Container.findChild使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.catalina.Container的用法示例。


在下文中一共展示了Container.findChild方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: expire

import org.apache.catalina.Container; //導入方法依賴的package包/類
private void expire(SingleSignOnSessionKey key) {
    if (engine == null) {
        containerLog.warn(sm.getString("singleSignOn.sessionExpire.engineNull", key));
        return;
    }
    Container host = engine.findChild(key.getHostName());
    if (host == null) {
        containerLog.warn(sm.getString("singleSignOn.sessionExpire.hostNotFound", key));
        return;
    }
    Context context = (Context) host.findChild(key.getContextName());
    if (context == null) {
        containerLog.warn(sm.getString("singleSignOn.sessionExpire.contextNotFound", key));
        return;
    }
    Manager manager = context.getManager();
    if (manager == null) {
        containerLog.warn(sm.getString("singleSignOn.sessionExpire.managerNotFound", key));
        return;
    }
    Session session = null;
    try {
        session = manager.findSession(key.getSessionId());
    } catch (IOException e) {
        containerLog.warn(sm.getString("singleSignOn.sessionExpire.managerError", key), e);
        return;
    }
    if (session == null) {
        containerLog.warn(sm.getString("singleSignOn.sessionExpire.sessionNotFound", key));
        return;
    }
    session.expire();
}
 
開發者ID:liaokailin,項目名稱:tomcat7,代碼行數:34,代碼來源:SingleSignOn.java

示例2: messageReceived

import org.apache.catalina.Container; //導入方法依賴的package包/類
/**
 * Callback from the cluster, when a message is received, The cluster will
 * broadcast it invoking the messageReceived on the receiver.
 * 
 * @param msg
 *            ClusterMessage - the message received from the cluster
 */
@Override
public void messageReceived(ClusterMessage msg) {
	if (msg instanceof SessionIDMessage) {
		SessionIDMessage sessionmsg = (SessionIDMessage) msg;
		if (log.isDebugEnabled())
			log.debug(sm.getString("jvmRoute.receiveMessage.sessionIDChanged", sessionmsg.getOrignalSessionID(),
					sessionmsg.getBackupSessionID(), sessionmsg.getContextName()));
		Container container = getCluster().getContainer();
		Container host = null;
		if (container instanceof Engine) {
			host = container.findChild(sessionmsg.getHost());
		} else {
			host = container;
		}
		if (host != null) {
			Context context = (Context) host.findChild(sessionmsg.getContextName());
			if (context != null) {
				try {
					Session session = context.getManager().findSession(sessionmsg.getOrignalSessionID());
					if (session != null) {
						session.setId(sessionmsg.getBackupSessionID());
					} else if (log.isInfoEnabled())
						log.info(sm.getString("jvmRoute.lostSession", sessionmsg.getOrignalSessionID(),
								sessionmsg.getContextName()));
				} catch (IOException e) {
					log.error(e);
				}

			} else if (log.isErrorEnabled())
				log.error(sm.getString("jvmRoute.contextNotFound", sessionmsg.getContextName(),
						((StandardEngine) host.getParent()).getJvmRoute()));
		} else if (log.isErrorEnabled())
			log.error(sm.getString("jvmRoute.hostNotFound", sessionmsg.getContextName()));
	}
	return;
}
 
開發者ID:how2j,項目名稱:lazycat,代碼行數:44,代碼來源:JvmRouteSessionIDBinderListener.java

示例3: expire

import org.apache.catalina.Container; //導入方法依賴的package包/類
private void expire(SingleSignOnSessionKey key) {
	if (engine == null) {
		containerLog.warn(sm.getString("singleSignOn.sessionExpire.engineNull", key));
		return;
	}
	Container host = engine.findChild(key.getHostName());
	if (host == null) {
		containerLog.warn(sm.getString("singleSignOn.sessionExpire.hostNotFound", key));
		return;
	}
	Context context = (Context) host.findChild(key.getContextName());
	if (context == null) {
		containerLog.warn(sm.getString("singleSignOn.sessionExpire.contextNotFound", key));
		return;
	}
	Manager manager = context.getManager();
	if (manager == null) {
		containerLog.warn(sm.getString("singleSignOn.sessionExpire.managerNotFound", key));
		return;
	}
	Session session = null;
	try {
		session = manager.findSession(key.getSessionId());
	} catch (IOException e) {
		containerLog.warn(sm.getString("singleSignOn.sessionExpire.managerError", key), e);
		return;
	}
	if (session == null) {
		containerLog.warn(sm.getString("singleSignOn.sessionExpire.sessionNotFound", key));
		return;
	}
	session.expire();
}
 
開發者ID:how2j,項目名稱:lazycat,代碼行數:34,代碼來源:SingleSignOn.java

示例4: messageReceived

import org.apache.catalina.Container; //導入方法依賴的package包/類
/**
 * Callback from the cluster, when a message is received, The cluster will
 * broadcast it invoking the messageReceived on the receiver.
 * 
 * @param msg
 *            ClusterMessage - the message received from the cluster
 */
@Override
public void messageReceived(ClusterMessage msg) {
    if (msg instanceof SessionIDMessage) {
        SessionIDMessage sessionmsg = (SessionIDMessage) msg;
        if (log.isDebugEnabled())
            log.debug(sm.getString(
                    "jvmRoute.receiveMessage.sessionIDChanged", sessionmsg
                            .getOrignalSessionID(), sessionmsg
                            .getBackupSessionID(), sessionmsg
                            .getContextName()));
        Container container = getCluster().getContainer();
        Container host = null ;
        if(container instanceof Engine) {
            host = container.findChild(sessionmsg.getHost());
        } else {
            host = container ;
        }
        if (host != null) {
            Context context = (Context) host.findChild(sessionmsg
                    .getContextName());
            if (context != null) {
                try {
                    Session session = context.getManager().findSession(
                            sessionmsg.getOrignalSessionID());
                    if (session != null) {
                        session.setId(sessionmsg.getBackupSessionID());
                    } else if (log.isInfoEnabled())
                        log.info(sm.getString("jvmRoute.lostSession",
                                sessionmsg.getOrignalSessionID(),
                                sessionmsg.getContextName()));
                } catch (IOException e) {
                    log.error(e);
                }

            } else if (log.isErrorEnabled())
                log.error(sm.getString("jvmRoute.contextNotFound",
                        sessionmsg.getContextName(), ((StandardEngine) host
                                .getParent()).getJvmRoute()));
        } else if (log.isErrorEnabled())
            log.error(sm.getString("jvmRoute.hostNotFound", sessionmsg.getContextName()));
    }
    return;
}
 
開發者ID:liaokailin,項目名稱:tomcat7,代碼行數:51,代碼來源:JvmRouteSessionIDBinderListener.java


注:本文中的org.apache.catalina.Container.findChild方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。