Package org.apache.axis2.deployment.repository.util

Examples of org.apache.axis2.deployment.repository.util.ArchiveFileData


     */
    public AxisService buildService(AxisService axisService,
                                    InputStream serviceInputStream,
                                    ClassLoader classLoader, AxisConfiguration axisConfig) throws DeploymentException {
        try {
            currentArchiveFile = new ArchiveFileData(SERVICE, "");
            currentArchiveFile.setClassLoader(classLoader);

            ServiceBuilder builder = new ServiceBuilder(serviceInputStream, axisConfig, axisService);
            builder.populateService(builder.buildOM());
            Utils.loadServiceProperties(axisService);
View Full Code Here


    public ModuleDescription buildModule(File modulearchive, AxisConfiguration config) throws DeploymentException {
        ModuleDescription axismodule;
        try {
            this.setPhasesinfo(config.getPhasesinfo());
            currentArchiveFile = new ArchiveFileData(modulearchive, MODULE);
            axismodule = new ModuleDescription();
            axismodule.setModuleClassLoader(currentArchiveFile.getClassLoader());
            ArchiveReader archiveReader = new ArchiveReader();
            ClassLoader moduleClassLoader = config.getModuleClassLoader();
            currentArchiveFile.setClassLoader(false, moduleClassLoader);
View Full Code Here

                    InputStream fin = moduleClassLoader.getResourceAsStream("aars/" + servicename);
                    if (fin == null) {
                        throw new AxisFault("No service archiev found : " + servicename);
                    }
                    File inputFile = Utils.createTempFile(servicename, fin);
                    ArchiveFileData filedata = new ArchiveFileData(inputFile, DeploymentConstants.TYPE_SERVICE, false);

                    filedata.setClassLoader(false,
                            moduleClassLoader);
                    HashMap wsdlservice = archiveReader.processWSDLs(filedata);
                    if (wsdlservice != null && wsdlservice.size() > 0) {
                        Iterator servicesitr = wsdlservice.values().iterator();
                        while (servicesitr.hasNext()) {
                            AxisService service = (AxisService) servicesitr.next();
                            Iterator operations = service.getOperations();
                            while (operations.hasNext()) {
                                AxisOperation axisOperation = (AxisOperation) operations.next();
                                phasesInfo.setOperationPhases(axisOperation);
                            }
                        }
                    }
                    AxisServiceGroup serviceGroup = new AxisServiceGroup(axisConfig);
                    serviceGroup.setServiceGroupClassLoader(
                            filedata.getClassLoader());
                    ArrayList serviceList = archiveReader.processServiceGroup(
                            filedata.getAbsolutePath(), filedata,
                            serviceGroup, false, wsdlservice,
                            configCtx);
                    for (int j = 0; j < serviceList.size(); j++) {
                        AxisService axisService = (AxisService) serviceList.get(j);
                        serviceGroup.addService(axisService);
View Full Code Here

    }

    public void doDeploy() {
        if (wsToDeploy.size() > 0) {
            for (int i = 0; i < wsToDeploy.size(); i++) {
                ArchiveFileData currentArchiveFile = (ArchiveFileData) wsToDeploy.get(i);
                boolean explodedDir = currentArchiveFile.getFile().isDirectory();
                int type = currentArchiveFile.getType();
                try {
                    ArchiveReader archiveReader;
                    StringWriter errorWriter = new StringWriter();
                    switch (type) {
                        case TYPE_SERVICE :
                            currentArchiveFile.setClassLoader(explodedDir,
                                    axisConfig.getServiceClassLoader());
                            archiveReader = new ArchiveReader();
                            String serviceStatus = "";
                            try {
                                HashMap wsdlservice = archiveReader.processWSDLs(currentArchiveFile);
                                if (wsdlservice != null && wsdlservice.size() > 0) {
                                    Iterator services = wsdlservice.values().iterator();
                                    while (services.hasNext()) {
                                        AxisService service = (AxisService) services.next();
                                        Iterator operations = service.getOperations();
                                        while (operations.hasNext()) {
                                            AxisOperation axisOperation = (AxisOperation) operations.next();
                                            axisConfig.getPhasesInfo().setOperationPhases(axisOperation);
                                        }
                                    }
                                }
                                AxisServiceGroup sericeGroup = new AxisServiceGroup(axisConfig);
                                sericeGroup.setServiceGroupClassLoader(
                                        currentArchiveFile.getClassLoader());
                                ArrayList serviceList = archiveReader.processServiceGroup(
                                        currentArchiveFile.getAbsolutePath(), currentArchiveFile,
                                        sericeGroup, explodedDir, wsdlservice,
                                        configContext);
                                addServiceGroup(sericeGroup, serviceList, currentArchiveFile.getFile().toURL(), currentArchiveFile);
                                log.info(Messages.getMessage(DeploymentErrorMsgs.DEPLOYING_WS,
                                        currentArchiveFile.getName()));
                            } catch (DeploymentException de) {
                                de.printStackTrace();
                                log.error(Messages.getMessage(DeploymentErrorMsgs.INVALID_SERVICE,
                                        currentArchiveFile.getName(),
                                        de.getMessage()),
                                        de);
                                PrintWriter error_ptintWriter = new PrintWriter(errorWriter);
                                de.printStackTrace(error_ptintWriter);
                                serviceStatus = "Error:\n" + errorWriter.toString();
                            } catch (AxisFault axisFault) {
                                log.error(Messages.getMessage(DeploymentErrorMsgs.INVALID_SERVICE,
                                        currentArchiveFile.getName(),
                                        axisFault.getMessage()),
                                        axisFault);
                                PrintWriter error_ptintWriter = new PrintWriter(errorWriter);
                                axisFault.printStackTrace(error_ptintWriter);
                                serviceStatus = "Error:\n" + errorWriter.toString();
                            } catch (Exception e) {
                                if (log.isInfoEnabled()) {
                                    StringWriter sw = new StringWriter();
                                    PrintWriter pw = new PrintWriter(sw);
                                    e.printStackTrace(pw);
                                    log.info(Messages.getMessage(
                                            DeploymentErrorMsgs.INVALID_SERVICE,
                                            currentArchiveFile.getName(),
                                            sw.getBuffer().toString()));
                                }
                                PrintWriter error_ptintWriter = new PrintWriter(errorWriter);
                                e.printStackTrace(error_ptintWriter);
                                serviceStatus = "Error:\n" + errorWriter.toString();
                            } catch (Throwable t) {
                                if (log.isInfoEnabled()) {
                                    StringWriter sw = new StringWriter();
                                    PrintWriter pw = new PrintWriter(sw);
                                    t.printStackTrace(pw);
                                    log.info(Messages.getMessage(
                                            DeploymentErrorMsgs.INVALID_SERVICE,
                                            currentArchiveFile.getName(),
                                            sw.getBuffer().toString()));
                                }
                                PrintWriter error_ptintWriter = new PrintWriter(errorWriter);
                                t.printStackTrace(error_ptintWriter);
                                serviceStatus = "Error:\n" + errorWriter.toString();
                            } finally {
                                if (serviceStatus.startsWith("Error:")) {
                                    axisConfig.getFaultyServices().put(currentArchiveFile.getFile().getAbsolutePath(),
                                            serviceStatus);
                                }
                                currentArchiveFile = null;
                            }
                            break;
                        case TYPE_MODULE :
                            currentArchiveFile.setClassLoader(explodedDir,
                                    axisConfig.getModuleClassLoader());
                            archiveReader = new ArchiveReader();
                            String moduleStatus = "";
                            try {
                                AxisModule metaData = new AxisModule();
                                metaData.setModuleClassLoader(currentArchiveFile.getClassLoader());
                                metaData.setParent(axisConfig);
                                archiveReader.readModuleArchive(currentArchiveFile, metaData, explodedDir,
                                        axisConfig);
                                metaData.setFileName(currentArchiveFile.getFile().toURL());
                                addNewModule(metaData);
                                log.info(Messages.getMessage(DeploymentErrorMsgs.DEPLOYING_MODULE,
                                        metaData.getName().getLocalPart()));
                            } catch (DeploymentException e) {
                                log.error(Messages.getMessage(DeploymentErrorMsgs.INVALID_MODULE,
                                        currentArchiveFile.getName(),
                                        e.getMessage()),
                                        e);
                                PrintWriter error_ptintWriter = new PrintWriter(errorWriter);
                                e.printStackTrace(error_ptintWriter);
                                moduleStatus = "Error:\n" + errorWriter.toString();
                            } catch (AxisFault axisFault) {
                                log.error(Messages.getMessage(DeploymentErrorMsgs.INVALID_MODULE,
                                        currentArchiveFile.getName(),
                                        axisFault.getMessage()),
                                        axisFault);
                                PrintWriter error_ptintWriter = new PrintWriter(errorWriter);
                                axisFault.printStackTrace(error_ptintWriter);
                                moduleStatus = "Error:\n" + errorWriter.toString();
                            } catch (MalformedURLException e) {
                                log.error(Messages.getMessage(DeploymentErrorMsgs.INVALID_MODULE,
                                        currentArchiveFile.getName(),
                                        e.getMessage()),
                                        e);
                                PrintWriter error_ptintWriter = new PrintWriter(errorWriter);
                                e.printStackTrace(error_ptintWriter);
                                moduleStatus = "Error:\n" + errorWriter.toString();
                            } catch (Throwable t) {
                                if (log.isInfoEnabled()) {
                                    StringWriter sw = new StringWriter();
                                    PrintWriter pw = new PrintWriter(sw);
                                    t.printStackTrace(pw);
                                    log.error(Messages.getMessage(DeploymentErrorMsgs.INVALID_MODULE,
                                            currentArchiveFile.getName(),
                                            t.getMessage()),
                                            t);
                                }
                                PrintWriter error_ptintWriter = new PrintWriter(errorWriter);
                                t.printStackTrace(error_ptintWriter);
                                moduleStatus = "Error:\n" + errorWriter.toString();
                            } finally {
                                if (moduleStatus.startsWith("Error:")) {
                                    axisConfig.getFaultyModules().put(
                                            getAxisServiceName(currentArchiveFile.getName()), moduleStatus);
                                }
                                currentArchiveFile = null;
                            }
                            break;
                    }
View Full Code Here

    public static AxisModule buildModule(File modulearchive,
                                         AxisConfiguration config)
            throws DeploymentException {
        AxisModule axismodule;
        try {
            ArchiveFileData currentArchiveFile = new ArchiveFileData(modulearchive,
                    DeploymentConstants.TYPE_MODULE, false);
            axismodule = new AxisModule();
            ArchiveReader archiveReader = new ArchiveReader();

            currentArchiveFile.setClassLoader(false, config.getModuleClassLoader());
            axismodule.setModuleClassLoader(currentArchiveFile.getClassLoader());
            archiveReader.readModuleArchive(currentArchiveFile, axismodule,
                    false, config);
            ClassLoader moduleClassLoader = axismodule.getModuleClassLoader();
            Flow inflow = axismodule.getInFlow();
View Full Code Here

                if ("false".equalsIgnoreCase(value)) {
                    antiJARLocking = false;
                }
            }
            ArchiveFileData currentArchiveFile = new ArchiveFileData(
                    DeploymentConstants.TYPE_SERVICE, "", antiJARLocking);
            currentArchiveFile.setClassLoader(classLoader);

            ServiceBuilder builder = new ServiceBuilder(serviceInputStream, configCtx,
                    axisService);

            builder.populateService(builder.buildOM());
View Full Code Here

                                                     ClassLoader classLoader,
                                                     String serviceGroupName,
                                                     ConfigurationContext configCtx,
                                                     ArchiveReader archiveReader,
                                                     HashMap wsdlServices) throws AxisFault {
        ArchiveFileData currentArchiveFile = new ArchiveFileData(
                DeploymentConstants.TYPE_SERVICE, "", false);
        currentArchiveFile.setClassLoader(classLoader);
        AxisServiceGroup serviceGroup = new AxisServiceGroup();
        serviceGroup.setServiceGroupClassLoader(classLoader);
        serviceGroup.setServiceGroupName(serviceGroupName);
        AxisConfiguration axisConfig = configCtx.getAxisConfiguration();
        try {
View Full Code Here

     * @return
     * @throws DeploymentException
     */
    public ServiceDescription buildService(ServiceDescription axisService, InputStream serviceInputStream, ClassLoader classLoader) throws DeploymentException {
        try {
            currentArchiveFile = new ArchiveFileData(SERVICE, "");
            currentArchiveFile.setClassLoader(classLoader);
            DeploymentParser schme = new DeploymentParser(serviceInputStream, this);
            schme.parseServiceXML(axisService);
            loadServiceProperties(axisService);
            axisConfig.addService(axisService);
View Full Code Here

     */

    public ModuleDescription buildModule(File modulearchive) throws DeploymentException {
        ModuleDescription axismodule = null;
        try {
            currentArchiveFile = new ArchiveFileData(modulearchive, MODULE);
            axismodule = new ModuleDescription();
            ArchiveReader archiveReader = new ArchiveReader();
            archiveReader.readModuleArchive(currentArchiveFile.getAbsolutePath(), this, axismodule);
            currentArchiveFile.setClassLoader();
            Flow inflow = axismodule.getInFlow();
View Full Code Here

     */
    public ServiceDescription buildService(ServiceDescription axisService,
                                           InputStream serviceInputStream,
                                           ClassLoader classLoader) throws DeploymentException {
        try {
            currentArchiveFile = new ArchiveFileData(SERVICE, "");
            currentArchiveFile.setClassLoader(classLoader);
            DeploymentParser schme = new DeploymentParser(serviceInputStream,
                    this);
            schme.parseServiceXML(axisService);
            loadServiceProperties(axisService);
View Full Code Here

TOP

Related Classes of org.apache.axis2.deployment.repository.util.ArchiveFileData

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.