Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Licensed to the Apache Software Foundation (ASF) under one
   * or more contributor license agreements.  See the NOTICE file
   * distributed with this work for additional information
   * regarding copyright ownership.  The ASF licenses this file
   * to you under the Apache License, Version 2.0 (the
   * "License"); you may not use this file except in compliance
   * with the License.  You may obtain a copy of the License at
   *
  *   http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
  */
 package org.apache.ace.webui.vaadin;
 
 
 
 
 import java.net.URL;
 
 public class VaadinServlet extends AbstractApplicationServlet implements ManagedService {
     private static final long serialVersionUID = 1L;
     public static final String PID = "org.apache.ace.webui.vaadin";
     public static final String ACE_HOST = "aceHost";
     public static final String OBR_URL = "obrUrl";
 
     private volatile DependencyManager m_manager;
 
     private volatile URL m_aceHost;
     private volatile URL m_obrUrl;
     
     @Override
     protected Class<? extends ApplicationgetApplicationClass() {
         return VaadinClient.class;
     }
 
     @Override
     protected Application getNewApplication(HttpServletRequest request)	throws ServletException {
         Application application = new VaadinClient();
             .setImplementation(application)
             .setCallbacks("setupDependencies""start""stop""destroyDependencies")
             .add(.createServiceDependency()
                 .setService(SessionFactory.class)
                 .setRequired(true)
             )
             .add(.createServiceDependency()
                 .setService(UserAdmin.class)
                 .setRequired(true)
             )
             .add(.createServiceDependency()
                 .setService(LogService.class)
                 .setRequired(false)
             )
         );
         return application;
     }
 
     public void updated(Dictionary dictionarythrows ConfigurationException {
         ..println("There's a config! "dictionary);
         if (dictionary != null) {
             URL aceHost;
             try {
                 String aceHostString = (Stringdictionary.get();
                 if (aceHostString == null) {
                     throw new ConfigurationException("Missing property");
                 }
                 aceHost = new URL(aceHostString);
             }
             catch (MalformedURLException e) {
                 throw new ConfigurationException("Is not a valid URL"e);
             }
 
             URL obrUrl;
             try {
                 String obrUrlString = (Stringdictionary.get();
                 if (obrUrlString == null) {
                     throw new ConfigurationException("Missing property");
                 }
                 obrUrl = new URL(obrUrlString);
             }
             catch (MalformedURLException e) {
                throw new ConfigurationException("Is not a valid URL"e);
            }
             = aceHost;
             = obrUrl;
        }
    }
New to GrepCode? Check out our FAQ X