Package org.jboss.gravia.repository

Examples of org.jboss.gravia.repository.RepositoryMBean


    protected Set<ResourceIdentity> addRepositoryContent(ManagedContext context, URL resurl) throws IOException {
        IllegalArgumentAssertion.assertNotNull(context, "context");
        Set<ResourceIdentity> result = new HashSet<>();
        if (resurl != null) {
            InputStream input = resurl.openStream();
            RepositoryMBean repository = MBeanProxy.get(context.getMBeanServer(), RepositoryMBean.OBJECT_NAME, RepositoryMBean.class);
            try {
                RepositoryReader reader = new DefaultRepositoryXMLReader(input);
                Resource auxres = reader.nextResource();
                while (auxres != null) {
                    ResourceIdentity identity = auxres.getIdentity();
                    if (repository.getResource(identity.getCanonicalForm()) == null) {
                        repository.addResource(auxres.adapt(CompositeData.class));
                        result.add(identity);
                    }
                    auxres = reader.nextResource();
                }
            } finally {
View Full Code Here


    }

    protected void removeRepositoryContent(ManagedContext context, Set<ResourceIdentity> identities) throws IOException {
        IllegalArgumentAssertion.assertNotNull(context, "context");
        if (identities != null) {
            RepositoryMBean repository = MBeanProxy.get(context.getMBeanServer(), RepositoryMBean.OBJECT_NAME, RepositoryMBean.class);
            for (ResourceIdentity resid : identities) {
                repository.removeResource(resid.getCanonicalForm());
            }
        }
    }
View Full Code Here

        // Provide {@link MBeanServerConnection} and {@link RepositoryMBean}
        MBeanServerConnection mbeanServer = getMBeanServerConnection(container);
        if (mbeanServer != null) {
            mbeanServerInstance.set(mbeanServer);
            if (mbeanServer.isRegistered(RepositoryMBean.OBJECT_NAME)) {
                RepositoryMBean repository = MBeanProxy.get(mbeanServer, RepositoryMBean.OBJECT_NAME, RepositoryMBean.class);
                repositoryInstance.set(repository);
            }
        }
    }
View Full Code Here

        // Provide {@link MBeanServerConnection} and {@link RepositoryMBean}
        MBeanServerConnection mbeanServer = getMBeanServerConnection(container);
        if (mbeanServer != null) {
            mbeanServerInstance.set(mbeanServer);
            if (mbeanServer.isRegistered(RepositoryMBean.OBJECT_NAME)) {
                RepositoryMBean repository = MBeanProxy.get(mbeanServer, RepositoryMBean.OBJECT_NAME, RepositoryMBean.class);
                repositoryInstance.set(repository);
            }
        }
    }
View Full Code Here

*/
public abstract class ContainerSetupTask {

    protected void setUp(MBeanServerConnection server, Map<String, String> props) throws Exception {
        if (server != null && server.isRegistered(RepositoryMBean.OBJECT_NAME)) {
            RepositoryMBean repository = MBeanProxy.get(server, RepositoryMBean.OBJECT_NAME, RepositoryMBean.class);
            setupRepositoryContent(server, repository, props);
        }
    }
View Full Code Here

        }
    }

    protected void tearDown(MBeanServerConnection server, Map<String, String> props) throws Exception {
        if (server != null && server.isRegistered(RepositoryMBean.OBJECT_NAME)) {
            RepositoryMBean repository = MBeanProxy.get(server, RepositoryMBean.OBJECT_NAME, RepositoryMBean.class);
            removeRepositoryContent(server, repository, props);
        }
    }
View Full Code Here

        // Provide {@link MBeanServerConnection} and {@link RepositoryMBean}
        MBeanServerConnection mbeanServer = getMBeanServerConnection(container);
        if (mbeanServer != null) {
            mbeanServerInstance.set(mbeanServer);
            if (mbeanServer.isRegistered(RepositoryMBean.OBJECT_NAME)) {
                RepositoryMBean repository = MBeanProxy.get(mbeanServer, RepositoryMBean.OBJECT_NAME, RepositoryMBean.class);
                repositoryInstance.set(repository);
            }
        }
    }
View Full Code Here

    protected Set<ResourceIdentity> addRepositoryContent(Context context, URL resurl) throws IOException {
        IllegalArgumentAssertion.assertNotNull(context, "context");
        Set<ResourceIdentity> result = new HashSet<>();
        if (resurl != null) {
            InputStream input = resurl.openStream();
            RepositoryMBean repository = MBeanProxy.get(context.getMBeanServer(), RepositoryMBean.OBJECT_NAME, RepositoryMBean.class);
            try {
                RepositoryReader reader = new DefaultRepositoryXMLReader(input);
                Resource auxres = reader.nextResource();
                while (auxres != null) {
                    ResourceIdentity identity = auxres.getIdentity();
                    if (repository.getResource(identity.getCanonicalForm()) == null) {
                        repository.addResource(auxres.adapt(CompositeData.class));
                        result.add(identity);
                    }
                    auxres = reader.nextResource();
                }
            } finally {
View Full Code Here

    }

    protected void removeRepositoryContent(Context context, Set<ResourceIdentity> identities) throws IOException {
        IllegalArgumentAssertion.assertNotNull(context, "context");
        if (identities != null) {
            RepositoryMBean repository = MBeanProxy.get(context.getMBeanServer(), RepositoryMBean.OBJECT_NAME, RepositoryMBean.class);
            for (ResourceIdentity resid : identities) {
                repository.removeResource(resid.getCanonicalForm());
            }
        }
    }
View Full Code Here

TOP

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

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.