public interface Plugin
| Modifier and Type | Interface and Description |
|---|---|
static class |
Plugin.PluginState
Stan wtyczki.
|
| Modifier and Type | Method and Description |
|---|---|
ClassLoader |
getClassLoader()
Zwraca obiekt
ClassLoader tej wtyczki, który może być używany do ładowania klas lub
zasobów wtyczki. |
PluginContext |
getContext() |
String |
getKey()
Zwraca identyfikator tekstowy wtyczki.
|
Date |
getLastUpdateDate() |
String |
getMessage(String code)
Pobiera tłumaczenie wiadomości dla podanego klucza i aktualnego języka przechowywanego w
LocaleContextHolder. |
String |
getMessage(String code,
Locale locale,
Object... args)
Pobiera tłumaczenie wiadomości dla podanego klucza i języka.
|
String |
getMessage(String code,
Object... args)
Pobiera tłumaczenie wiadomości dla podanego klucza i aktualnego języka przechowywanego w
LocaleContextHolder. |
Module<?> |
getModule(String key)
Zwraca deskryptor modułu o podanym kluczu
|
List<Module<?>> |
getModules() |
<T> List<Module<T>> |
getModules(Class<T> clazz) |
String |
getName() |
PluginDescriptor |
getPluginDescriptor() |
PluginFramework |
getPluginFramework() |
PluginStore |
getPluginStore()
Zwraca
PluginStore tej wtyczki. |
org.springframework.core.io.Resource |
getResource(String location)
Zwraca zasób wtyczki określony podaną ścieżką.
|
<T> ServiceReference<T> |
getServiceReference(ServiceDescriptor serviceDescriptor)
Pobiera dynamiczną referencję serwisu, opisanego podanym deskryptorem
ServiceDescriptor. |
Plugin.PluginState |
getState() |
String |
getVersion() |
boolean |
isActive() |
void |
start()
Uruchamia wtyczkę
|
void |
stop()
Zatrzymuje wtyczkę
|
void |
stopTransient()
Zatrzymuje wtyczkę.
|
void |
uninstall()
Usuwa wtyczkę z systemu
|
void |
update(File file)
Aktualizuje wtyczkę z podanego pliku
|
void start()
void stop()
void stopTransient()
void update(File file) throws InvalidPluginException, IOException
file - plik zawierający nową wersję tej wtyczkiIOExceptionInvalidPluginExceptionvoid uninstall()
Plugin.PluginState getState()
Plugin.PluginStateboolean isActive()
true jeżeli wtyczka jest aktywna Plugin.PluginState.ACTIVEString getKey()
String getName()
Date getLastUpdateDate()
String getVersion()
PluginFramework getPluginFramework()
PluginDescriptor getPluginDescriptor()
PluginContext getContext()
null jeżeli wtyczka nie posiada jeszcze kontekstu - nie
jest uruchomionaorg.springframework.core.io.Resource getResource(String location)
Resource.exists() na zwróconym zasobie.location - położenie określające ten zasóbnull)PluginStore getPluginStore()
PluginStore tej wtyczki. Jeżeli PluginStore jeszcze nie istnieje, zostanie
utworzony.
PluginStore może być wykorzystywany jako alternatywa dla bazy danych, do
przechowywania danych i
zapamiętywania ich pomiędzy uruchomieniami wtyczki.
PluginStore tej wtyczkiClassLoader getClassLoader()
ClassLoader tej wtyczki, który może być używany do ładowania klas lub
zasobów wtyczki.
ClassLoader może być odczytany tylko i wyłącznieString getMessage(String code) throws org.springframework.context.NoSuchMessageException, IllegalStateException
LocaleContextHolder.org.springframework.context.NoSuchMessageExceptionIllegalStateExceptiongetMessage(String, Locale, Object...);String getMessage(String code, Object... args) throws org.springframework.context.NoSuchMessageException, IllegalStateException
LocaleContextHolder. Dodatkowo możliwe jest zdefiniowanie opcjonalnych argumentów
wiadomości.org.springframework.context.NoSuchMessageExceptionIllegalStateExceptiongetMessage(String, Locale, Object...);String getMessage(String code, Locale locale, Object... args) throws org.springframework.context.NoSuchMessageException, IllegalStateException
code - klucz wiadomościlocale - locale, dla których pobieramy wiadomośćargs - dodatkowe argumenty wiadomościorg.springframework.context.NoSuchMessageException - wiadomość o takim kodzie nie istniejeIllegalStateException - wtyczka nie jest uruchomionaModule<?> getModule(String key)
moduleKey - Identyfikator modułuList<Module<?>> getModules()
<T> List<Module<T>> getModules(Class<T> clazz)
clazz - Klasa dla której moduły muszą spełniać warunek
Class.isAssignableFrom(Class)<T> ServiceReference<T> getServiceReference(ServiceDescriptor serviceDescriptor)
ServiceDescriptor. Ze względu na dynamiczną naturę serwisów, możemy sprawdzić, czy
jest on aktualnie dostępny poprzez wywołanie metody
ServiceReference.isAvailable().ServiceReference.release()
gdy nie będzie już używana (podczas wyłączenia wtyczki wszystkie referencje są zwalniane
automatycznie).serviceDescriptor - deskryptor opisujący serwisnull - ServiceReference.isAvailable())Copyright © 2016 Suncode. All rights reserved.