Package com.sun.appserv.addons

Examples of com.sun.appserv.addons.AddonFatalException


        //Match any thing that ends with .jar
        if (name.matches(".*"+regex)) {
            return name.split(regex)[0];
        } else {
            throw new AddonFatalException
            (localStrings.getString("addon.notjarfile", name));
        }
    }
View Full Code Here


                    getLogger().info(s);
                }
            } catch (Exception e) {
                getLogger().log(Level.FINE, "Fatal Exception while " +
                "configuring the addon " + addonName, e);
                throw new AddonFatalException (e);
            }
        }
    }
View Full Code Here

                } else if (oldVersion.isLower(newVersion)) {
                    addonStatus = AddonRegistry.status.UNCHANGED;
                }
            }
        } catch (AddonException aoe) {
            throw new AddonFatalException(aoe);
        }

        Configurator conf = Configurator.class.cast(obj);
        InstallationContext ic = new InstallationContext();
        ic.setInstallationDirectory(getInstallRoot());
        ConfigurationContext cc = new ConfigurationContext();
        cc.setInstallationContext(ic);
        cc.setDomainDirectory(getDomainRoot());
        cc.setConfigurationType(type);
        if (type.equals(ConfigurationContext.ConfigurationType.INSTANCE))
            cc.setAMXDomainRoot(getAMXDomainRoot());
        setAdminCredentials(cc);
        try {
            switch (addonStatus) {
                case CONFIGURE :
                    checkDependencies(addonName);
                    conf.configure(cc);
                    ar.setStatus(addonName, AddonRegistry.status.CONFIGURE);
                    ar.setStatus(addonName, AddonRegistry.status.ENABLE);
                    break;
                case ENABLE :
                    conf.enable(cc);
                    ar.setStatus(addonName, AddonRegistry.status.ENABLE);
                    break;
                case DISABLE :
                    conf.disable(cc);
                    ar.setStatus(addonName, AddonRegistry.status.DISABLE);
                    break;
                case UNCONFIGURE :
                    conf.unconfigure(cc);
                    ar.setStatus(addonName, AddonRegistry.status.UNCONFIGURE);
                    break;
                case UPGRADE :
                    ar.setStatus(oldVersion.getName(), AddonRegistry.status.REMOVE);
                    conf.upgrade(cc, oldVersion);
                    ar.setStatus(addonName, AddonRegistry.status.CONFIGURE);
                    ar.setStatus(addonName, AddonRegistry.status.ENABLE);
                    // move old component to .deleted directory
                    break;
                default :
            }
            if (getLogger().isLoggable(Level.INFO)) {
                if (! addonStatus.equals(AddonRegistry.status.UNCHANGED)) {
                    String s = localStrings.getString("addon.configurecomplete",
                           addonStatus.toString(), addonName);
                    getLogger().info(s);
                }
            }
        } catch (AddonFatalException afe) {
            getLogger().log(Level.FINE, "Fatal Exception while " +
            "configuring the addon " + addonName, afe);
            throw afe;
        } catch (AddonException ae) {
            getLogger().warning
            (localStrings.getString("addon.configurationcomplete.error",
             addonStatus.toString(), addonName, ae.getLocalizedMessage() ));
        } catch (Exception e) {
            getLogger().log(Level.FINE, "Fatal Exception while " +
            "configuring the addon " + addonName, e);
            throw new AddonFatalException(e);
        }
    }
View Full Code Here

    private void setAMXDomainRoot() throws AddonFatalException {
        try {
            MBeanServer mbs = MBeanServerFactory.getMBeanServer();
            this.amxDomainRoot = ProxyFactory.getInstance(mbs).getDomainRoot();
        } catch (Exception e) {
            throw new AddonFatalException(e);
        }
    }
View Full Code Here

            if (jar == null) return;
            String [] dependencies = AddOnUtils.getDependencies(jar);
            if (dependencies == null) return;
            for (String dependency: dependencies) {
                if (ar.getStatus(dependency).equals(AddonRegistry.status.CONFIGURE)) {
                    throw new AddonFatalException
                    (localStrings.getString("addon.dependency.missing", addonName, dependency));
                }
            }
        } catch (Exception e) {
            throw new AddonFatalException(e);
        }
    }
View Full Code Here

                    (localStrings.getString("addon.unconfigurationcomplete.error",
                     "unconfigure", addonName, ae.getLocalizedMessage() ));
                } catch (Exception e) {
                    getLogger().log(Level.WARNING, "Fatal Exception while " +
                    "unconfiguring the addon " + addonName, e);
                    throw new AddonFatalException(e);
                }
            }
        }
        ar.store();
        ar.close();
View Full Code Here

                 }
            }
        } catch (AddonFatalException afe) {
            throw afe;
        }catch (Exception e) {
            throw new AddonFatalException(e);
        }
    }
View Full Code Here

        URL[] classpath = null;
        try {
            classpath = AddonClassPath.getClassPath(jar,
            getInstallRoot().getCanonicalPath(), getLogger());
        } catch (Exception e) {
            throw new AddonFatalException(e);
        }
        return new URLClassLoader(classpath, this.getClass().getClassLoader());
    }
View Full Code Here

                                    new InputStreamReader(in));
                return br.readLine();
            }
        } catch (Exception e) {
            getLogger().log(Level.FINE, e.getMessage(), e);
            throw new AddonFatalException(e);
        }
        return null;
    }
View Full Code Here

                        return main;
                    }
                }
            }
        } catch (Exception e) {
            throw new AddonFatalException(e);
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of com.sun.appserv.addons.AddonFatalException

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.