KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jlibrary > cache > CachePlugin


1 package org.jlibrary.cache;
2
3 import org.eclipse.ui.plugin.AbstractUIPlugin;
4 import org.jlibrary.cache.impl.WorkspaceCache;
5 import org.jlibrary.client.cache.LocalCacheService;
6 import org.osgi.framework.BundleContext;
7
8 /**
9  * The main plugin class to be used in the desktop.
10  */

11 public class CachePlugin extends AbstractUIPlugin {
12
13     //The shared instance.
14
private static CachePlugin plugin;
15     
16     /**
17      * The constructor.
18      */

19     public CachePlugin() {
20         plugin = this;
21         
22         LocalCacheService.getInstance().registerCache(new WorkspaceCache());
23     }
24
25     /**
26      * This method is called upon plug-in activation
27      */

28     public void start(BundleContext context) throws Exception JavaDoc {
29         super.start(context);
30     }
31
32     /**
33      * This method is called when the plug-in is stopped
34      */

35     public void stop(BundleContext context) throws Exception JavaDoc {
36         super.stop(context);
37         plugin = null;
38     }
39
40     /**
41      * Returns the shared instance.
42      */

43     public static CachePlugin getDefault() {
44         return plugin;
45     }
46
47 }
48
Popular Tags