Package org.jboss.gravia.provision

Examples of org.jboss.gravia.provision.DefaultResourceHandle


        IOUtils.copyStream(content.getContent(), new FileOutputStream(targetFile));

        Module module = installSharedResource(resource, targetFile);
        Resource modres = module.adapt(Resource.class);

        return new DefaultResourceHandle(modres, module) {
            @Override
            public void uninstall() {
                // cannot uninstall shared resource
            }
        };
View Full Code Here


        // Get the resource as module (may be null)
        Runtime runtime = RuntimeLocator.getRequiredRuntime();
        Module module = runtime.getModule(identity);

        return new DefaultResourceHandle(resource, module) {
            @Override
            public void uninstall() {
                UndeployTask task = new UndeployTask();
                task.setUsername(user.getName());
                task.setPassword(password);
View Full Code Here

    private ResourceHandle installResourceInternal(Resource res, Map<Requirement, Resource> mapping) throws ProvisionException {

        RepositoryContent content = res.adapt(RepositoryContent.class);
        if (content == null) {
            return new DefaultResourceHandle(res);
        }

        final String runtimeName = res.getIdentity().getSymbolicName();
        final ServerDeploymentHelper serverDeployer = new ServerDeploymentHelper(serverDeploymentManager);
        try {
            InputStream input = getWrappedResourceContent(res, mapping);
            serverDeployer.deploy(runtimeName, input);
        } catch (Throwable th) {
            throw new ProvisionException("Cannot provision resource: " + res, th);
        }

        return new DefaultResourceHandle(res) {

            @Override
            public void uninstall() throws ProvisionException {
                try {
                    serverDeployer.undeploy(runtimeName);
View Full Code Here

TOP

Related Classes of org.jboss.gravia.provision.DefaultResourceHandle

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.