/** * Registers a new Restlet Engine. * * @return The registered engine. */ public static synchronized Engine register() { return register(true); }
/** * Starts the OSGi bundle by registering the engine with the bundle of the * Restlet API. * * @param context * The bundle context. */ public void start(BundleContext context) throws Exception { org.restlet.engine.Engine.register(false); // Discover helpers in installed bundles and start // the bundle if necessary for (final Bundle bundle : context.getBundles()) { registerHelpers(bundle); } // Listen to installed bundles context.addBundleListener(new BundleListener() { public void bundleChanged(BundleEvent event) { switch (event.getType()) { case BundleEvent.INSTALLED: registerHelpers(event.getBundle()); break; case BundleEvent.UNINSTALLED: break; } } }); Engine.getInstance().registerDefaultConnectors(); Engine.getInstance().registerDefaultAuthentications(); Engine.getInstance().registerDefaultConverters(); }
/** * Returns the registered Restlet engine. * * @return The registered Restlet engine. */ public static synchronized Engine getInstance() { Engine result = instance; if (result == null) { result = register(); } return result; }
public static void process(String[] args) throws TranslationException { Engine.register(); String ulogin = null; String upwd = null;
public static void process(String[] args) throws TranslationException { Engine.register(); String ulogin = null; String upwd = null;
public static void process(String[] args) throws TranslationException { Engine.register(); String ulogin = null; String upwd = null;
public static void process(String[] args) throws TranslationException { Engine.register(); String ulogin = null; String upwd = null;
public static void process(String[] args) throws TranslationException { Engine.register(); String ulogin = null; String upwd = null;