Package org.w3c.util

Examples of org.w3c.util.ObservableProperties


  // tk, 1 February 2004,
  // added optional client authentication,
  // which is forced, if a truststore is configured and
  // the org.w3c.jigsaw.ssl.authenticate is not set to false
  if (serversocket instanceof SSLServerSocket) {
      ObservableProperties props = daemon.getProperties();
       
        // decide client authentication based on trust configuration
      boolean mandatory;
      mandatory = props.getBoolean(SSLProperties.MUST_AUTHENTICATE_P,
           false);
      boolean generic;
      generic = props.getBoolean(SSLProperties.TRUSTSTORE_GENERIC_P,
               false);
      String trust;
      trust = props.getString(SSLProperties.TRUSTSTORE_PATH_P,
            null);
     
      boolean authenticate = mandatory||generic||
                       ((null != trust)&&(trust.length() > 0));
     
View Full Code Here


     */
    public void initialize(httpd server) {
        super.initialize(server);
        daemon = server;
        daemon.registerPropertySet(new SSLProperties(daemon));
        ObservableProperties props = daemon.getProperties();
 
        try {
           
      // Providers or protocols are switched by default
      // in a compatible way as postulated by the JDK 1.4 policies
      String provider;
      provider = props.getString(SSLProperties.SECURITY_PROVIDER_P,
               (supportsOptionalClientAuth ? null :
             SSLProperties.DEFAULT_SECURITY_PROVIDER));
      addProvider(provider);
     
      String handler = props.getString(SSLProperties.PROTOCOL_HANDLER_P,
            (supportsOptionalClientAuth ? null :
              SSLProperties.DEFAULT_PROTOCOL_HANDLER));
      setHandler(handler);
     
      context = createContext(props);
     
      String bindAddrName = props.getString(BINDADDR_P, null);
      if (bindAddrName != null) {
    try {
        bindAddr = InetAddress.getByName(bindAddrName);
    } catch (Exception ex) {
        bindAddr = null;
    }
      } else {
    bindAddr = null;
      }
     
      maxClients = props.getInteger(MAXCLIENTS_P, MAXCLIENTS);
     
        } catch (Exception ex) {
      String mes;
      mes = "Unable to initialize secure socket provider";
      daemon.fatal(ex, mes);
View Full Code Here

     * @return true if and only if the modification has been handled
     * successfully
     */
    public boolean propertyChanged(String name) {
        if (super.propertyChanged(name)) {
      ObservableProperties props = daemon.getProperties();
     
      try {
    if (name.equals(MAXCLIENTS_P)) {
                    int newmax = props.getInteger(MAXCLIENTS_P, -1);
                    if (newmax > maxClients) {
      for (int i = maxClients-newmax; --i >= 0; ) {
          addClient(true);
      }
                    } else if (newmax > 0) {
      maxClients = newmax;
                    }
                    return true;
    } else if (name.equals(BINDADDR_P)) {
        bindAddr = InetAddress.getByName(
      props.getString(BINDADDR_P, null));
        return true;
    } else if ((name.equals(SSLProperties.KEYSTORE_GENERIC_P)) ||
         (name.equals(SSLProperties.KEYSTORE_PATH_P)) ||
         (name.equals(SSLProperties.KEYSTORE_TYPE_P)) ||
         (name.equals(SSLProperties.KEYSTORE_PASSWORD_P)) ||
View Full Code Here

    public ResourceReference createDefaultResource(String name) {
  throw new RuntimeException("static container");
   

    protected void saveProperties() {
  ObservableProperties props = server.getProperties();
  File propfile = new File(props.getString(httpd.PROPS_P, null));
  // Did we guessed were the place to save the property file ?
  if ( propfile == null) {
      throw new RuntimeException("Unable to save properties: property "+
               httpd.PROPS_P+" undefined.");
  } else {
View Full Code Here

  if (getPageCompileProps() == 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 PageCompileProp(s));
    }
      }
  }
  File generatedClassDir =
View Full Code Here

     */

    public ObservableProperties loadPropertySpace(String id, InputStream in)
  throws IOException
    {
  ObservableProperties p = (ObservableProperties) propspace.get(id);
  if ( p == null ) {
      p = new ObservableProperties(globprops);
      propspace.put(id, p);
  }
  p.load(in);
  return p;
    }
View Full Code Here

    public ObservableProperties loadPropertySpace(String id)
  throws IOException, FileNotFoundException
    {
  File                 file = new File(configdir, id+".props");
  ObservableProperties p    = null;
  p = loadPropertySpace(id, (new BufferedInputStream
           (new FileInputStream(file))));
  p.put(org.w3c.jigsaw.http.httpd.PROPS_P, file.getAbsolutePath());
  return p;
    }
View Full Code Here

     * @exception ServerHandlerInitException thrown if initialization fails
     */
    public void initializeProperties()
        throws ServerHandlerInitException
    {
        ObservableProperties props = daemon.getProperties();
        // default to well-known factory if applicable       
        if (props.getBoolean(SSLProperties.SSL_ENABLED_P, true)) {
            String factory_class = props.getString(httpd.CLIENT_FACTORY_P,
               null);
            if (null != factory_class) {
                try {
        Class factory = Class.forName(factory_class);
        ssl_enabled =
View Full Code Here

    public HttpSession getSession() {
  return getSession(true);
    }

    protected String getCookieName() {
   ObservableProperties props =
       request.getClient().getServer().getProperties();
   return props.getString(ServletProps.SERVLET_COOKIE_NAME,
        ServletProps.DEFAULT_COOKIE_NAME);
    }
View Full Code Here

    && (vias != null && vias.length > 5)) { 
    // maybe a loop, let's try to sort it out with an expensive
    // checking on IPs
    String hostaddr;
   
    ObservableProperties props = getServer().getProperties();
    hostaddr = props.getString(SocketClientFactory.BINDADDR_P,
             default_hostaddr);
    if (requrl != null) {
        InetAddress targhost;
        String reqhostaddr;
       
View Full Code Here

TOP

Related Classes of org.w3c.util.ObservableProperties

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.