本文整理匯總了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();
}
示例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;
}
示例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();
}
示例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;
}