Package org.rioproject.impl.opstring

Examples of org.rioproject.impl.opstring.OAR


        files = installDirectory.listFiles();
        for (File file : files) {
            if (file.isDirectory()) {
                try {
                    OAR oar = OARUtil.getOAR(file);
                    if (oar!=null && oar.getActivationType().equals(OAR.AUTOMATIC)) {
                        list.addAll(parseOAR(oar, from));
                    }
                } catch (IOException e) {
                    logger.warn("Loading [" + file.getName() + "]", e);
                } catch (OARException e) {
View Full Code Here


    throws OperationalStringException {
        if(opStringUrl == null)
            throw new IllegalArgumentException("OperationalString URL cannot be null");
        DeploymentResult deploymentResult;
        try {
            OAR oar;
            URL opStringUrlToUse = opStringUrl;
            if(opStringUrl.toExternalForm().endsWith("oar")) {
                oar = new OAR(opStringUrl);
                StringBuilder sb = new StringBuilder();
                sb.append("jar:").append(oar.getURL().toExternalForm()).append("!/").append(oar.getOpStringName());
                opStringUrlToUse = new URL(sb.toString());
            }
            OperationalString[] opStrings = opStringLoader.parseOperationalString(opStringUrlToUse);
            if(opStrings != null && opStrings.length>0) {
                deploymentResult = deploy(opStrings[0], listener);
View Full Code Here

        String opStringName = name;
        logger.info("Undeploying {}", opStringName);
        URL artifactURL = getArtifactURL(name);
        if(artifactURL!=null) {
            try {
                OAR oar = new OAR(artifactURL);
                OperationalString[] opstring = oar.loadOperationalStrings();
                opStringName = opstring[0].getName();
            } catch(Exception e) {
                throw new OperationalStringException(String.format("Unable to undeploy, cannot parse/load [%s]",
                                                                   opStringName));
            }
View Full Code Here

        if(artifact==null)
            throw new IllegalArgumentException("artifact must not be null");
        URL opStringURL = ResolverHelper.getResolver().getLocation(artifact.getGAV(), "oar");
        if(opStringURL==null)
            throw new OperationalStringException("Artifact "+artifact+" not resolvable");
        OAR oar = new OAR(new File(opStringURL.toURI()));
        OperationalString[] opStrings = oar.loadOperationalStrings();
        Map<String, Object> map = new HashMap<String, Object>();

        for(OperationalString ops : opStrings) {
            if(beans!=null && beans.length>0)
                map.putAll(activate(ops, beans));
View Full Code Here

                        lastDir = chooser.getCurrentDirectory();
                        final ServiceItem item = monitorCache.lookup(null);
                        final OperationalString[] opstrings;
                        try {
                            if (opStringFile.getName().endsWith("oar")) {
                                OAR oar = new OAR(opStringFile);
                                opstrings = oar.loadOperationalStrings();
                                // TODO: embed webster and stream the OAR
                            } else {
                                opstrings = parseOperationalString(opStringFile);
                            }
                        } catch (Exception e) {
View Full Code Here

        if (opString.loadedFrom() != null &&
            opString.loadedFrom().toExternalForm().startsWith("file") &&
            opString.loadedFrom().toExternalForm().endsWith(".oar")) {
            File f = new File(opString.loadedFrom().getFile());
            try {
                oar = new OAR(f);
                oar.setDeployDir(f.getParent());
            } catch (Exception e) {
                logger.warn("Could no create OAR", e);
            }
        }
View Full Code Here

                if(!isArtifact) {
                    try {
                        oarUrl = new URL(deployName);
                    } catch(MalformedURLException e) {
                        File oarFile = getDeploymentFile(deployName);
                        OAR oar = new OAR(oarFile);
                        embeddedWebster = new Webster(0, oarFile.getParentFile().getAbsolutePath());
                        toDeploy = oar.loadOperationalStrings()[0];
                        oarUrl = new URL("http://"+embeddedWebster.getAddress()+":"+embeddedWebster.getPort()+"/"+oarFile.getName());
                    }
                    System.out.println("===> "+oarUrl);
                }
            } catch (Exception e) {
View Full Code Here

                /* */
            }
            if (deployment.endsWith("oar")) {
                try {
                    File oarFile = getDeploymentFile(deployment);
                    OAR oar = new OAR(oarFile);
                    OperationalString toUndeploy = oar.loadOperationalStrings()[0];
                    undeployName = toUndeploy.getName();
                } catch (Exception e) {
                    return ("Problem loading [" + deployment + "], " +
                            "Exception : " + e.getLocalizedMessage() + "\n");
                }
View Full Code Here

TOP

Related Classes of org.rioproject.impl.opstring.OAR

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.