- For the newly added child element, set the following attributes:
- serviceInterface: specifies the service interface class.
- serviceImplementation: specifies the service implementation class.
<extensions defaultExtensionNs="com.intellij">
<!-- Declare the application level service -->
<applicationService serviceInterface="Mypackage.MyServiceInterfaceClass" serviceImplementation="Mypackage.MyServiceImplClass" />
<!-- Declare the project level service -->
<projectService serviceInterface="Mypackage.MyProjectServiceInterfaceClass" serviceImplementation="Mypackage.MyProjectServiceImplClass" />
</extensions>
Get
To instantiate your service, in Java code, use the following syntax:
MyServiceImplClass service = ServiceManager.getService(MyServiceImplClass.class);
Documentation / Reference