Package hudson

Examples of hudson.PluginWrapper$Dependency


        // synchronous transactions (instead of an asynchronous ones)
        // => this way, every commit will be processed synchronously !
    ScmSyncConfigurationPlugin scmSyncConfigPluginInstance = new ScmSyncConfigurationPlugin(true);
   
    // Mocking PluginWrapper attached to current ScmSyncConfigurationPlugin instance
    PluginWrapper pluginWrapper = PowerMockito.mock(PluginWrapper.class);
    when(pluginWrapper.getShortName()).thenReturn("scm-sync-configuration");
    // Setting field on current plugin instance
    Field wrapperField = Plugin.class.getDeclaredField("wrapper");
    boolean wrapperFieldAccessibility = wrapperField.isAccessible();
    wrapperField.setAccessible(true);
    wrapperField.set(scmSyncConfigPluginInstance, pluginWrapper);
View Full Code Here


    public PluginWrapper create(final File file) throws Exception {
        checkNotNull(file);
        log.trace("Creating plugin wrapper for: {}", file);

        PluginWrapper plugin = delegate.createPluginWrapper(file);

        // Attach the plugin to the class-loader
        PluginClassLoader cl = (PluginClassLoader) plugin.classLoader;
        cl.setPlugin(plugin);
View Full Code Here

    /**
     * Load the plugins wrapper and inject it with the {@link SmoothieContainer}.
     */
    public PluginWrapper createPluginWrapper(final File archive) throws IOException {
        checkNotNull(archive);
        PluginWrapper plugin;
        try {
            plugin = pluginFactory.create(archive);
        }
        catch (Exception e) {
            throw new IOException2(e);
View Full Code Here

         * see if the installed version is older than the compatible-since version. If it is older, it'll return false.
         * If it's not older, or it's not installed, or it's installed but there's no compatibleSinceVersion
         * specified, it'll return true.
         */
        public boolean isCompatibleWithInstalledVersion() {
            PluginWrapper installedVersion = getInstalled();
            if (installedVersion != null) {
                if (compatibleSinceVersion != null) {
                    if (new VersionNumber(installedVersion.getVersion())
                            .isOlderThan(new VersionNumber(compatibleSinceVersion))) {
                        return false;
                    }
                }
            }
View Full Code Here

            for(Map.Entry<String,String> e : dependencies.entrySet()) {
                Plugin depPlugin = Hudson.getInstance().getUpdateCenter().getPlugin(e.getKey());
                VersionNumber requiredVersion = new VersionNumber(e.getValue());
               
                // Is the plugin installed already? If not, add it.
                PluginWrapper current = depPlugin.getInstalled();

                if (current ==null) {
                    deps.add(depPlugin);
                }
                // If the dependency plugin is installed, is the version we depend on newer than
                // what's installed? If so, upgrade.
                else if (current.isOlderThan(requiredVersion)) {
                    deps.add(depPlugin);
                }
            }

            return deps;
View Full Code Here

        @Override
        public void _run() throws IOException {
            super._run();

            // if this is a bundled plugin, make sure it won't get overwritten
            PluginWrapper pw = plugin.getInstalled();
            if (pw!=null && pw.isBundled())
                try {
                    SecurityContextHolder.getContext().setAuthentication(ACL.SYSTEM);
                    pw.doPin();
                } finally {
                    SecurityContextHolder.clearContext();
                }
        }
View Full Code Here

     * <p>
     * This allows URL <tt>hudson/plugin/ID</tt> to be served by the views
     * of the plugin class.
     */
    public Plugin getPlugin(String shortName) {
        PluginWrapper p = pluginManager.getPlugin(shortName);
        if (p == null) {
            return null;
        }
        return p.getPlugin();
    }
View Full Code Here

     *
     * @return The plugin instance.
     */
    @SuppressWarnings("unchecked")
    public <P extends Plugin> P getPlugin(Class<P> clazz) {
        PluginWrapper p = pluginManager.getPlugin(clazz);
        if (p == null) {
            return null;
        }
        return (P) p.getPlugin();
    }
View Full Code Here

                Connector15DCBRoot root = (Connector15DCBRoot) config.getDConfigBeanRoot(ddBeanRoot);
                ConnectorDCB connector = (ConnectorDCB) root.getDConfigBean(ddBeanRoot.getChildBean(root.getXpaths()[0])[0]);
                connector.setConfigID("user/database-pool-"+data.getName() + "/1/car");
                // Use a parentId of null to pick up the default
                if(data.jar1 != null && !data.jar1.equals("")) {
                    Dependency dep = new Dependency();
                    connector.setDependency(new Dependency[]{dep});
                    dep.setURI(data.jar1);
                }
                if(data.jar2 != null && !data.jar2.equals("")) {
                    Dependency dep = new Dependency();
                    Dependency[] old = connector.getDependency();
                    Dependency[] longer = new Dependency[old.length+1];
                    System.arraycopy(old, 0, longer, 0, old.length);
                    longer[old.length] = dep;
                    connector.setDependency(longer);
                    dep.setURI(data.jar2);
                }
                if(data.jar3 != null && !data.jar3.equals("")) {
                    Dependency dep = new Dependency();
                    Dependency[] old = connector.getDependency();
                    Dependency[] longer = new Dependency[old.length+1];
                    System.arraycopy(old, 0, longer, 0, old.length);
                    longer[old.length] = dep;
                    connector.setDependency(longer);
                    dep.setURI(data.jar3);
                }
                ResourceAdapter adapter = connector.getResourceAdapter()[0];
                ConnectionDefinition definition = new ConnectionDefinition();
                adapter.setConnectionDefinition(new ConnectionDefinition[]{definition});
                definition.setConnectionFactoryInterface("javax.sql.DataSource");
View Full Code Here

TOP

Related Classes of hudson.PluginWrapper$Dependency

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.