mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-30 02:07:50 +08:00
plugin_services.md: cleanup
This commit is contained in:
parent
279188fec7
commit
e6255292a1
@ -2,7 +2,7 @@
|
|||||||
title: Plugin Services
|
title: Plugin Services
|
||||||
---
|
---
|
||||||
|
|
||||||
A _service_ is a plugin component loaded on demand when your plugin calls the `getService` method of the [`ServiceManager`](upsource:///platform/core-api/src/com/intellij/openapi/components/ServiceManager.java) class.
|
A _service_ is a plugin component loaded on demand when your plugin calls the `getService()` method of the [`ServiceManager`](upsource:///platform/core-api/src/com/intellij/openapi/components/ServiceManager.java) class.
|
||||||
|
|
||||||
The *IntelliJ Platform* ensures that only one instance of a service is loaded even though the service is called several times. A service must have an implementation class which is used for service instantiation. A service may also have an interface class which is used to obtain the service instance and provides API of the service. The interface and implementation classes are specified in the `plugin.xml` file.
|
The *IntelliJ Platform* ensures that only one instance of a service is loaded even though the service is called several times. A service must have an implementation class which is used for service instantiation. A service may also have an interface class which is used to obtain the service instance and provides API of the service. The interface and implementation classes are specified in the `plugin.xml` file.
|
||||||
|
|
||||||
@ -32,12 +32,12 @@ To clarify the service declaration procedure, consider the following fragment of
|
|||||||
```xml
|
```xml
|
||||||
<extensions defaultExtensionNs="com.intellij">
|
<extensions defaultExtensionNs="com.intellij">
|
||||||
<!-- Declare the application level service -->
|
<!-- Declare the application level service -->
|
||||||
<applicationService serviceInterface="Mypackage.MyApplicationService"
|
<applicationService serviceInterface="mypackage.MyApplicationService"
|
||||||
serviceImplementation="Mypackage.MyApplicationServiceImpl" />
|
serviceImplementation="mypackage.MyApplicationServiceImpl" />
|
||||||
|
|
||||||
<!-- Declare the project level service -->
|
<!-- Declare the project level service -->
|
||||||
<projectService serviceInterface="Mypackage.MyProjectService"
|
<projectService serviceInterface="mypackage.MyProjectService"
|
||||||
serviceImplementation="Mypackage.MyProjectServiceImpl" />
|
serviceImplementation="mypackage.MyProjectServiceImpl" />
|
||||||
</extensions>
|
</extensions>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user