/** * Sets the context. * * @param context * The context. */ public void setContext(Context context) { this.context = context; fireContextChanged(this, context); }
/** * Constructor with the Restlet's context which can be the parent's * application context, but shouldn't be the parent Component's context for * security reasons. * * @see Context#createChildContext() * * @param context * The context of the Restlet. * */ public Restlet(Context context) { this.context = context; this.started = false; this.name = toString(); this.description = null; this.author = null; this.owner = null; this.finderClass = null; if (Engine.getInstance() == null) { Context.getCurrentLogger() .severe("Unable to fully initialize the Restlet. No Restlet engine available."); throw new RuntimeException( "Unable to fully initialize the Restlet. No Restlet engine available."); } fireContextChanged(this, context); }