limpbizkit | 3d58d6b | 2008-03-08 16:11:47 +0000 | [diff] [blame] | 1 | /** |
| 2 | * Copyright (C) 2006 Google Inc. |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
limpbizkit | 5ae41eb | 2009-06-06 17:51:27 +0000 | [diff] [blame^] | 17 | package com.google.inject.internal; |
limpbizkit | 3d58d6b | 2008-03-08 16:11:47 +0000 | [diff] [blame] | 18 | |
limpbizkit | 5ae41eb | 2009-06-06 17:51:27 +0000 | [diff] [blame^] | 19 | import com.google.inject.Binding; |
| 20 | import com.google.inject.Injector; |
| 21 | import com.google.inject.Key; |
| 22 | import com.google.inject.MembersInjector; |
| 23 | import com.google.inject.Module; |
| 24 | import com.google.inject.Provider; |
| 25 | import com.google.inject.Stage; |
| 26 | import com.google.inject.TypeLiteral; |
limpbizkit | a98bc7a | 2008-08-29 16:52:44 +0000 | [diff] [blame] | 27 | import com.google.inject.spi.Dependency; |
limpbizkit | 5fb9d92 | 2008-10-14 23:35:56 +0000 | [diff] [blame] | 28 | import java.util.Collection; |
limpbizkit | f44e9cc | 2008-03-26 06:33:29 +0000 | [diff] [blame] | 29 | import java.util.List; |
limpbizkit | 8eef998 | 2008-08-03 00:45:52 +0000 | [diff] [blame] | 30 | import java.util.Map; |
limpbizkit | 5127365 | 2008-09-29 18:21:20 +0000 | [diff] [blame] | 31 | import java.util.Set; |
limpbizkit | 3d58d6b | 2008-03-08 16:11:47 +0000 | [diff] [blame] | 32 | |
| 33 | /** |
limpbizkit | fcbdf99 | 2008-11-26 02:37:35 +0000 | [diff] [blame] | 34 | * Builds a tree of injectors. This is a primary injector, plus child injectors needed for each |
limpbizkit | 5ae41eb | 2009-06-06 17:51:27 +0000 | [diff] [blame^] | 35 | * {@code Binder.newPrivateBinder() private environment}. The primary injector is not necessarily a |
limpbizkit | fcbdf99 | 2008-11-26 02:37:35 +0000 | [diff] [blame] | 36 | * top-level injector. |
| 37 | * |
| 38 | * <p>Injector construction happens in two phases. |
limpbizkit | a8dccb3 | 2008-11-11 22:41:56 +0000 | [diff] [blame] | 39 | * <ol> |
| 40 | * <li>Static building. In this phase, we interpret commands, create bindings, and inspect |
| 41 | * dependencies. During this phase, we hold a lock to ensure consistency with parent injectors. |
| 42 | * No user code is executed in this phase.</li> |
| 43 | * <li>Dynamic injection. In this phase, we call user code. We inject members that requested |
| 44 | * injection. This may require user's objects be created and their providers be called. And we |
| 45 | * create eager singletons. In this phase, user code may have started other threads. This phase |
| 46 | * is not executed for injectors created using {@link Stage#TOOL the tool stage}</li> |
| 47 | * </ol> |
limpbizkit | 3d58d6b | 2008-03-08 16:11:47 +0000 | [diff] [blame] | 48 | * |
| 49 | * @author crazybob@google.com (Bob Lee) |
| 50 | * @author jessewilson@google.com (Jesse Wilson) |
| 51 | */ |
limpbizkit | 5ae41eb | 2009-06-06 17:51:27 +0000 | [diff] [blame^] | 52 | public final class InjectorBuilder { |
limpbizkit | 3d58d6b | 2008-03-08 16:11:47 +0000 | [diff] [blame] | 53 | |
| 54 | private final Stopwatch stopwatch = new Stopwatch(); |
limpbizkit | fcbdf99 | 2008-11-26 02:37:35 +0000 | [diff] [blame] | 55 | private final Errors errors = new Errors(); |
limpbizkit | 3d58d6b | 2008-03-08 16:11:47 +0000 | [diff] [blame] | 56 | |
limpbizkit | 3d58d6b | 2008-03-08 16:11:47 +0000 | [diff] [blame] | 57 | private Stage stage; |
limpbizkit | 3d58d6b | 2008-03-08 16:11:47 +0000 | [diff] [blame] | 58 | |
limpbizkit | fcbdf99 | 2008-11-26 02:37:35 +0000 | [diff] [blame] | 59 | private final Initializer initializer = new Initializer(); |
| 60 | private final BindingProcessor bindingProcesor; |
| 61 | private final InjectionRequestProcessor injectionRequestProcessor; |
limpbizkit | 3d58d6b | 2008-03-08 16:11:47 +0000 | [diff] [blame] | 62 | |
limpbizkit | fcbdf99 | 2008-11-26 02:37:35 +0000 | [diff] [blame] | 63 | private final InjectorShell.Builder shellBuilder = new InjectorShell.Builder(); |
| 64 | private List<InjectorShell> shells; |
limpbizkit | 3d58d6b | 2008-03-08 16:11:47 +0000 | [diff] [blame] | 65 | |
limpbizkit | 5ae41eb | 2009-06-06 17:51:27 +0000 | [diff] [blame^] | 66 | public InjectorBuilder() { |
limpbizkit | fcbdf99 | 2008-11-26 02:37:35 +0000 | [diff] [blame] | 67 | injectionRequestProcessor = new InjectionRequestProcessor(errors, initializer); |
limpbizkit | c3f9284 | 2008-12-30 19:43:47 +0000 | [diff] [blame] | 68 | bindingProcesor = new BindingProcessor(errors, initializer); |
limpbizkit | fcbdf99 | 2008-11-26 02:37:35 +0000 | [diff] [blame] | 69 | } |
limpbizkit | 3d58d6b | 2008-03-08 16:11:47 +0000 | [diff] [blame] | 70 | |
| 71 | /** |
limpbizkit | fcbdf99 | 2008-11-26 02:37:35 +0000 | [diff] [blame] | 72 | * Sets the stage for the created injector. If the stage is {@link Stage#PRODUCTION}, this class |
| 73 | * will eagerly load singletons. |
limpbizkit | 3d58d6b | 2008-03-08 16:11:47 +0000 | [diff] [blame] | 74 | */ |
limpbizkit | 5ae41eb | 2009-06-06 17:51:27 +0000 | [diff] [blame^] | 75 | public InjectorBuilder stage(Stage stage) { |
limpbizkit | fcbdf99 | 2008-11-26 02:37:35 +0000 | [diff] [blame] | 76 | shellBuilder.stage(stage); |
limpbizkit | 3d58d6b | 2008-03-08 16:11:47 +0000 | [diff] [blame] | 77 | this.stage = stage; |
| 78 | return this; |
| 79 | } |
| 80 | |
limpbizkit | fcbdf99 | 2008-11-26 02:37:35 +0000 | [diff] [blame] | 81 | /** |
| 82 | * Sets the parent of the injector to-be-constructed. As a side effect, this sets this injector's |
| 83 | * stage to the stage of {@code parent}. |
| 84 | */ |
limpbizkit | 5ae41eb | 2009-06-06 17:51:27 +0000 | [diff] [blame^] | 85 | public InjectorBuilder parentInjector(InjectorImpl parent) { |
limpbizkit | fcbdf99 | 2008-11-26 02:37:35 +0000 | [diff] [blame] | 86 | shellBuilder.parent(parent); |
| 87 | return stage(parent.getInstance(Stage.class)); |
limpbizkit | 3d58d6b | 2008-03-08 16:11:47 +0000 | [diff] [blame] | 88 | } |
| 89 | |
limpbizkit | 5ae41eb | 2009-06-06 17:51:27 +0000 | [diff] [blame^] | 90 | public InjectorBuilder addModules(Iterable<? extends Module> modules) { |
limpbizkit | fcbdf99 | 2008-11-26 02:37:35 +0000 | [diff] [blame] | 91 | shellBuilder.addModules(modules); |
limpbizkit | 3d58d6b | 2008-03-08 16:11:47 +0000 | [diff] [blame] | 92 | return this; |
| 93 | } |
| 94 | |
limpbizkit | 5ae41eb | 2009-06-06 17:51:27 +0000 | [diff] [blame^] | 95 | public Injector build() { |
limpbizkit | fcbdf99 | 2008-11-26 02:37:35 +0000 | [diff] [blame] | 96 | if (shellBuilder == null) { |
limpbizkit | 3d58d6b | 2008-03-08 16:11:47 +0000 | [diff] [blame] | 97 | throw new AssertionError("Already built, builders are not reusable."); |
| 98 | } |
| 99 | |
limpbizkit | fcbdf99 | 2008-11-26 02:37:35 +0000 | [diff] [blame] | 100 | // Synchronize while we're building up the bindings and other injector state. This ensures that |
| 101 | // the JIT bindings in the parent injector don't change while we're being built |
| 102 | synchronized (shellBuilder.lock()) { |
limpbizkit | c3f9284 | 2008-12-30 19:43:47 +0000 | [diff] [blame] | 103 | shells = shellBuilder.build(initializer, bindingProcesor, stopwatch, errors); |
limpbizkit | fcbdf99 | 2008-11-26 02:37:35 +0000 | [diff] [blame] | 104 | stopwatch.resetAndLog("Injector construction"); |
limpbizkit | 7f8eda0 | 2008-03-26 01:11:16 +0000 | [diff] [blame] | 105 | |
limpbizkit | fcbdf99 | 2008-11-26 02:37:35 +0000 | [diff] [blame] | 106 | initializeStatically(); |
| 107 | } |
limpbizkit | 3d58d6b | 2008-03-08 16:11:47 +0000 | [diff] [blame] | 108 | |
limpbizkit | a8dccb3 | 2008-11-11 22:41:56 +0000 | [diff] [blame] | 109 | // If we're in the tool stage, stop here. Don't eagerly inject or load anything. |
limpbizkit | 3d58d6b | 2008-03-08 16:11:47 +0000 | [diff] [blame] | 110 | if (stage == Stage.TOOL) { |
limpbizkit | fcbdf99 | 2008-11-26 02:37:35 +0000 | [diff] [blame] | 111 | return new ToolStageInjector(primaryInjector()); |
limpbizkit | 3d58d6b | 2008-03-08 16:11:47 +0000 | [diff] [blame] | 112 | } |
| 113 | |
limpbizkit | a8dccb3 | 2008-11-11 22:41:56 +0000 | [diff] [blame] | 114 | injectDynamically(); |
limpbizkit | 3d58d6b | 2008-03-08 16:11:47 +0000 | [diff] [blame] | 115 | |
limpbizkit | fcbdf99 | 2008-11-26 02:37:35 +0000 | [diff] [blame] | 116 | return primaryInjector(); |
| 117 | } |
| 118 | |
| 119 | /** Initialize and validate everything. */ |
| 120 | private void initializeStatically() { |
| 121 | bindingProcesor.initializeBindings(); |
| 122 | stopwatch.resetAndLog("Binding initialization"); |
| 123 | |
| 124 | for (InjectorShell shell : shells) { |
| 125 | shell.getInjector().index(); |
| 126 | } |
| 127 | stopwatch.resetAndLog("Binding indexing"); |
| 128 | |
| 129 | injectionRequestProcessor.process(shells); |
| 130 | stopwatch.resetAndLog("Collecting injection requests"); |
| 131 | |
limpbizkit | c3f9284 | 2008-12-30 19:43:47 +0000 | [diff] [blame] | 132 | bindingProcesor.runCreationListeners(); |
limpbizkit | fcbdf99 | 2008-11-26 02:37:35 +0000 | [diff] [blame] | 133 | stopwatch.resetAndLog("Binding validation"); |
| 134 | |
| 135 | injectionRequestProcessor.validate(); |
| 136 | stopwatch.resetAndLog("Static validation"); |
| 137 | |
| 138 | initializer.validateOustandingInjections(errors); |
| 139 | stopwatch.resetAndLog("Instance member validation"); |
| 140 | |
limpbizkit | 97eac0f | 2009-03-28 18:25:35 +0000 | [diff] [blame] | 141 | new LookupProcessor(errors).process(shells); |
limpbizkit | 8d62075 | 2009-03-31 22:37:26 +0000 | [diff] [blame] | 142 | for (InjectorShell shell : shells) { |
| 143 | ((DeferredLookups) shell.getInjector().lookups).initialize(errors); |
| 144 | } |
limpbizkit | fcbdf99 | 2008-11-26 02:37:35 +0000 | [diff] [blame] | 145 | stopwatch.resetAndLog("Provider verification"); |
| 146 | |
| 147 | for (InjectorShell shell : shells) { |
| 148 | if (!shell.getElements().isEmpty()) { |
| 149 | throw new AssertionError("Failed to execute " + shell.getElements()); |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | errors.throwCreationExceptionIfErrorsExist(); |
limpbizkit | 3d58d6b | 2008-03-08 16:11:47 +0000 | [diff] [blame] | 154 | } |
| 155 | |
limpbizkit | a8dccb3 | 2008-11-11 22:41:56 +0000 | [diff] [blame] | 156 | /** |
limpbizkit | fcbdf99 | 2008-11-26 02:37:35 +0000 | [diff] [blame] | 157 | * Returns the injector being constructed. This is not necessarily the root injector. |
limpbizkit | a8dccb3 | 2008-11-11 22:41:56 +0000 | [diff] [blame] | 158 | */ |
limpbizkit | fcbdf99 | 2008-11-26 02:37:35 +0000 | [diff] [blame] | 159 | private Injector primaryInjector() { |
| 160 | return shells.get(0).getInjector(); |
limpbizkit | 3d58d6b | 2008-03-08 16:11:47 +0000 | [diff] [blame] | 161 | } |
| 162 | |
limpbizkit | a8dccb3 | 2008-11-11 22:41:56 +0000 | [diff] [blame] | 163 | /** |
| 164 | * Inject everything that can be injected. This method is intentionally not synchronized. If we |
| 165 | * locked while injecting members (ie. running user code), things would deadlock should the user |
| 166 | * code build a just-in-time binding from another thread. |
| 167 | */ |
| 168 | private void injectDynamically() { |
limpbizkit | fcbdf99 | 2008-11-26 02:37:35 +0000 | [diff] [blame] | 169 | injectionRequestProcessor.injectMembers(); |
limpbizkit | 3d58d6b | 2008-03-08 16:11:47 +0000 | [diff] [blame] | 170 | stopwatch.resetAndLog("Static member injection"); |
limpbizkit | 9532e62 | 2008-06-18 08:20:54 +0000 | [diff] [blame] | 171 | |
limpbizkit | fcbdf99 | 2008-11-26 02:37:35 +0000 | [diff] [blame] | 172 | initializer.injectAll(errors); |
limpbizkit | 3d58d6b | 2008-03-08 16:11:47 +0000 | [diff] [blame] | 173 | stopwatch.resetAndLog("Instance injection"); |
limpbizkit | 9532e62 | 2008-06-18 08:20:54 +0000 | [diff] [blame] | 174 | errors.throwCreationExceptionIfErrorsExist(); |
limpbizkit | 3d58d6b | 2008-03-08 16:11:47 +0000 | [diff] [blame] | 175 | |
limpbizkit | fcbdf99 | 2008-11-26 02:37:35 +0000 | [diff] [blame] | 176 | for (InjectorShell shell : shells) { |
| 177 | loadEagerSingletons(shell.getInjector(), stage, errors); |
| 178 | } |
| 179 | stopwatch.resetAndLog("Preloading singletons"); |
limpbizkit | 9532e62 | 2008-06-18 08:20:54 +0000 | [diff] [blame] | 180 | errors.throwCreationExceptionIfErrorsExist(); |
limpbizkit | 3d58d6b | 2008-03-08 16:11:47 +0000 | [diff] [blame] | 181 | } |
| 182 | |
limpbizkit | fcbdf99 | 2008-11-26 02:37:35 +0000 | [diff] [blame] | 183 | /** |
| 184 | * Loads eager singletons, or all singletons if we're in Stage.PRODUCTION. Bindings discovered |
| 185 | * while we're binding these singletons are not be eager. |
| 186 | */ |
limpbizkit | 5ae41eb | 2009-06-06 17:51:27 +0000 | [diff] [blame^] | 187 | void loadEagerSingletons(InjectorImpl injector, Stage stage, final Errors errors) { |
limpbizkit | 5fb9d92 | 2008-10-14 23:35:56 +0000 | [diff] [blame] | 188 | @SuppressWarnings("unchecked") // casting Collection<Binding> to Collection<BindingImpl> is safe |
| 189 | Set<BindingImpl<?>> candidateBindings = ImmutableSet.copyOf(Iterables.concat( |
| 190 | (Collection) injector.state.getExplicitBindingsThisLevel().values(), |
| 191 | injector.jitBindings.values())); |
limpbizkit | 5127365 | 2008-09-29 18:21:20 +0000 | [diff] [blame] | 192 | for (final BindingImpl<?> binding : candidateBindings) { |
limpbizkit | e37805a | 2009-06-04 19:33:42 +0000 | [diff] [blame] | 193 | if (isEagerSingleton(injector, binding, stage)) { |
limpbizkit | 9dc32d4 | 2008-06-15 11:29:10 +0000 | [diff] [blame] | 194 | try { |
| 195 | injector.callInContext(new ContextualCallable<Void>() { |
limpbizkit | 76c24b1 | 2008-12-25 04:32:41 +0000 | [diff] [blame] | 196 | Dependency<?> dependency = Dependency.get(binding.getKey()); |
limpbizkit | 9dc32d4 | 2008-06-15 11:29:10 +0000 | [diff] [blame] | 197 | public Void call(InternalContext context) { |
limpbizkit | a98bc7a | 2008-08-29 16:52:44 +0000 | [diff] [blame] | 198 | context.setDependency(dependency); |
limpbizkit | 0689806 | 2008-11-02 05:14:55 +0000 | [diff] [blame] | 199 | Errors errorsForBinding = errors.withSource(dependency); |
limpbizkit | 9dc32d4 | 2008-06-15 11:29:10 +0000 | [diff] [blame] | 200 | try { |
limpbizkit | 76c24b1 | 2008-12-25 04:32:41 +0000 | [diff] [blame] | 201 | binding.getInternalFactory().get(errorsForBinding, context, dependency); |
limpbizkit | 163c48a | 2008-06-16 02:58:08 +0000 | [diff] [blame] | 202 | } catch (ErrorsException e) { |
limpbizkit | 0689806 | 2008-11-02 05:14:55 +0000 | [diff] [blame] | 203 | errorsForBinding.merge(e.getErrors()); |
limpbizkit | 9dc32d4 | 2008-06-15 11:29:10 +0000 | [diff] [blame] | 204 | } finally { |
limpbizkit | a98bc7a | 2008-08-29 16:52:44 +0000 | [diff] [blame] | 205 | context.setDependency(null); |
limpbizkit | 9dc32d4 | 2008-06-15 11:29:10 +0000 | [diff] [blame] | 206 | } |
| 207 | |
limpbizkit | ecbb080 | 2008-06-02 07:02:11 +0000 | [diff] [blame] | 208 | return null; |
limpbizkit | ecbb080 | 2008-06-02 07:02:11 +0000 | [diff] [blame] | 209 | } |
limpbizkit | 9dc32d4 | 2008-06-15 11:29:10 +0000 | [diff] [blame] | 210 | }); |
limpbizkit | 163c48a | 2008-06-16 02:58:08 +0000 | [diff] [blame] | 211 | } catch (ErrorsException e) { |
limpbizkit | 9dc32d4 | 2008-06-15 11:29:10 +0000 | [diff] [blame] | 212 | throw new AssertionError(); |
| 213 | } |
limpbizkit | ecbb080 | 2008-06-02 07:02:11 +0000 | [diff] [blame] | 214 | } |
| 215 | } |
| 216 | } |
| 217 | |
limpbizkit | e37805a | 2009-06-04 19:33:42 +0000 | [diff] [blame] | 218 | private boolean isEagerSingleton(InjectorImpl injector, BindingImpl<?> binding, Stage stage) { |
| 219 | if (binding.getScoping().isEagerSingleton(stage)) { |
| 220 | return true; |
| 221 | } |
| 222 | |
| 223 | // handle a corner case where a child injector links to a binding in a parent injector, and |
| 224 | // that binding is singleton. We won't catch this otherwise because we only iterate the child's |
| 225 | // bindings. |
| 226 | if (binding instanceof LinkedBindingImpl) { |
| 227 | Key<?> linkedBinding = ((LinkedBindingImpl<?>) binding).getLinkedKey(); |
| 228 | return isEagerSingleton(injector, injector.getBinding(linkedBinding), stage); |
| 229 | } |
| 230 | |
| 231 | return false; |
| 232 | } |
| 233 | |
limpbizkit | 8eef998 | 2008-08-03 00:45:52 +0000 | [diff] [blame] | 234 | /** {@link Injector} exposed to users in {@link Stage#TOOL}. */ |
| 235 | static class ToolStageInjector implements Injector { |
| 236 | private final Injector delegateInjector; |
| 237 | |
| 238 | ToolStageInjector(Injector delegateInjector) { |
| 239 | this.delegateInjector = delegateInjector; |
| 240 | } |
| 241 | public void injectMembers(Object o) { |
| 242 | throw new UnsupportedOperationException( |
| 243 | "Injector.injectMembers(Object) is not supported in Stage.TOOL"); |
| 244 | } |
| 245 | public Map<Key<?>, Binding<?>> getBindings() { |
| 246 | return this.delegateInjector.getBindings(); |
| 247 | } |
| 248 | public <T> Binding<T> getBinding(Key<T> key) { |
| 249 | return this.delegateInjector.getBinding(key); |
| 250 | } |
| 251 | public <T> Binding<T> getBinding(Class<T> type) { |
| 252 | return this.delegateInjector.getBinding(type); |
| 253 | } |
| 254 | public <T> List<Binding<T>> findBindingsByType(TypeLiteral<T> type) { |
| 255 | return this.delegateInjector.findBindingsByType(type); |
| 256 | } |
limpbizkit | edd8d64 | 2008-10-18 19:50:49 +0000 | [diff] [blame] | 257 | public Injector getParent() { |
| 258 | return delegateInjector.getParent(); |
| 259 | } |
limpbizkit | 5fb9d92 | 2008-10-14 23:35:56 +0000 | [diff] [blame] | 260 | public Injector createChildInjector(Iterable<? extends Module> modules) { |
| 261 | return delegateInjector.createChildInjector(modules); |
| 262 | } |
| 263 | public Injector createChildInjector(Module... modules) { |
| 264 | return delegateInjector.createChildInjector(modules); |
| 265 | } |
limpbizkit | 8eef998 | 2008-08-03 00:45:52 +0000 | [diff] [blame] | 266 | public <T> Provider<T> getProvider(Key<T> key) { |
| 267 | throw new UnsupportedOperationException( |
| 268 | "Injector.getProvider(Key<T>) is not supported in Stage.TOOL"); |
| 269 | } |
| 270 | public <T> Provider<T> getProvider(Class<T> type) { |
| 271 | throw new UnsupportedOperationException( |
| 272 | "Injector.getProvider(Class<T>) is not supported in Stage.TOOL"); |
| 273 | } |
limpbizkit | 03b81a6 | 2009-03-18 05:34:39 +0000 | [diff] [blame] | 274 | public <T> MembersInjector<T> getMembersInjector(TypeLiteral<T> typeLiteral) { |
| 275 | throw new UnsupportedOperationException( |
| 276 | "Injector.getMembersInjector(TypeLiteral<T>) is not supported in Stage.TOOL"); |
| 277 | } |
| 278 | public <T> MembersInjector<T> getMembersInjector(Class<T> type) { |
| 279 | throw new UnsupportedOperationException( |
| 280 | "Injector.getMembersInjector(Class<T>) is not supported in Stage.TOOL"); |
| 281 | } |
limpbizkit | 8eef998 | 2008-08-03 00:45:52 +0000 | [diff] [blame] | 282 | public <T> T getInstance(Key<T> key) { |
| 283 | throw new UnsupportedOperationException( |
| 284 | "Injector.getInstance(Key<T>) is not supported in Stage.TOOL"); |
| 285 | } |
| 286 | public <T> T getInstance(Class<T> type) { |
| 287 | throw new UnsupportedOperationException( |
| 288 | "Injector.getInstance(Class<T>) is not supported in Stage.TOOL"); |
| 289 | } |
| 290 | } |
limpbizkit | 3d58d6b | 2008-03-08 16:11:47 +0000 | [diff] [blame] | 291 | } |