Java Doc for Plugin.java in  » Scripting » oscript-2.10.4 » ti » chimera » 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 » Scripting » oscript 2.10.4 » ti.chimera 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   ti.chimera.Plugin

All known Subclasses:   ti.chimera.plugin.WindowManagerPlugin,  ti.chimera.plugin.AbstractModePlugin,  ti.chimera.plugin.SwingWorkerPlugin,
Plugin
abstract public class Plugin (Code)
The abstract base class for all plugins. This class provides an easy to use framework for adding modules to chimera, and a mechanism to manage resources created by this plugin.

The plugin class itself should be a lightweight container for all the resources created and/or provided by the plugin. The plugin class will be instantiated at startup regardless of whether the plugin is actually started. As much as possible, all resources created by a plugin should not be created until the the plugin is started. This can be accomplish by using managed resources.

The Resource mechanism is used for managing resources created by this plugin. A plugin is active (ie. running) whenever it has installed resources, and it is in-active (ie. stopped) whenever all it's resources have been uninstalled. There are two types of resources that can be created (see Plugin.addResource , managed, and unmanaged. A managed resources is automatically Resource.install ed when the plugin is started, and Resource.uninstall ed when the plugin is stopped. An unmanaged resource is Resource.install ed when it is added ( Plugin.addResource ), and Resource.uninstall ed when it is removed ( Plugin.removeResource ). Adding an unmanaged resource will cause the plugin to become active, if it wasn't already active, and removing an unmanaged resource could cause the plugin to become inactive if there are no more unmanaged resources.
author:
   Rob Clark
version:
   0.1


Inner Class :abstract public class ServiceFactory extends ServiceFactoryImpl
Inner Class :abstract public class RegistrySubscriberResource extends Resource implements NodeSubscriber,NodeCreationSubscriber,NodeDeletionSubscriber
Inner Class :public class ViewResource extends Resource
Inner Class :public interface ViewFactory
Inner Class :public class ToolBarResource extends Resource
Inner Class :public interface ToolBarFactory
Inner Class :public class MenuBarItemResource extends Resource

Field Summary
protected  Mainmain
     The main application.

Constructor Summary
public  Plugin(Main main, String name)
     Class Constructor.

Method Summary
public synchronized  voidaddResource(Resource r)
     Add a resource.
public  StringgetName()
     Get the name of this plugin instance.
 IteratorgetServiceFactories()
     Used by registry to determine services provided by plugin.
final public  booleanisActive()
     Determine if this plugin is currently active.
final public  voidregisterService(Service s)
    
final public synchronized  voidregisterServiceFactory(ServiceFactory sh)
     Register a service provided by this plugin.
final public  voidregisterServiceFactory(Value fxn)
     This is provided to make life easy for script code...
public synchronized  voidremoveResource(Resource r)
     Remove a resource.
public  StringtoString()
     Overloaded to provide some info about the state of the plugin, which might be useful while debugging/developing plugins.

Field Detail
main
protected Main main(Code)
The main application.




Constructor Detail
Plugin
public Plugin(Main main, String name)(Code)
Class Constructor.
Parameters:
  main - the main application
Parameters:
  name - the name of this plugin instance




Method Detail
addResource
public synchronized void addResource(Resource r)(Code)
Add a resource. If the resource is unmanaged, this could cause the plugin to become active if it is not already. This does nothing if the resource has already been added.
Parameters:
  r - the resource to add
See Also:   Plugin.removeResource



getName
public String getName()(Code)
Get the name of this plugin instance. the name



getServiceFactories
Iterator getServiceFactories()(Code)
Used by registry to determine services provided by plugin.



isActive
final public boolean isActive()(Code)
Determine if this plugin is currently active. An active plugin is one for which the Plugin.start method has been called since the last time Plugin.stop has been called.
See Also:   Plugin.start
See Also:   Plugin.stop



registerService
final public void registerService(Service s)(Code)



registerServiceFactory
final public synchronized void registerServiceFactory(ServiceFactory sh)(Code)
Register a service provided by this plugin. The serviced provided by the plugin should be registered by the plugin's constructor, rather than by the Plugin.start method, so that the registry can determine which services are provided by which plugin.

A service is registered via a ServiceFactory , which should be the one to actually create an instance of the service. This is done this way because the registry tracks the instances of a service, and adds/removes managed resources to when a service instance is created/ GC'd. If the registry, or any other code, where to hold a reference to the service itself, rather than the service-factory, the service would never get garbage collected.

The only reason this method is public is for the benefit of plugins implemented as script. The way the ObjectScript interpreter works, script code only has access to public methods of a class. This method should be treated as if it were protected.
Parameters:
  sh - a factory to a service provided by this plugin




registerServiceFactory
final public void registerServiceFactory(Value fxn)(Code)
This is provided to make life easy for script code... script code can simply pass in a function that returns a service, rather than having to pass in an instance of ServiceFactory .
Parameters:
  fxn - a script function that takes no args and returnsa instance of a service



removeResource
public synchronized void removeResource(Resource r)(Code)
Remove a resource. If the resource is unmanged, and there no more unmanaged resources, this will cause the plugin to become inactive. This does nothing if the resource has not already been added.
Parameters:
  r - the resource to add
See Also:   Plugin.addResource



toString
public String toString()(Code)
Overloaded to provide some info about the state of the plugin, which might be useful while debugging/developing plugins. a string



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.