Package com.dbxml.labrador

Examples of com.dbxml.labrador.ID


      catch ( Exception e ) {
         e.printStackTrace(System.err);
      }

      proxy = new CollectionProxy(this);
      ObjectResolver.register(new ID(getCanonicalName()), proxy);

      super.setConfig(config);
   }
View Full Code Here


   public boolean drop() throws DBException {
      if ( this == getDatabase() )
         throw new DBException(FaultCodes.DBE_CANNOT_DROP, "You Cannot Drop The Database");

      if ( proxy != null ) {
         ObjectResolver.unregister(new ID(getCanonicalName()));
         proxy = null;
      }

      // Drop Child Collections
      String[] cols = listCollections();
View Full Code Here

    * It also recursively calls dispose on the Collection's child
    * Collections.
    */
   public void dispose() {
      if ( proxy != null ) {
         ObjectResolver.unregister(new ID(getCanonicalName()));
         proxy = null;
      }

      Iterator iter = collections.values().iterator();
      while ( iter.hasNext() ) {
View Full Code Here

            throw new CannotCreateException("No name specified");

         objects.put(name, new ExtensionInfo(name, obj, cfg));

         if ( !collection.getDatabase().isDatabaseEmbedded() )
            ObjectResolver.register(new ID(getCanonicalName(name)), obj);

         return obj;
      }
      catch ( DBException d ) {
         throw d;
View Full Code Here

      }
   }

   private void unregister(String name) {
      if ( !collection.getDatabase().isDatabaseEmbedded() )
         ObjectResolver.unregister(new ID(getCanonicalName(name)));

      objects.remove(name);
   }
View Full Code Here

      if ( !services.startServices() ) {
         System.err.println("FATAL ERROR: Service manager could not be started");
         System.exit(1);
      }

      ObjectResolver.register(new ID("dbXML"), new ServerProxy(this));

      // Register the shutdown handler
      Runtime.getRuntime().addShutdownHook(new ShutdownHandler());

      // Start The Scheduling Daemon
View Full Code Here

            String path = cfg.getAttribute(PATH);
            if ( path.equals(DEFAULT_PATH) )
               context = rootContext;
            else
               context = createContext(new ID(path));

            int timeout = cfg.getIntAttribute(TIMEOUT, DEFAULT_TIMEOUT);
            context.timeout = timeout;

            boolean expires = cfg.getBooleanAttribute(EXPIRES, DEFAULT_EXPIRES);
View Full Code Here

   private static void printError(String message) {
      Broker.printerr("   "+message);
   }

   public boolean filter(Request request, Response response) throws FilterException {
      ID sessionID = null;

      String cookie = request.getHeader(HTTP.HEADER_COOKIE);
      StringTokenizer st = new StringTokenizer(cookie, ";");
      while ( st.hasMoreTokens() ) {
         String token = st.nextToken();
         int idx = token.indexOf('=');
         if ( idx != -1 ) {
            String key = token.substring(0, idx).trim();
            if ( key.equals(COOKIE_NAME) ) {
               String value = token.substring(idx + 1).trim();
               sessionID = new ID(value);
            }
         }
      }

      BrokerContext brokerContext = Broker.getInstance().getBrokerContext();
      ID instanceID = brokerContext.getId();
      SessionContext context = getClosestContext(instanceID);

      boolean setCookie = sessionID == null || context.expires;

      if ( sessionID == null )
         sessionID = new ID();

      if ( setCookie ) {
         StringBuffer sb = new StringBuffer();
         sb.append(COOKIE_NAME);
         sb.append('=');
View Full Code Here

   }

   static Session getCurrentSession() throws SessionException {
      BrokerContext brokerContext = Broker.getInstance().getBrokerContext();

      ID sessionID = (ID)brokerContext.getProperty(PROP_SESSION_ID);
      SessionContext context = (SessionContext)brokerContext.getProperty(PROP_SESSION_CONTEXT);

      if ( sessionID != null ) {
         Map sessions = context.sessions;
         Session session = (Session)sessions.get(sessionID);
View Full Code Here

public class SimpleObject extends SimpleConfigurable {
   private ID id;

   public SimpleObject() {
      register(new ID(getClass().getName().replace('.', '/')));
   }
View Full Code Here

TOP

Related Classes of com.dbxml.labrador.ID

Copyright © 2018 www.massapicom. 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.