public class ProfileContext extends Object
Constructor and Description |
---|
ProfileContext(ClassLoader classLoader,
ParameterList contextParameters)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
<T> Optional<T> |
findResource(Class<T> type)
Returns an optional resource.
|
ClassLoader |
getClassLoader()
Returns a class loader to load services.
|
ParameterList |
getContextParameters()
Returns context parameters (may be environment variables).
|
static ProfileContext |
system(ClassLoader classLoader)
Creates a new context with system variables as context parameters.
|
<T> ProfileContext |
withResource(Class<T> type,
T object)
Creates a new context with the additional resource.
|
public ProfileContext(ClassLoader classLoader, ParameterList contextParameters)
classLoader
- the class loader to load servicescontextParameters
- the context parametersIllegalArgumentException
- if some parameters were null
public static ProfileContext system(ClassLoader classLoader)
classLoader
- current class loaderIllegalArgumentException
- if some parameters were null
public <T> ProfileContext withResource(Class<T> type, T object)
T
- the resource typetype
- the resource typeobject
- the resourcepublic ClassLoader getClassLoader()
public ParameterList getContextParameters()
Copyright © 2011–2019 Asakusa Framework Team. All rights reserved.