Package org.jboss.gravia.resource

Examples of org.jboss.gravia.resource.ResourceIdentity


        return getClass().getSimpleName();
    }

    @Override
    public String toString() {
        ResourceIdentity id = identity;
        String idstr = (id != null ? id.getSymbolicName() + ":" + id.getVersion() : "anonymous");
        return getSimpleTypeName() + "[" + idstr + "]";
    }
View Full Code Here


            if (!getDirectives().isEmpty()) {
                buffer.append(addcomma ? "," : "");
                buffer.append("dirs=" + directives);
                addcomma = true;
            }
            ResourceIdentity icap = resource.getIdentity();
            if (icap != null) {
                buffer.append(addcomma ? "," : "");
                buffer.append("[" + icap.getSymbolicName() + ":" + icap.getVersion() + "]");
                addcomma = true;
            } else {
                buffer.append(addcomma ? "," : "");
                buffer.append("[anonymous]");
                addcomma = true;
View Full Code Here

    private ResourceHandle installUnsharedResourceInternal(Context context, Resource resource) throws Exception {
        LOGGER.info("Installing unshared resource: {}", resource);

        File tempfile = null;
        ResourceIdentity identity = resource.getIdentity();
        String runtimeName = getRuntimeName(resource, true);

        ContentCapability ccap = (ContentCapability) resource.getCapabilities(ContentNamespace.CONTENT_NAMESPACE).get(0);
        URL contentURL = ccap.getContentURL();
        if (contentURL == null || !contentURL.toExternalForm().startsWith("file:")) {
View Full Code Here

        // Try to find the providers in the fallback
        if (providers.isEmpty() && getFallbackRepository() != null) {
            providers = new HashSet<Capability>();
            for (Capability cap : getFallbackRepository().findProviders(req)) {
                Resource res = cap.getResource();
                ResourceIdentity resid = res.getIdentity();
                Resource storageResource = repositoryStorage.getResource(resid);
                if (storageResource == null) {
                    storageResource = repositoryStorage.addResource(res);
                    for (Capability aux : storageResource.getCapabilities(req.getNamespace())) {
                        if (cap.getAttributes().equals(aux.getAttributes())) {
View Full Code Here

            boolean isShared = !isWar(name, file);
            Resource resource = findMavenResource(mvnCoords, url, isShared);
            if (resource == null) {
                LOGGER.warn("Could not find resource for " + mvnCoords + " and " + url);
            } else {
                ResourceIdentity identity = resource.getIdentity();
                Resource oldResource = installedResources.remove(identity);
                if (oldResource == null && !resourcehandleMap.containsKey(identity)) {
                    if (isShared) {
                        // TODO lest not deploy shared stuff for now since bundles throw an exception when trying to stop them
                        // which breaks the tests ;)
                        LOGGER.debug("TODO not installing " + (isShared ? "shared" : "non-shared") + " resource: " + identity);
                    } else {
                        LOGGER.info("Installing " + (isShared ? "shared" : "non-shared") + " resource: " + identity);
                        resourcesToInstall.add(resource);
                        resourceUrisInstalled.add(name);
                    }
                }
            }
        }

        for (Resource installedResource : installedResources.values()) {
            ResourceIdentity identity = installedResource.getIdentity();
            ResourceHandle resourceHandle = resourcehandleMap.get(identity);
            if (resourceHandle == null) {
                // TODO should not really happen when we can ask about the installed Resources
                LOGGER.warn("TODO: Cannot uninstall " + installedResource + " as we have no handle!");
            } else {
View Full Code Here

            return repository.addResource(resource).adapt(CompositeData.class);
        }

        @Override
        public CompositeData removeResource(String identity) {
            ResourceIdentity resid = ResourceIdentity.fromString(identity);
            Resource resource = repository.removeResource(resid);
            return resource != null ? resource.adapt(CompositeData.class) : null;
        }
View Full Code Here

            return resource != null ? resource.adapt(CompositeData.class) : null;
        }

        @Override
        public CompositeData getResource(String identity) {
            ResourceIdentity resid = ResourceIdentity.fromString(identity);
            Resource resource = repository.getResource(resid);
            return resource != null ? resource.adapt(CompositeData.class) : null;
        }
View Full Code Here

        // Try to find the providers in the fallback
        if (providers.isEmpty() && getFallbackRepository() != null) {
            providers = new HashSet<Capability>();
            for (Capability cap : getFallbackRepository().findProviders(req)) {
                Resource res = cap.getResource();
                ResourceIdentity resid = res.getIdentity();
                Resource storageResource = repositoryStorage.getResource(resid);
                if (storageResource == null) {
                    storageResource = repositoryStorage.addResource(res);
                    for (Capability aux : storageResource.getCapabilities(req.getNamespace())) {
                        if (cap.getAttributes().equals(aux.getAttributes())) {
View Full Code Here

            return repository.addResource(resource).adapt(CompositeData.class);
        }

        @Override
        public CompositeData removeResource(String identity) {
            ResourceIdentity resid = ResourceIdentity.fromString(identity);
            Resource resource = repository.removeResource(resid);
            return resource != null ? resource.adapt(CompositeData.class) : null;
        }
View Full Code Here

            return resource != null ? resource.adapt(CompositeData.class) : null;
        }

        @Override
        public CompositeData getResource(String identity) {
            ResourceIdentity resid = ResourceIdentity.fromString(identity);
            Resource resource = repository.getResource(resid);
            return resource != null ? resource.adapt(CompositeData.class) : null;
        }
View Full Code Here

TOP

Related Classes of org.jboss.gravia.resource.ResourceIdentity

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.