Examples of ObservableProperties


Examples of org.w3c.util.ObservableProperties

  if (getServletProps() == null ) {
      synchronized (this.getClass()) {
    httpd s = (httpd) getServer();
    if ( s != null ) {
        // Register the property sheet if not done yet:
        ObservableProperties props = s.getProperties() ;
        s.registerPropertySet(new ServletProps(s));
    }
      }
  }
    }
View Full Code Here

Examples of org.w3c.util.ObservableProperties

  if ( cls != null ) {
      // This is a fresh new server handler:
      try {
    Class c = Class.forName(cls);
    server  = (ServerHandler) c.newInstance();
    ObservableProperties p = props.loadPropertySpace(id);
    this.fixProperties(p);
    server.initialize(this, id, p);
      } catch (FileNotFoundException ex) {
    error("Unable to launch "+id+", no properties found:"
          + ex.getMessage());
View Full Code Here

Examples of org.w3c.util.ObservableProperties

      } else if (flt[i].equals(
           "org.w3c.www.protocol.http.cache.CacheFilter")) {
    if (server.getPropertySet(CACHE_PROP_NAME) == null) {
        p = new CacheProp(CACHE_PROP_NAME, server);
        server.registerPropertySet(p);
        ObservableProperties props = server.getProperties();
        File c =
      props.getFile(CacheStore.CACHE_DIRECTORY_P, null);
        if ( c == null ) {
      c = new File(server.getConfigDirectory(),
             "cache");
      props.putValue(CacheStore.CACHE_DIRECTORY_P,
               c.getAbsolutePath());
        }
    }
      } else if (flt[i].equals(
       "org.w3c.www.protocol.http.proxy.ProxyDispatcher")) {
View Full Code Here

Examples of org.w3c.util.ObservableProperties

    continue;
      if ( managers[i].sameProperties(p) )
    return managers[i].getManager();
  }
  // Get the props we will initialize from:
  ObservableProperties props = null;
  if ( p instanceof ObservableProperties )
      props = (ObservableProperties) p;
  else
      props = new ObservableProperties(p);
  // Create a new manager for this set of properties:
  HttpManager manager = null;;
  try {
      Object o = managerclass.newInstance();
      if (o instanceof HttpManager) {
    manager = (HttpManager) o;
      } else { // default value
    manager = new HttpManager();
      }
  } catch (Exception ex) {
      ex.printStackTrace();
      manager = new HttpManager();
  }
  manager.props = props;
  // Initialize this new manager filters:
  String filters[] = props.getStringArray(FILTERS_PROP_P, null);
  if ( filters != null ) {
      for (int i = 0 ; i < filters.length ; i++) {
    try {
        Class c = Class.forName(filters[i]);
        PropRequestFilter f = null;
        f = (PropRequestFilter) c.newInstance();
        f.initialize(manager);
    } catch (PropRequestFilterException ex) {
        System.out.println("Couldn't initialize filter \""
               + filters[i]
               + "\" init failed: "
                                       + ex.getMessage());
    } catch (Exception ex) {
        System.err.println("Error initializing prop filters:");
        System.err.println("Coulnd't initialize ["
                                       + filters[i]
               + "]: " + ex.getMessage());
        ex.printStackTrace();
        System.exit(1);
    }
      }
  }
  // The factory to create MIME reply holders:
  manager.factory = manager.getReplyFactory();
  // The class to create HttpServer instances from
  String c = props.getString(SERVER_CLASS_P, DEFAULT_SERVER_CLASS);
  try {
    manager.serverclass = Class.forName(c);
  } catch (Exception ex) {
      System.err.println("Unable to initialize HttpManager: ");
      System.err.println("Class \""+c+"\" not found, from property "
                               + SERVER_CLASS_P);
      ex.printStackTrace();
      System.exit(1);
  }
  // Setup the template request:
  Request tpl = manager.template;
  // Set some default headers value (from props)
  // Check for a proxy ?
  manager.updateProxy();
  // CacheControl, only-if-cached
  tpl.setOnlyIfCached(props.getBoolean(ONLY_IF_CACHED_P, false));
  // CacheControl, maxstale
  int ival = props.getInteger(MAX_STALE_P, -1);
  if ( ival >= 0 )
      tpl.setMaxStale(ival);
  // CacheControl, minfresh:
  ival = props.getInteger(MIN_FRESH_P, -1);
  if ( ival >= 0 )
      tpl.setMinFresh(ival);
  // general, lenient
  manager.lenient = props.getBoolean(LENIENT_P, true);
  manager.keepbody = props.getBoolean(KEEPBODY_P, false);
  // General, User agent
  String sval;
  tpl.setValue("user-agent"
         , props.getString(USER_AGENT_P
               , DEFAULT_USER_AGENT));
  // General, Accept
  tpl.setValue("accept"
         , props.getString(ACCEPT_P, DEFAULT_ACCEPT));
  // General, Accept-Language
  sval = props.getString(ACCEPT_LANGUAGE_P, null);
  if ( sval != null ) {
      if (sval.trim().length() > 0) {
    tpl.setValue("accept-language", sval);
      }
  }
  // General, Accept-Encoding
  sval = props.getString(ACCEPT_ENCODING_P, null);
  if ( sval != null ) {
      if (sval.trim().length() > 0) {
    tpl.setValue("accept-encoding", sval);
      }
  }
  // Maximum number of allowed connections:
  manager.conn_max = props.getInteger(CONN_MAX_P, 5);
  // timeout value
  manager.timeout = props.getInteger(TIMEOUT_P, manager.timeout);
  // connection timeout
  manager.conn_timeout = props.getInteger(CONN_TIMEOUT_P,
            manager.conn_timeout);
  // Register ourself as a property observer:
  props.registerObserver(manager);
  // Register that manager in our knwon managers:
  for (int i = 0 ; i < managers.length ; i++) {
      if ( managers[i] == null ) {
    managers[i] = new ManagerDescription(manager, p);
    return manager;
View Full Code Here

Examples of org.w3c.util.ObservableProperties

  if ( ! inited ) {
      synchronized (this.getClass()) {
    httpd s = (httpd) getServer();
    if ( s != null ) {
        // Register the CVS property sheet if not done yet:
        ObservableProperties props = s.getProperties() ;
        s.registerPropertySet(new CvsProp("cvs", s));
        inited = true ;
    }
      }
  }
View Full Code Here

Examples of org.w3c.util.ObservableProperties

    /**
     * companion to initialize, called after the register
     */
    public void registerResource(FramedResource resource) {
  super.registerResource(resource);
  ObservableProperties props = getResource().getServer().getProperties();
  manager = org.w3c.www.protocol.webdav.DAVManager.getDAVManager(props);
    }
View Full Code Here

Examples of org.w3c.util.ObservableProperties

     */
    public void initialize(HttpManager manager)
  throws PropRequestFilterException
    {
  this.manager = manager;
  ObservableProperties props = manager.getProperties();
  String filepath = (String)props.getString(COOKIES_FILE_P, null);
  if (filepath == null) {
      cookiefile = new File(defaultFileName);
  } else {
      cookiefile = new File(filepath);
  }
View Full Code Here
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.