ContextInfo makeContextInfo(Context context) { // copy to another object -- not the important part final ContextInfo info = new ContextInfo(context.getPath()); info.setThisPart(context.getThisPart()); info.setNotImportant(context.getNotImportant()); return info; }
File store = sessionStore(context.getPath()); if (store == null) { getLogger().debug("No session store file found");
@BeforeMethod public void setUp() throws Exception { _service = mock( MemcachedSessionService.class ); _request = mock( Request.class ); _response = mock( Response.class ); final Context _contextContainer = mock(Context.class); final Host _hostContainer = mock(Host.class); final SessionManager _manager = mock(SessionManager.class); when(_service.getManager()).thenReturn(_manager); when(_manager.getContext()).thenReturn(_contextContainer); when(_contextContainer.getParent()).thenReturn(_hostContainer); when(_contextContainer.getPath()).thenReturn("/"); _sessionTrackerValve = createSessionTrackerValve(); _nextValve = mock( Valve.class ); _sessionTrackerValve.setNext( _nextValve ); _sessionTrackerValve.setContainer(_hostContainer); when(_request.getRequestURI()).thenReturn( "/someRequest"); when(_request.getMethod()).thenReturn("GET"); when(_request.getQueryString()).thenReturn(null); when(_request.getContext()).thenReturn(_contextContainer); when(_request.getNote(eq(RequestTrackingHostValve.REQUEST_PROCESSED))).thenReturn(Boolean.TRUE); when(_request.getNote(eq(RequestTrackingHostValve.SESSION_ID_CHANGED))).thenReturn(Boolean.FALSE); }
/** * {@inhericDoc} * @see org.jboss.modcluster.Context#getPath() */ public String getPath() { return this.context.getPath(); }
/** * {@inhericDoc} * @see java.lang.Object#toString() */ @Override public String toString() { return this.context.getPath(); }
public static String label(Context context) { String displayName = context.getDisplayName(); String contextPath = context.getPath(); if ("".equals(contextPath)) { contextPath = "/"; } if (displayName == null) { return contextPath; } return contextPath + " (" + displayName + ")"; }
@Override public SecurityConstraint[] findSecurityConstraints(final Request request, final Context context) { final Map<String, ServletSecurityElement> map = (Map<String, ServletSecurityElement>) invoke(findSecurityConstraintsMethod, request.getRequest(), context.getPath()); final List<SecurityConstraint> constraints = new ArrayList<SecurityConstraint>(); for (final Map.Entry<String, ServletSecurityElement> entry : map.entrySet()) { constraints.addAll(Arrays.asList(SecurityConstraint.createConstraints(entry.getValue(), entry.getKey()))); } return constraints.toArray(new SecurityConstraint[constraints.size()]); }
TomcatWarDeployment(TomcatContextUndeployer undeployer, Bundle bundle, Context catalinaContext) { this.undeployer = undeployer; this.catalinaContext = catalinaContext; // create context this.deploymentContext = new DefaultWarDeploymentContext(bundle, catalinaContext.getPath(), catalinaContext.getServletContext()); }
public void setAsyncSupported(boolean asyncSupported) { if (!context.isStarting()) { throw new IllegalStateException(sm.getString("filterRegistration.ise", context.getPath())); } filterDef.setAsyncSupported(asyncSupported); context.addFilterDef(filterDef); }
@Override public boolean hasResourcePermission(final Request request, final Response response, final SecurityConstraint[] constraint, final Context context) throws IOException { return (Boolean) invoke(hasResourcePermissionMethod, request.getRequest(), response.getResponse(), constraint, context.getPath()); }
public Set<String> setServletSecurity(ServletSecurityElement servletSecurity) { if (!((Context) wrapper.getParent()).isStarting()) { throw new IllegalStateException(sm.getString ("servletRegistration.ise", ((Context) wrapper.getParent()).getPath())); } if (servletSecurity == null) { throw new IllegalArgumentException(sm.getString("servletRegistration.iae")); } return wrapper.setServletSecurity(servletSecurity); }
public void setLoadOnStartup(int loadOnStartup) { if (!((Context) wrapper.getParent()).isStarting()) { throw new IllegalStateException(sm.getString ("servletRegistration.ise", ((Context) wrapper.getParent()).getPath())); } wrapper.setLoadOnStartup(loadOnStartup); }
public void setAsyncSupported(boolean asyncSupported) { if (!context.isStarting()) { throw MESSAGES.cannotAddFilterRegistrationAfterInit(context.getPath()); } filterDef.setAsyncSupported(asyncSupported); context.addFilterDef(filterDef); }
public String getFirstBase() { return (connector.getSecure() ? "https" : "http") + "://" + host.getName() + (connector.getPort() > 0 ? ":" + connector.getPort() : "") + context.getPath(); } }
public void setAsyncSupported(boolean asyncSupported) { if (!((Context) wrapper.getParent()).isStarting()) { throw MESSAGES.cannotAddServletRegistrationAfterInit(((Context) wrapper.getParent()).getPath()); } wrapper.setAsyncSupported(asyncSupported); }
public void setLoadOnStartup(int loadOnStartup) { if (!((Context) wrapper.getParent()).isStarting()) { throw MESSAGES.cannotAddServletRegistrationAfterInit(((Context) wrapper.getParent()).getPath()); } wrapper.setLoadOnStartup(loadOnStartup); }
public Set<String> setServletSecurity(ServletSecurityElement servletSecurity) { if (!((Context) wrapper.getParent()).isStarting()) { throw MESSAGES.cannotAddServletRegistrationAfterInit(((Context) wrapper.getParent()).getPath()); } if (servletSecurity == null) { throw MESSAGES.invalidServletRegistrationArguments(); } return wrapper.setServletSecurity(servletSecurity); }
public void setRunAsRole(String roleName) { if (!((Context) wrapper.getParent()).isStarting()) { throw MESSAGES.cannotAddServletRegistrationAfterInit(((Context) wrapper.getParent()).getPath()); } if (roleName == null) { throw MESSAGES.invalidServletRegistrationArguments(); } wrapper.setRunAs(roleName); }
@Override public synchronized void removeContext(Context context) { if( log.isDebugEnabled() ) log.debug("Removing context[" + context.getPath() + "]"); boolean isContextExists = isContextExists(context); if(!isContextExists) return; // Remove this Context from the associated Host if( log.isDebugEnabled() ) log.debug(" Removing this Context"); context.getParent().removeChild(context); }