Package org.jboss.gravia.repository

Examples of org.jboss.gravia.repository.RepositoryStorage


        };

        DefaultMavenIdentityRepository mavenRepo = new DefaultMavenIdentityRepository(propertyProvider);
        repository = new DefaultPersistentRepository(propertyProvider, new RepositoryAggregator(mavenRepo));

        RepositoryStorage storage = repository.adapt(RepositoryStorage.class);

        // Install gravia features to the repository
        ModuleClassLoader classLoader = Module.getCallerModule().getClassLoader();
        Iterator<Resource> itres = classLoader.iterateResources("META-INF/repository-content", false);
        while(itres.hasNext()) {
            Resource res = itres.next();
            try {
                InputStream input = res.openStream();
                RepositoryReader reader = new DefaultRepositoryXMLReader(input);
                org.jboss.gravia.resource.Resource auxres = reader.nextResource();
                while (auxres != null) {
                    if (storage.getResource(auxres.getIdentity()) == null) {
                        storage.addResource(auxres);
                    }
                    auxres = reader.nextResource();
                }
            } catch (IOException e) {
                throw new IllegalStateException("Cannot install feature to repository: " + res.getName());
View Full Code Here


    @Override
    public Collection<Capability> findProviders(Requirement req) {
        IllegalArgumentAssertion.assertNotNull(req, "req");

        // Try to find the providers in the storage
        RepositoryStorage repositoryStorage = getRequiredRepositoryStorage();
        Collection<Capability> providers = repositoryStorage.findProviders(req);

        // 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())) {
                            cap = aux;
                            break;
                        }
View Full Code Here

    @Override
    public Collection<Capability> findProviders(Requirement req) {
        IllegalArgumentAssertion.assertNotNull(req, "req");

        // Try to find the providers in the storage
        RepositoryStorage repositoryStorage = getRequiredRepositoryStorage();
        Collection<Capability> providers = repositoryStorage.findProviders(req);

        // 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())) {
                            cap = aux;
                            break;
                        }
View Full Code Here

    @Override
    public Collection<Capability> findProviders(Requirement req) {
        NotNullException.assertValue(req, "req");

        // Try to find the providers in the storage
        RepositoryStorage repositoryStorage = getRequiredRepositoryStorage();
        Collection<Capability> providers = repositoryStorage.findProviders(req);

        // 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())) {
                            cap = aux;
                            break;
                        }
View Full Code Here

    @Override
    public Collection<Capability> findProviders(Requirement req) {
        IllegalArgumentAssertion.assertNotNull(req, "req");

        // Try to find the providers in the storage
        RepositoryStorage repositoryStorage = getRequiredRepositoryStorage();
        Collection<Capability> providers = repositoryStorage.findProviders(req);

        // 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())) {
                            cap = aux;
                            break;
                        }
View Full Code Here

TOP

Related Classes of org.jboss.gravia.repository.RepositoryStorage

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.