Package org.apache.shindig.config

Examples of org.apache.shindig.config.ContainerConfigException


    for(ContainerExtPoint extPoint : containers) {
      try {
        validateContainerId(extPoint.getId());
        ContainerExtPointManager.containers.put(extPoint.getId(), extPoint);
      } catch (ContainerExtPointException e) {
        throw new ContainerConfigException(e);
      }
    }
    synchronized(listeners) {
      for(ContainerExtPointListener listener : listeners) {
        listener.added(containers);
View Full Code Here


    try{
      //This is an easy way to make sure the id is URL encoded, if parse throws an error
      //than there is a problem.
      Uri.parse("http://foo/" + id);
    } catch(UriException e) {
      throw new ContainerConfigException("Container IDs must be URL encoded. ID: " + id, e);
    }
    if(id.contains(":")) {
      throw new ContainerConfigException("Container IDs cannot contain colons. ID: " + id);
    }
  }
View Full Code Here

  public static void unregisterContainers(Collection<ContainerExtPoint> containers) throws ContainerConfigException {
    for(ContainerExtPoint extPoint : containers) {
      try {
        ContainerExtPointManager.containers.remove(extPoint.getId());
      } catch (ContainerExtPointException e) {
        throw new ContainerConfigException(e);
      }
    }
    synchronized(listeners) {
      for(ContainerExtPointListener listener : listeners) {
        listener.removed(containers);
View Full Code Here

                if (file.isDirectory()) {
                    loadFiles(file.listFiles(), all);
                } else if (file.getName().toLowerCase(Locale.ENGLISH).endsWith(".js")
                        || file.getName().toLowerCase(Locale.ENGLISH).endsWith(".json")) {
                    if (!file.exists()) {
                        throw new ContainerConfigException("The file '" + file.getAbsolutePath() + "' doesn't exist.");
                    }
                    loadFromString(ResourceLoader.getContent(file), all);
                } else {
                    if (LOG.isLoggable(Level.FINEST))
                        LOG.finest(file.getAbsolutePath() + " doesn't seem to be a JS or JSON file.");
                }
            }
        } catch (IOException e) {
            throw new ContainerConfigException(e);
        }
    }
View Full Code Here

                    }
                }
                loadFromString(content, all);
            }
        } catch (IOException e) {
            throw new ContainerConfigException(e);
        }
    }
View Full Code Here

            return base;
        }

        String parent = base.optString(PARENT_KEY, DEFAULT_CONTAINER);
        if (!all.has(parent)) {
            throw new ContainerConfigException("Unable to locate parent '" + parent + "' required by "
                    + base.getString(CONTAINER_KEY));
        }
        return mergeObjects(mergeParents(parent, all), base);
    }
View Full Code Here

                // Copy the default object and produce a new one.
                String container = containers.getString(i);
                all.put(container, contents);
            }
        } catch (JSONException e) {
            throw new ContainerConfigException(e);
        }
    }
View Full Code Here

                all.put(container, mergeParents(container, all));
            }

            return all;
        } catch (IOException e) {
            throw new ContainerConfigException(e);
        } catch (JSONException e) {
            throw new ContainerConfigException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.shindig.config.ContainerConfigException

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.