Examples of ResourceLocator


Examples of com.jme.util.resource.ResourceLocator

            Node modelBG;
            Map<String, String> deployedTextures = null;
            if (data!=null)
                deployedTextures = data.getDeployedTextures();

            ResourceLocator resourceLocator = getDeployedResourceLocator(deployedTextures, baseURL);

            if (resourceLocator!=null) {
                ResourceLocatorTool.addThreadResourceLocator(
                        ResourceLocatorTool.TYPE_TEXTURE,
                        resourceLocator);
View Full Code Here

Examples of com.netflix.governator.lifecycle.ResourceLocator

{
    @Test(dataProvider = "builders")
    public void basicTest(LifecycleInjectorBuilder lifecycleInjectorBuilder) throws Exception
    {
        final AtomicInteger classResourceCount = new AtomicInteger(0);
        final ResourceLocator resourceLocator = new ResourceLocator()
        {
            @Override
            public Object locate(Resource resource, ResourceLocator nextInChain) throws Exception
            {
                if ( resource.name().equals(ObjectWithResources.class.getName() + "/myResource") )
View Full Code Here

Examples of com.netflix.governator.lifecycle.ResourceLocator

    public void testChained(LifecycleInjectorBuilder lifecycleInjectorBuilder) throws Exception
    {
        final AtomicInteger resourceLocator1Count = new AtomicInteger(0);
        final AtomicInteger resourceLocator2Count = new AtomicInteger(0);

        final ResourceLocator resourceLocator1 = new ResourceLocator()
        {
            @Override
            public Object locate(Resource resource, ResourceLocator nextInChain) throws Exception
            {
                resourceLocator1Count.incrementAndGet();
                return nextInChain.locate(resource, nextInChain);
            }
        };
        final ResourceLocator resourceLocator2 = new ResourceLocator()
        {
            @Override
            public Object locate(Resource resource, ResourceLocator nextInChain) throws Exception
            {
                resourceLocator2Count.incrementAndGet();
View Full Code Here

Examples of org.apache.cayenne.resource.ResourceLocator

        nodeDescriptor2.setName("node2");
        nodeDescriptor2.getDataMapNames().add("map2");
        nodeDescriptor2.setParameters("testDataNode2.driver.xml");
        testDescriptor.getNodeDescriptors().add(nodeDescriptor2);

        final ResourceLocator locator = new ResourceLocator() {

            public Collection<Resource> findResources(String name) {
                assertEquals(testConfigName, name);
                return Collections.<Resource> singleton(new MockResource());
            }
View Full Code Here

Examples of org.apache.cayenne.resource.ResourceLocator

        nodeDescriptor2.setName("node2");
        nodeDescriptor2.getDataMapNames().add("map2");
        nodeDescriptor2.setParameters("testDataNode2.driver.xml");
        testDescriptor.getNodeDescriptors().add(nodeDescriptor2);

        final ResourceLocator locator = new ResourceLocator() {

            public Collection<Resource> findResources(String name) {
                assertEquals(testConfigName, name);
                return Collections.<Resource> singleton(new MockResource());
            }
View Full Code Here

Examples of org.apache.cayenne.util.ResourceLocator

        // ignore loading failures
        this.setIgnoringLoadFailures(true);

        // configure deterministic file opening rules
        ResourceLocator locator = this.getResourceLocator();
        locator.setSkipAbsolutePath(false);
        locator.setSkipClasspath(true);
        locator.setSkipCurrentDirectory(true);
        locator.setSkipHomeDirectory(true);
    }
View Full Code Here

Examples of org.apache.cayenne.util.ResourceLocator

     * @deprecated since 3.1 as MapLoader should not bother itself with looking up
     *             resources.
     */
    @Deprecated
    protected ResourceFinder createResourceFinder() {
        ResourceLocator locator = new ResourceLocator();

        // absolute paths are usually passed by the Modeler
        // while runtime would use classpath

        locator.setSkipAbsolutePath(false);
        locator.setSkipClasspath(false);
        locator.setSkipCurrentDirectory(false);
        locator.setSkipHomeDirectory(true);
        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

        }

        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
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.