jodd.petite.scope.ProtoScope Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jodd-petite Show documentation
Show all versions of jodd-petite Show documentation
Jodd Petite is slick and lightweight DI container that uses annotations and supports sufficient most of features offered by other containers.
// Copyright (c) 2003-2014, Jodd Team (jodd.org). All Rights Reserved.
package jodd.petite.scope;
import jodd.petite.BeanDefinition;
/**
* Prototype scope doesn't pool any beans, so each time bean is requested,
* a new instance will be created. Prototype scope does not call
* destroy methods.
*/
public class ProtoScope implements Scope {
/**
* Returns null
as no bean instance is stored.
*/
public Object lookup(String name) {
return null;
}
/**
* Does nothing, as bean instances are not stored.
*/
public void register(BeanDefinition beanDefinition, Object bean) {
}
/**
* Does nothing.
*/
public void remove(String name) {
}
/**
* Allows all scopes to be injected into prototype scoped beans.
*/
public boolean accept(Scope referenceScope) {
return true;
}
/**
* Does nothing.
*/
public void shutdown() {
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy