_component.getClients().add(Protocol.WAR); final Context applicationContext = _component.getContext().createChildContext();
@Override protected org.restlet.Application createApplication( Context parentContext ) { return objectFactory.newObject( PolygeneRestApplication.class, parentContext.createChildContext() ); } }
@Override public void setContext(Context parentContext) { this.parentContext = parentContext; super.setContext((parentContext == null) ? null : parentContext .createChildContext()); }
/** * Constructor. * * @param component * The parent component. */ public ClientRouter(Component component) { super((component == null) ? null : component.getContext() .createChildContext()); this.component = component; }
/** * Constructor. * * @param parentContext * The parent context. */ public ServletWarClient(Context parentContext, javax.servlet.ServletContext servletContext) { super(parentContext.createChildContext(), (List<Protocol>) null); getProtocols().add(Protocol.WAR); this.helper = new ServletWarClientHelper(this, servletContext); }
/** * Constructor. * * @param parentContext * The parent context. */ public ServletWarClient(Context parentContext, javax.servlet.ServletContext servletContext) { super(parentContext.createChildContext(), (List<Protocol>) null); getProtocols().add(Protocol.WAR); this.helper = new ServletWarClientHelper(this, servletContext); }
/** * Checks the context and sets it if necessary. * * @param target * The target Restlet. */ protected void checkContext(Restlet target) { if ((target.getContext() == null) && (this.parentContext != null)) { target.setContext(this.parentContext.createChildContext()); } }
/** * Constructor. * * @param component * The parent component. */ public ServerRouter(Component component) { super((component == null) ? null : component.getContext() .createChildContext()); this.component = component; setRoutingMode(MODE_FIRST_MATCH); }
@Override protected Finder createFinder( Class<? extends Resource> targetClass) { Finder result = super.createFinder(targetClass); result.setContext(getContext().createChildContext()); return result; }
@Override public Finder createFinder(Class<? extends ServerResource> targetClass) { Finder result = super.createFinder(targetClass); result.setContext(getContext().createChildContext()); return result; }
@Override public Route attach(Restlet target) { if (target.getContext() == null) { target .setContext(getContext() .createChildContext()); } return super.attach(target); }
@Override public Route attachDefault(Restlet defaultTarget) { if (defaultTarget.getContext() == null) { defaultTarget.setContext(getContext() .createChildContext()); } return super.attachDefault(defaultTarget); }
@Override public boolean add(Client client) { // Set the client's context, if the client does not have already one. if (client.getContext() == null) { client.setContext(getContext().createChildContext()); } return super.add(client); }
@Override public TemplateRoute attach(String uriPattern, Restlet target) { if (target.getContext() == null) { target.setContext(getContext().createChildContext()); } return super.attach(uriPattern, target); }
@Override public boolean add(Client client) { // Set the client's context, if the client does not have already one. if (client.getContext() == null) { client.setContext(getContext().createChildContext()); } return super.add(client); }
/** * Adds a new client connector in the map supporting the given protocol. * * @param protocol * The connector protocol. * @return The added client. */ public Client add(Protocol protocol) { final Client result = new Client(protocol); result.setContext(getContext().createChildContext()); add(result); return result; }
@Override public Route attach(String uriPattern, Restlet target) { if (target.getContext() == null) { target .setContext(getContext() .createChildContext()); } return super.attach(uriPattern, target); }
@Override public TemplateRoute attach(Restlet target) { if (target.getContext() == null) { target.setContext(getContext().createChildContext()); } return super.attach(target); }
@Override public TemplateRoute attachDefault(Restlet defaultTarget) { if (defaultTarget.getContext() == null) { defaultTarget.setContext(getContext().createChildContext()); } return super.attachDefault(defaultTarget); }
@Override protected Application createApplication( Context context ) { ObjectBuilder<Application> app = obf.newObjectBuilder( Application.class ); app.use( context.createChildContext(), getServletConfig(), getServletContext() ); return app.newInstance(); }