KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > autoupdate > AutoupdateClusterCreator


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.autoupdate;
21
22 import java.io.File JavaDoc;
23 import java.io.IOException JavaDoc;
24
25 /** Class that is supposed to be implemented by application
26  * providers that can control launcher in order to modify
27  * the list of provided clusters.
28  *
29  * @since 2.22
30  * @author Jaroslav Tulach
31  */

32 public abstract class AutoupdateClusterCreator extends Object JavaDoc {
33     /** Finds the right cluster directory for given cluster name.
34      * This method can return null if no such cluster name is known or
35      * understandable, otherwise it returns a file object representing
36      * <b>not existing</b> directory that will be created later
37      * to host hold the content of the cluster.
38      *
39      * @param clusterName the name of the cluster the autoupdate client is searching for
40      * @return null or File object of the cluster to be created
41      */

42     protected abstract File JavaDoc findCluster(String JavaDoc clusterName);
43     
44     /** Changes the launcher to know about the new cluster and
45      * use it next time the system starts.
46      *
47      * @param clusterName the name of the cluster
48      * @param cluster file previously returned by findCluster
49      * @return the list of current cluster directories, including the newly added one
50      * @exception IOException if the registration fails
51      */

52     protected abstract File JavaDoc[] registerCluster(String JavaDoc clusterName, File JavaDoc cluster) throws IOException JavaDoc;
53 }
54
Popular Tags