org.scijava.object
Class DefaultObjectService
java.lang.Object
org.scijava.AbstractContextual
org.scijava.plugin.AbstractRichPlugin
org.scijava.service.AbstractService
org.scijava.object.DefaultObjectService
- All Implemented Interfaces:
- Comparable<Prioritized>, Contextual, Disposable, ObjectService, HasPluginInfo, RichPlugin, SciJavaPlugin, Prioritized, SciJavaService, Service
public final class DefaultObjectService
- extends AbstractService
- implements ObjectService
Default service for keeping track of registered objects. Automatically
registers new objects from ObjectCreatedEvent
s, and removes objects
from ObjectDeletedEvent
s.
This is useful to retrieve available objects of a particular type, such as
the list of imagej.data.Dataset
s upon which a user can choose to
operate.
- Author:
- Curtis Rueden
DefaultObjectService
public DefaultObjectService()
getEventService
public EventService getEventService()
- Specified by:
getEventService
in interface ObjectService
getIndex
public ObjectIndex<Object> getIndex()
- Description copied from interface:
ObjectService
- Gets the index of available objects.
- Specified by:
getIndex
in interface ObjectService
getObjects
public <T> List<T> getObjects(Class<T> type)
- Description copied from interface:
ObjectService
- Gets a list of all registered objects compatible with the given type.
- Specified by:
getObjects
in interface ObjectService
addObject
public void addObject(Object obj)
- Description copied from interface:
ObjectService
- Registers an object with the object service.
- Specified by:
addObject
in interface ObjectService
removeObject
public void removeObject(Object obj)
- Description copied from interface:
ObjectService
- Deregisters an object with the object service.
- Specified by:
removeObject
in interface ObjectService
initialize
public void initialize()
- Description copied from interface:
Service
- Performs any needed initialization when the service is first loaded.
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.
- Specified by:
initialize
in interface Service
- Overrides:
initialize
in class AbstractService
onEvent
protected void onEvent(ObjectCreatedEvent event)
onEvent
protected void onEvent(ObjectDeletedEvent event)
Copyright © 2009–2014 SciJava. All rights reserved.