Package org.servicemix.jbi.deployment

Examples of org.servicemix.jbi.deployment.Descriptor


    public synchronized ObjectName loadNewInstaller(String installJarURL) {
        ObjectName result = null;
        try {
            File tmpDir = AutoDeploymentService.unpackLocation(environmentContext.getTmpDir(), installJarURL);
            if (tmpDir != null) {
                Descriptor root = AutoDeploymentService.buildDescriptor(tmpDir);
                if (root != null && root.getComponent() != null) {
                    String componentName = root.getComponent().getIdentification().getName();
                    if (!installers.containsKey(componentName)) {
                        InstallerMBeanImpl installer = doInstallArchive(tmpDir, root);
                        if (installer != null) {
                            result = installer.getObjectName();
                            installers.put(componentName, installer);
View Full Code Here


    public String installSharedLibrary(String aSharedLibURI) {
        String result = "";
        try {
            File tmpDir = AutoDeploymentService.unpackLocation(environmentContext.getTmpDir(), aSharedLibURI);
            if (tmpDir != null) {
                Descriptor root = AutoDeploymentService.buildDescriptor(tmpDir);
                SharedLibrary sl = root.getSharedLibrary();
                if (sl != null) {
                    result = doInstallSharedLibrary(tmpDir, sl);
                }
            }
            else {
View Full Code Here

     * @throws DeploymentException
     */
    public void install(String location, boolean autoStart) throws DeploymentException {
        File tmpDir = AutoDeploymentService.unpackLocation(environmentContext.getTmpDir(), location);
        if (tmpDir != null) {
            Descriptor root = AutoDeploymentService.buildDescriptor(tmpDir);
            if (root != null) {
                install(tmpDir, root, autoStart);
            }
            else {
                log.error("Could not find Descriptor from: " + location);
View Full Code Here

            // directory structure is sharedlibraries/<lib name>stuff ...
            File[] files = top.listFiles();
            if (files != null) {
                for (int i = 0;i < files.length;i++) {
                    if (files[i].isDirectory()) {
                        Descriptor root = AutoDeploymentService.buildDescriptor(files[i]);
                        if (root != null) {
                            SharedLibrary sl = root.getSharedLibrary();
                            if (sl != null) {
                                try {
                                    classLoaderService.addSharedLibrary(files[i], sl);
                                }
                                catch (MalformedURLException e) {
View Full Code Here

    }

    protected void buildComponent(File componentDirectory) throws DeploymentException{
        try{
            File installationDirectory = environmentContext.getInstallationDirectory(componentDirectory.getName());
            Descriptor root = AutoDeploymentService.buildDescriptor(installationDirectory);
            if(root != null){
                Component desc = root.getComponent();
                if(desc != null){
                    String componentName = desc.getIdentification().getName();
                    if(!installers.containsKey(componentName)){
                        InstallerMBean installer = initializeInstaller(installationDirectory,desc);
                        if(installer != null){
View Full Code Here

     * @throws Exception if complete deployment fails.
     */
    public String deploy(String saZipURL) throws Exception {
        String result = null;
        File tmpDir = AutoDeploymentService.unpackLocation(environmentContext.getTmpDir(), saZipURL);
        Descriptor root = AutoDeploymentService.buildDescriptor(tmpDir);
        ServiceAssembly sa = root.getServiceAssembly();
        if (sa != null) {
            result = deploy(tmpDir, sa);
        }
        else {
            throw new DeploymentException("Not an assembly: " + saZipURL);
View Full Code Here

        if (top.exists() && top.isDirectory()) {
            File[] files = top.listFiles();
            if (files != null) {
                for (int i = 0;i < files.length;i++) {
                    if (files[i].isDirectory()) {
                        Descriptor root = AutoDeploymentService.buildDescriptor(files[i]);
                        if (root != null) {
                            ServiceAssembly sa = root.getServiceAssembly();
                            if (sa != null && sa.getIdentification() != null) {
                                String name = sa.getIdentification().getName();
                                try {
                                    initSA(sa);
                                    sa.setState(DeploymentServiceMBean.STARTED);
View Full Code Here

     * @param autoStart
     * @throws DeploymentException
     */
    public void updateArchive(String location, boolean autoStart) throws DeploymentException {
        File tmp = AutoDeploymentService.unpackLocation(environmentContext.getTmpDir(), location);
        Descriptor root = AutoDeploymentService.buildDescriptor(tmp);
        if (root != null) {
            try {
                container.getBroker().suspend();
                if (root.getComponent() != null) {
                    String componentName = root.getComponent().getIdentification().getName();
                    log.info("Uninstalling Component: " + componentName);
                    if (installationService.unloadInstaller(componentName, true)) {
                    }
                    installationService.install(tmp, root, autoStart);
                    autoDeployServiceSA(componentName);
                }
                else if (root.getSharedLibrary() != null) {
                    installationService.doInstallSharedLibrary(tmp, root.getSharedLibrary());
                }
                else if (root.getServiceAssembly() != null) {
                    ServiceAssembly sa = root.getServiceAssembly();
                    String name = sa.getIdentification().getName();
                    try {
                        if (deploymentService.isSaDeployed(name)) {
                            deploymentService.shutDown(name);
                            deploymentService.undeploy(name);
View Full Code Here

     */
    private void autoDeployServiceSA(String componentName) {
        File tmpDir = (File) pendingSAs.remove(componentName);
        if (tmpDir != null) {
            try {
                Descriptor root = AutoDeploymentService.buildDescriptor(tmpDir);
                if (root != null) {
                    ServiceAssembly sa = root.getServiceAssembly();
                    if (sa != null && sa.getIdentification() != null) {
                        String name = sa.getIdentification().getName();
                        log.info("auto deploying Service Assembly: " + name);
                        if (!deploymentService.isSaDeployed(name)) {
                            deploymentService.deploy(tmpDir, sa);
View Full Code Here

    }

    private void autoRemoveSAs(String componentName) {
        for (Iterator i = descriptorMap.entrySet().iterator();i.hasNext();) {
            Map.Entry entry = (Map.Entry) i.next();
            Descriptor root = (Descriptor) entry.getValue();
            if (root != null && root.getServiceAssembly() != null) {
                ServiceAssembly sa = root.getServiceAssembly();
                String name = sa.getIdentification().getName();
                if (deploymentService.isSaDeployed(name)) {
                    // remove
                    try {
                        deploymentService.shutDown(name);
View Full Code Here

TOP

Related Classes of org.servicemix.jbi.deployment.Descriptor

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.