Java Doc for PluginManager.java in  » Development » Java-Plugin-Framework » org » java » plugin » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Development » Java Plugin Framework » org.java.plugin 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.java.plugin.PluginManager

All known Subclasses:   org.java.plugin.standard.StandardPluginManager,
PluginManager
abstract public class PluginManager (Code)
JPF "runtime" class - the entry point to the framework API. It is expected that only one instance of this class will be created per application (other scenarios may be possible but not tested).

Usage example. Somewhere in the beginning of your application:

 manager = factory.createManager();
 manager.publishPlugins(getLocations(dir));
 
Later on, before accessing plug-in:
 manager.activatePlugin(pluginId);
 

See Also:   org.java.plugin.ObjectFactory.createManager
version:
   $Id: PluginManager.java,v 1.5 2007/04/07 12:42:14 ddimon Exp $

Inner Class :public interface EventListener
Inner Class :abstract public static class EventListenerAdapter implements EventListener
Inner Class :public static interface PluginLocation

Field Summary
final public static  StringVERSION
     JPF version number.
final public static  StringVERSION_PROPERTY
     JPF version system property name.


Method Summary
abstract public  voidactivatePlugin(String id)
     Activates plug-in with given ID if it is not activated yet.
abstract public  voiddeactivatePlugin(String id)
     Deactivates plug-in with given ID if it has been successfully activated before.
abstract public  PluginDescriptor[]disablePlugin(PluginDescriptor descr)
     Disables plug-in (with dependencies) in this manager instance.
final protected  voiddisposeClassLoader(PluginClassLoader cl)
     Forwards call to PluginClassLoader.dispose method.
abstract public  PluginDescriptor[]enablePlugin(PluginDescriptor descr, boolean includeDependings)
     Enables plug-in (or plug-ins) in this manager instance.
abstract public  PathResolvergetPathResolver()
    
abstract public  PlugingetPlugin(String id)
     Looks for plug-in with given ID and activates it if it is not activated yet.
abstract public  PluginClassLoadergetPluginClassLoader(PluginDescriptor descr)
     Returns instance of plug-in's class loader and not tries to activate plug-in.
abstract public  PlugingetPluginFor(Object obj)
     Looks for plug-in, given object belongs to.
abstract public  PluginRegistrygetRegistry()
    
final protected  voidinitPlugin(Plugin plugin, PluginDescriptor descr)
     Initializes given plug-in with this manager instance and given descriptor.
abstract public  booleanisBadPlugin(PluginDescriptor descr)
    
abstract public  booleanisPluginActivated(PluginDescriptor descr)
    
abstract public  booleanisPluginActivating(PluginDescriptor descr)
    
abstract public  booleanisPluginEnabled(PluginDescriptor descr)
    
public static  PluginManagerlookup(Object obj)
     Looks for plug-in manager instance for given object.
final protected  voidnotifyClassLoader(PluginClassLoader cl)
     Forwards call to PluginClassLoader.pluginsSetChanged method.
abstract public  Map<String, Identity>publishPlugins(PluginLocation[] locations)
     Registers plug-ins and their locations with this plug-in manager.
abstract public  voidregisterListener(EventListener listener)
     Registers plug-in manager event listener.
abstract public  voidshutdown()
     Shuts down the framework.
final protected  voidstartPlugin(Plugin plugin)
     Starts given plug-in.
final protected  voidstopPlugin(Plugin plugin)
     Stops given plug-in.
abstract public  voidunregisterListener(EventListener listener)
     Unregisters manager event listener.

Field Detail
VERSION
final public static String VERSION(Code)
JPF version number.



VERSION_PROPERTY
final public static String VERSION_PROPERTY(Code)
JPF version system property name.





Method Detail
activatePlugin
abstract public void activatePlugin(String id) throws PluginLifecycleException(Code)
Activates plug-in with given ID if it is not activated yet. Actually this makes plug-in "running" and calls Plugin.doStart method. This method will effectively activate all depending plug-ins. It is safe to call this method more than once.
Parameters:
  id - plug-in ID
throws:
  PluginLifecycleException - if plug-in can't be found or activated



deactivatePlugin
abstract public void deactivatePlugin(String id)(Code)
Deactivates plug-in with given ID if it has been successfully activated before. This method makes plug-in "not running" and calls Plugin.doStop method. Note that this method will effectively deactivate all depending plug-ins.
Parameters:
  id - plug-in ID



disablePlugin
abstract public PluginDescriptor[] disablePlugin(PluginDescriptor descr)(Code)
Disables plug-in (with dependencies) in this manager instance. Disabled plug-in can't be activated although it may be valid and successfully registered with plug-in registry. Before disabling, plug-in will be deactivated if it was successfully activated.

Be careful with this method as it can effectively disable large set of inter-depending plug-ins and your application may become unstable or even disabled as whole.
Parameters:
  descr - descriptor of plug-in to be disabled descriptors of plug-ins that was actually disabled




disposeClassLoader
final protected void disposeClassLoader(PluginClassLoader cl)(Code)
Forwards call to PluginClassLoader.dispose method.
Parameters:
  cl - plug-in class loader to be disposed



enablePlugin
abstract public PluginDescriptor[] enablePlugin(PluginDescriptor descr, boolean includeDependings)(Code)
Enables plug-in (or plug-ins) in this manager instance. Don't miss this with plug-in activation semantic. Enabled plug-in is simply ready to be activated. By default all loaded plug-ins are enabled.
Parameters:
  descr - descriptor of plug-in to be enabled
Parameters:
  includeDependings - if true, depending plug-ins will be alsoenabled descriptors of plug-ins that was actually enabled
See Also:   PluginManager.disablePlugin(PluginDescriptor)



getPathResolver
abstract public PathResolver getPathResolver()(Code)
path resolver



getPlugin
abstract public Plugin getPlugin(String id) throws PluginLifecycleException(Code)
Looks for plug-in with given ID and activates it if it is not activated yet. Note that this method will never return null.
Parameters:
  id - plug-in ID found plug-in
throws:
  PluginLifecycleException - if plug-in can't be found or activated



getPluginClassLoader
abstract public PluginClassLoader getPluginClassLoader(PluginDescriptor descr)(Code)
Returns instance of plug-in's class loader and not tries to activate plug-in. Use this method if you need to get access to plug-in resources and don't want to cause plug-in activation.
Parameters:
  descr - plug-in descriptor class loader instance for plug-in with given descriptor



getPluginFor
abstract public Plugin getPluginFor(Object obj)(Code)
Looks for plug-in, given object belongs to.
Parameters:
  obj - any object that maybe belongs to some plug-in plug-in or null if given object doesn't belong toany plug-in (possibly it is part of "host" application) and thusdoesn't managed by the Framework directly or indirectly



getRegistry
abstract public PluginRegistry getRegistry()(Code)
registry, used by this manager



initPlugin
final protected void initPlugin(Plugin plugin, PluginDescriptor descr)(Code)
Initializes given plug-in with this manager instance and given descriptor.
Parameters:
  plugin - plug-in instance to be initialized
Parameters:
  descr - plug-in descriptor



isBadPlugin
abstract public boolean isBadPlugin(PluginDescriptor descr)(Code)

Parameters:
  descr - plug-in descriptor true if plug-in disabled as it's activation fails



isPluginActivated
abstract public boolean isPluginActivated(PluginDescriptor descr)(Code)

Parameters:
  descr - plug-in descriptor true if plug-in with given descriptor is activated



isPluginActivating
abstract public boolean isPluginActivating(PluginDescriptor descr)(Code)

Parameters:
  descr - plug-in descriptor true if plug-in is currently activating



isPluginEnabled
abstract public boolean isPluginEnabled(PluginDescriptor descr)(Code)

Parameters:
  descr - plug-in descriptor true if given plug-in is disabled in this manager



lookup
public static PluginManager lookup(Object obj)(Code)
Looks for plug-in manager instance for given object.
Parameters:
  obj - any object that may be managed by some plug-in manager plug-in manager instance or null if given objectdoesn't belong to any plug-in (possibly it is part of "host"application) and thus doesn't managed by the Framework directlyor indirectly.



notifyClassLoader
final protected void notifyClassLoader(PluginClassLoader cl)(Code)
Forwards call to PluginClassLoader.pluginsSetChanged method.
Parameters:
  cl - plug-in class loader to be notified



publishPlugins
abstract public Map<String, Identity> publishPlugins(PluginLocation[] locations) throws JpfException(Code)
Registers plug-ins and their locations with this plug-in manager. You should use this method to register new plug-ins to make them available for activation with this manager instance (compare this to PluginRegistry.register(URL[]) method that just makes plug-in's meta-data available for reading and doesn't "know" where are things actually located).

Note that this method only load plug-ins to this manager but not activate them. Call PluginManager.activatePlugin(String) method to make plug-in activated. It is recommended to do this immediately before first plug-in use.
Parameters:
  locations - plug-in locations data map where keys are manifest URL's and values are registeredplug-ins or plug-in fragments, URL's for unprocessed manifestsare not included
throws:
  JpfException - if given plug-ins can't be registered or published (optionalbehavior)
See Also:   org.java.plugin.registry.PluginDescriptor
See Also:   org.java.plugin.registry.PluginFragment




registerListener
abstract public void registerListener(EventListener listener)(Code)
Registers plug-in manager event listener. If given listener has been registered before, this method will throw an IllegalArgumentException .
Parameters:
  listener - new manager event listener



shutdown
abstract public void shutdown()(Code)
Shuts down the framework.
Calling this method will deactivate all active plug-ins in order, reverse to the order they was activated. It also releases all resources allocated by this manager (class loaders, plug-in descriptors etc.). All disabled plug-ins will be marked as "enabled", all registered event listeners will be unregistered.



startPlugin
final protected void startPlugin(Plugin plugin) throws Exception(Code)
Starts given plug-in. Simply forward call to Plugin.doStart method.
Parameters:
  plugin - plug-in to be started
throws:
  Exception - if any error has occurred during plug-in start



stopPlugin
final protected void stopPlugin(Plugin plugin) throws Exception(Code)
Stops given plug-in. Simply forward call to Plugin.doStop method.
Parameters:
  plugin - plug-in to be stopped
throws:
  Exception - if any error has occurred during plug-in stop



unregisterListener
abstract public void unregisterListener(EventListener listener)(Code)
Unregisters manager event listener. If given listener hasn't been registered before, this method will throw an IllegalArgumentException .
Parameters:
  listener - registered listener



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.