Package org.atomojo.app.admin

Source Code of org.atomojo.app.admin.DerbyApplication

/*
* SyncApplication.java
*
* Created on April 12, 2007, 1:34 PM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/

package org.atomojo.app.admin;

import org.atomojo.app.App;
import org.atomojo.app.Storage;
import org.atomojo.app.db.DB;
import org.restlet.Application;
import org.restlet.Context;
import org.restlet.Request;
import org.restlet.Response;
import org.restlet.Restlet;
import org.restlet.routing.Router;
import org.restlet.routing.Template;

/**
*
* @author alex
*/
public class DerbyApplication extends Application
{
  
   DB db;
   Storage storage;
   /** Creates a new instance of SyncApplication */
   public DerbyApplication(Context context,DB db,Storage storage)
   {
      super(context);
      this.db = db;
      this.storage = storage;
      getTunnelService().setEnabled(false);
   }
  
   @Override
   public Restlet createRoot() {  
      Router router = new Router(getContext()) {
         public void handle(Request request,Response response)
         {
            request.getAttributes().put(App.DB_ATTR,db);
            request.getAttributes().put(App.STORAGE_ATTR,storage);
            super.handle(request,response);
         }
      };
      router.attach("/table/{name}",TableDumpResource.class);
      return router;
     
   }
}
TOP

Related Classes of org.atomojo.app.admin.DerbyApplication

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.