Examples of ResourceLocator


Examples of org.apache.cayenne.util.ResourceLocator

    /**
     * Creates and returns a {{org.apache.commons.dbcp.PoolingDataSource}} instance.
     */
    public DataSource getDataSource(String location) throws Exception {

        ResourceLocator resourceLocator;

        if (parentConfiguration != null) {
            resourceLocator = parentConfiguration.getResourceLocator();
        }
        else {
            resourceLocator = new ResourceLocator();
            resourceLocator.setSkipAbsolutePath(false);
            resourceLocator.setSkipHomeDirectory(true);
            resourceLocator.setSkipClasspath(false);
            resourceLocator.setSkipCurrentDirectory(false);
        }

        DBCPDataSourceProperties properties = new DBCPDataSourceProperties(
                resourceLocator,
                location);
View Full Code Here

Examples of org.apache.cayenne.util.ResourceLocator

    // set the project file
    this.projectFile = new File(domainConfigurationName);

    // configure the ResourceLocator for plain files
    ResourceLocator locator = this.getResourceLocator();
    locator.setSkipAbsolutePath(false);
    locator.setSkipClasspath(true);
    locator.setSkipCurrentDirectory(false);
    locator.setSkipHomeDirectory(true);

    // add the file's location to the search path, if it exists
    File projectDirectory = this.getProjectDirectory();
    if (projectDirectory != null) {
      locator.addFilesystemPath(projectDirectory.getPath());
    }
  }
View Full Code Here

Examples of org.apache.cayenne.util.ResourceLocator

    // set the project file
    this.setProjectFile(domainConfigurationFile);

    // configure the ResourceLocator for plain files
    ResourceLocator locator = this.getResourceLocator();
    locator.setSkipAbsolutePath(false);
    locator.setSkipClasspath(true);
    locator.setSkipCurrentDirectory(false);
    locator.setSkipHomeDirectory(true);

    // add the file's location to the search path, if it exists
    File projectDirectory = this.getProjectDirectory();
    if (projectDirectory != null) {
      locator.addFilesystemPath(projectDirectory);
    }
  }
View Full Code Here

Examples of org.apache.cayenne.util.ResourceLocator

        }

        logger.debug("using domain file name: " + domainConfigurationName);

        // configure CLASSPATH-only locator
        ResourceLocator locator = new ResourceLocator();
        locator.setSkipAbsolutePath(true);
        locator.setSkipClasspath(false);
        locator.setSkipCurrentDirectory(true);
        locator.setSkipHomeDirectory(true);

        // add the current Configuration subclass' package as additional path.
        if (!(this.getClass().equals(DefaultConfiguration.class))) {
            locator.addClassPath(Util.getPackagePath(this.getClass().getName()));
        }

        setResourceLocator(locator);
    }
View Full Code Here

Examples of org.apache.cayenne.util.ResourceLocator

     *
     * @throws CayenneRuntimeException if source URI does not resolve to a valid map files
     */
    public DataMap loadDataMap(String uri) throws CayenneRuntimeException {
        // configure resource locator
        ResourceLocator locator = configLocator();
        InputStream in = locator.findResourceStream(uri);
        if (in == null) {
            throw new CayenneRuntimeException("Can't find data map " + uri);
        }

        try {
View Full Code Here

Examples of org.apache.cayenne.util.ResourceLocator

    /**
     * Creates, configures and returns ResourceLocator object used to lookup DataMap
     * files.
     */
    protected ResourceLocator configLocator() {
        ResourceLocator locator = new ResourceLocator();
        locator.setSkipAbsolutePath(true);
        locator.setSkipClasspath(false);
        locator.setSkipCurrentDirectory(false);
        locator.setSkipHomeDirectory(false);
        return locator;
    }
View Full Code Here

Examples of org.apache.cayenne.util.ResourceLocator

     */
    // TODO: refactor EOModelHelper to provide a similar method without loading
    // all entity files in memory... here we simply copied stuff from EOModelHelper
    public Map loadModeIndex(String path) throws Exception {

        ResourceLocator locator = new ResourceLocator();
        locator.setSkipClasspath(false);
        locator.setSkipCurrentDirectory(false);
        locator.setSkipHomeDirectory(true);
        locator.setSkipAbsolutePath(false);

        if (!path.endsWith(".eomodeld")) {
            path += ".eomodeld";
        }

        URL base = locator.findDirectoryResource(path);
        if (base == null) {
            throw new FileNotFoundException("Can't find EOModel: " + path);
        }

        Parser plistParser = new Parser();
View Full Code Here

Examples of org.apache.cayenne.util.ResourceLocator

        // don't use static getter, since it will do initialization on demand!!!
        Configuration oldConfig = Configuration.sharedConfiguration;
        if (oldConfig instanceof DefaultConfiguration) {

            ResourceLocator locator = ((DefaultConfiguration) oldConfig)
                    .getResourceLocator();

            if (locator instanceof WebApplicationResourceLocator) {
                if (((WebApplicationResourceLocator) locator).getServletContext() == context) {
                    logObj
View Full Code Here

Examples of org.apache.cayenne.util.ResourceLocator

     */
    // TODO: refactor EOModelHelper to provide a similar method without loading
    // all entity files in memory... here we simply copied stuff from EOModelHelper
    public Map loadModeIndex(String path) throws Exception {

        ResourceLocator locator = new ResourceLocator();
        locator.setSkipClasspath(false);
        locator.setSkipCurrentDirectory(false);
        locator.setSkipHomeDirectory(true);
        locator.setSkipAbsolutePath(false);

        if (!path.endsWith(".eomodeld")) {
            path += ".eomodeld";
        }

        URL base = locator.findDirectoryResource(path);
        if (base == null) {
            throw new FileNotFoundException("Can't find EOModel: " + path);
        }

        Parser plistParser = new Parser();
View Full Code Here

Examples of org.apache.geronimo.jee.naming.ResourceLocator

            if (gbeanlocator != null && isEmpty(gbeanlocator.getGbeanLink()) && isEmpty(gbeanlocator.getPattern())) {
                webapp.setWebContainer(null);
            }
        } else if (source instanceof OpenejbJar) {
            OpenejbJar openejb = (OpenejbJar)source;
            ResourceLocator locator = openejb.getCmpConnectionFactory();
            if (locator != null && isEmpty(locator.getResourceLink()) && isEmpty(locator.getUrl()) && isEmpty(locator.getPattern())) {
                openejb.setCmpConnectionFactory(null);
            }
            Relationships relationships = openejb.getRelationships();
            if (relationships != null && relationships.getEjbRelation().size() == 0) {
                openejb.setRelationships(null);
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.