|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectti.chimera.ServiceFactoryImpl
ti.chimera.Plugin.ServiceFactory
Because the garbage collection of a service instance (among other
things) is used to determine if a Plugin
should be stopped, the
Registry
cannot hold a reference to the service itself. Instead
the service is registered (Plugin#addServiceFactory
) via a
ServiceFactory
which is used by the Registry
to create an instance of the Service
on demand. The service-
factory tracks (via a weak-reference) the lifecycle of the service
instance, and uses a Resource
to prevent the plugin from being
inactive as long as the service instance is in use.
Conceptually this class is an inner-class of Plugin
, but
in order to keep the file sizes managed, all of it's functionality is
actually delegated to ServiceFactoryImpl
. This is all subject
to change, and once the deprecated methods are removed from Plugin,
it is possible that the implementation gets moved into this class and
ServiceFactoryImpl goes away.
Constructor Summary | |
Plugin.ServiceFactory()
|
Method Summary | |
abstract Service |
createService()
Create the service this object is a factory for. |
java.lang.String |
getName()
Get the name of the service this is a factory for. |
Service |
getService()
Get the service that this factory creates. |
java.lang.String |
toString()
For debug... |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Plugin.ServiceFactory()
Method Detail |
public java.lang.String getName()
public Service getService()
Service
objectpublic java.lang.String toString()
public abstract Service createService()
Service
object.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |