Skip to content

Commit 9dddf5f

Browse files
committed
Add important note to Service API methods
The two Service API methods, initialize() and registerEventHandlers(), are not intended to be called by downstream code! Rather, the service framework itself calls these methods to initialize the service.
1 parent 2f08d69 commit 9dddf5f

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/main/java/org/scijava/service/Service.java

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,24 @@ public interface Service extends SciJavaPlugin, Contextual, Prioritized,
5858
Disposable
5959
{
6060

61-
/** Performs any needed initialization when the service is first loaded. */
61+
/**
62+
* Performs any needed initialization when the service is first loaded.
63+
* <p>
64+
* NB: This method is not intended to be called directly. It is called by
65+
* the service framework itself (specifically by the {@link ServiceHelper})
66+
* when initializing the service. It should not be called a second time.
67+
* </p>
68+
*/
6269
void initialize();
6370

64-
/** Registers the service's event handler methods. */
71+
/**
72+
* Registers the service's event handler methods.
73+
* <p>
74+
* NB: This method is not intended to be called directly. It is called by
75+
* the service framework itself (specifically by the {@link ServiceHelper})
76+
* when initializing the service. It should not be called a second time.
77+
* </p>
78+
*/
6579
void registerEventHandlers();
6680

6781
}

0 commit comments

Comments
 (0)