use of org.granite.messaging.webapp.HttpGraniteContext in project collect by openforis.
the class SaikuService method getSaikuUrl.
public String getSaikuUrl() {
HttpGraniteContext graniteContext = (HttpGraniteContext) GraniteContext.getCurrentInstance();
HttpServletRequest request = graniteContext.getRequest();
String protocol = request.isSecure() ? "https" : "http";
String localAddr = request.getLocalAddr();
if (DEV_REQUEST_LOCAL_ADDRESS.equals(localAddr)) {
localAddr = DEV_LOCAL_ADDRESS;
}
String url = String.format(SAIKU_URL_FORMAT, protocol, localAddr, request.getLocalPort(), saikuConfiguration.getContextPath());
return url;
}
use of org.granite.messaging.webapp.HttpGraniteContext in project collect by openforis.
the class SessionManager method invalidateSession.
public void invalidateSession() {
try {
releaseRecord();
} catch (RecordUnlockedException e) {
// do nothing
}
GraniteContext graniteContext = GraniteContext.getCurrentInstance();
if (graniteContext != null && graniteContext instanceof HttpGraniteContext) {
HttpGraniteContext httpGraniteContext = (HttpGraniteContext) graniteContext;
HttpServletRequest request = httpGraniteContext.getRequest();
HttpSession session = request.getSession();
session.invalidate();
}
}
use of org.granite.messaging.webapp.HttpGraniteContext in project collect by openforis.
the class AttributeChangeProxy method getContextBean.
protected <T extends Object> T getContextBean(Class<T> type) {
HttpGraniteContext graniteContext = (HttpGraniteContext) GraniteContext.getCurrentInstance();
ServletContext servletContext = graniteContext.getServletContext();
WebApplicationContext applicationContext = WebApplicationContextUtils.getWebApplicationContext(servletContext);
T bean = applicationContext.getBean(type);
return bean;
}
Aggregations