@Override public void setContext(Context context) { wrappedRestlet.setContext(context); }
@Override public void setContext(Context context) { wrappedRestlet.setContext(context); }
@Override public void setContext(Context context) { super.setContext(context); getServices().setContext(context); }
/** * Sets the outbound root Restlet. * * @param outboundRoot * The outbound root Restlet. */ public synchronized void setOutboundRoot(Restlet outboundRoot) { this.outboundRoot = outboundRoot; if ((outboundRoot != null) && (outboundRoot.getContext() == null)) { outboundRoot.setContext(getContext()); } }
/** * Sets the inbound root Restlet. * * @param inboundRoot * The inbound root Restlet. */ public synchronized void setInboundRoot(Restlet inboundRoot) { this.inboundRoot = inboundRoot; if ((inboundRoot != null) && (inboundRoot.getContext() == null)) { inboundRoot.setContext(getContext()); } }
/** * 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()); } }
/** * Sets the next Restlet. * * In addition, this method will set the context of the next Restlet if it * is null by passing a reference to its own context. * * @param next * The next Restlet. */ public void setNext(Restlet next) { if ((next != null) && (next.getContext() == null)) { next.setContext(getContext()); } this.next = next; }
/** * Sets the next Restlet. * * In addition, this method will set the context of the next Restlet if it * is null by passing a reference to its own context. * * @param next * The next Restlet. */ public void setNext(Restlet next) { if ((next != null) && (next.getContext() == null)) { next.setContext(getContext()); } this.next = next; }
@Override public void init() throws ServletException { super.init(); this.adapter = new ServletAdapter(getServletContext()); this.restlet.setContext(this.adapter.getContext()); this.adapter.setNext(this.restlet); }
/** * Sets the next handler such as a Restlet or a Filter. * * In addition, this method will set the context of the next Restlet if it * is null by passing a reference to its own context. * * @param next * The next handler. */ public void setNext(org.restlet.Uniform next) { if (next instanceof Restlet) { Restlet nextRestlet = (Restlet) next; if (nextRestlet.getContext() == null) { nextRestlet.setContext(getContext()); } } this.next = next; // If true, it must be updated after calling this method this.nextCreated = false; }
@Override public void setContext(Context context) { super.setContext(context); getHelper().setContext(context); getServices().setContext(context); }
/** * Attaches a Restlet to this router as the default target to invoke when no * route matches. It actually sets a default route that scores all calls to * 1.0. * * In addition to super class behavior, this method will set the context of * the target if it is empty by creating a protected context via the * {@link Context#createChildContext()} method. * * @param defaultTarget * The Restlet to use as the default target. * @return The created route. */ @Override public Route attachDefault(Restlet defaultTarget) { if ((defaultTarget.getContext() == null) && (this.parentContext != null)) { defaultTarget.setContext(this.parentContext.createChildContext()); } return super.attachDefault(defaultTarget); }
/** * Attaches a target Restlet to this router with an empty URI pattern. A new * route will be added routing to the target when any call is received. * * In addition to super class behavior, this method will set the context of * the target if it is empty by creating a protected context via the * {@link Context#createChildContext()} method. * * @param target * The target Restlet to attach. * @return The created route. */ @Override public Route attach(Restlet target) { if ((target.getContext() == null) && (this.parentContext != null)) { target.setContext(this.parentContext.createChildContext()); } return super.attach(target); }
@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 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 TemplateRoute attach(String uriPattern, Restlet target) { if (target.getContext() == null) { target.setContext(getContext().createChildContext()); } return super.attach(uriPattern, target); }
/** * Attaches a target Restlet to this router based on a given URI pattern. A * new route will be added routing to the target when calls with a URI * matching the pattern will be received. * * In addition to super class behavior, this method will set the context of * the target if it is empty by creating a protected context via the * {@link Context#createChildContext()} method. * * @param uriPattern * The URI pattern that must match the relative part of the * resource URI. * @param target * The target Restlet to attach. * @return The created route. */ @Override public Route attach(String uriPattern, Restlet target) { if ((target.getContext() == null) && (this.parentContext != null)) { target.setContext(this.parentContext.createChildContext()); } return super.attach(uriPattern, target); }