public abstract class AbstractService extends AbstractRichPlugin implements Service
Service
implementations.Constructor and Description |
---|
AbstractService() |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Performs any needed cleanup of the object's services, in preparation for
the object being retired (e.g., to make garbage collection possible).
|
Context |
getContext()
Gets the application context to which the object belongs, or null if
Contextual.setContext(Context) has not yet been called on this object. |
void |
initialize()
Performs any needed initialization when the service is first loaded.
|
void |
registerEventHandlers()
Registers the service's event handler methods.
|
void |
setContext(Context context)
Sets the application context to which the object belongs.
|
String |
toString() |
compareTo, getInfo, getPriority, setInfo, setPriority
context
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
context
getPriority, setPriority
compareTo
getInfo, setInfo
public void initialize()
Service
NB: This method is not intended to be called directly. It is called by
the service framework itself (specifically by the ServiceHelper
)
when initializing the service. It should not be called a second time.
initialize
in interface Service
public void registerEventHandlers()
Service
NB: This method is not intended to be called directly. It is called by
the service framework itself (specifically by the ServiceHelper
)
when initializing the service. It should not be called a second time.
registerEventHandlers
in interface Service
public Context getContext()
Contextual
Contextual.setContext(Context)
has not yet been called on this object.getContext
in interface Contextual
getContext
in class AbstractContextual
Contextual.context()
public void setContext(Context context)
Contextual
Typically this method simply delegates to Context.inject(Object)
,
and should be called only once to populate the context. Most contextual
objects do not support later alteration of the context, and will throw
IllegalStateException
if this method is invoked again.
setContext
in interface Contextual
setContext
in class AbstractContextual
Context.inject(Object)
,
for an example of how to implement this interface
public void dispose()
Disposable
dispose
in interface Disposable
public String toString()
toString
in class AbstractRichPlugin
Copyright © 2009–2015 SciJava. All rights reserved.