1 package com.atlassian.plugin.manager;
2
3 import com.atlassian.plugin.ModuleDescriptor;
4 import com.atlassian.plugin.Plugin;
5 import com.atlassian.plugin.PluginAccessor;
6 import com.atlassian.plugin.PluginRestartState;
7
8 import java.io.InputStream;
9 import java.util.Collection;
10 import java.util.List;
11 import java.util.function.Predicate;
12
13 import static com.google.common.base.Preconditions.checkNotNull;
14
15
16
17
18
19
20 abstract class ForwardingPluginAccessor implements PluginAccessor {
21 protected final PluginAccessor delegate;
22
23 ForwardingPluginAccessor(final PluginAccessor delegate) {
24 this.delegate = checkNotNull(delegate);
25 }
26
27 public ClassLoader getClassLoader() {
28 return delegate.getClassLoader();
29 }
30
31 public InputStream getDynamicResourceAsStream(final String resourcePath) {
32 return delegate.getDynamicResourceAsStream(resourcePath);
33 }
34
35 public <D extends ModuleDescriptor<?>> List<D> getEnabledModuleDescriptorsByClass(final Class<D> descriptorClazz) {
36 return delegate.getEnabledModuleDescriptorsByClass(descriptorClazz);
37 }
38
39 public <D extends ModuleDescriptor<?>> List<D> getActiveModuleDescriptorsByClass(Class<D> descriptorClazz) {
40 return delegate.getActiveModuleDescriptorsByClass(descriptorClazz);
41 }
42
43 public <M> List<M> getEnabledModulesByClass(final Class<M> moduleClass) {
44 return delegate.getEnabledModulesByClass(moduleClass);
45 }
46
47 public Plugin getEnabledPlugin(final String pluginKey) throws IllegalArgumentException {
48 return delegate.getEnabledPlugin(pluginKey);
49 }
50
51 public ModuleDescriptor<?> getEnabledPluginModule(final String completeKey) {
52 return delegate.getEnabledPluginModule(completeKey);
53 }
54
55 public Collection<Plugin> getEnabledPlugins() {
56 return delegate.getEnabledPlugins();
57 }
58
59 public <M> Collection<ModuleDescriptor<M>> getModuleDescriptors(final Predicate<ModuleDescriptor<M>> moduleDescriptorPredicate) {
60 return delegate.getModuleDescriptors(moduleDescriptorPredicate);
61 }
62
63 public <M> Collection<M> getModules(final Predicate<ModuleDescriptor<M>> moduleDescriptorPredicate) {
64 return delegate.getModules(moduleDescriptorPredicate);
65 }
66
67 public Plugin getPlugin(final String key) throws IllegalArgumentException {
68 return delegate.getPlugin(key);
69 }
70
71 public ModuleDescriptor<?> getPluginModule(final String completeKey) {
72 return delegate.getPluginModule(completeKey);
73 }
74
75 public PluginRestartState getPluginRestartState(final String key) {
76 return delegate.getPluginRestartState(key);
77 }
78
79 public Collection<Plugin> getPlugins() {
80 return delegate.getPlugins();
81 }
82
83 public Collection<Plugin> getPlugins(final Predicate<Plugin> pluginPredicate) {
84 return delegate.getPlugins(pluginPredicate);
85 }
86
87 public boolean isPluginEnabled(final String key) throws IllegalArgumentException {
88 return delegate.isPluginEnabled(key);
89 }
90
91 public boolean isPluginModuleEnabled(final String completeKey) {
92 return delegate.isPluginModuleEnabled(completeKey);
93 }
94
95 public boolean isSystemPlugin(final String key) {
96 return delegate.isSystemPlugin(key);
97 }
98
99 public Iterable<ModuleDescriptor<?>> getDynamicModules(final Plugin plugin) {
100 return delegate.getDynamicModules(plugin);
101 }
102 }