@ApplicationScoped public class WorkspaceManager extends Object
Constructor and Description |
---|
WorkspaceManager() |
WorkspaceManager(WorkspaceManagerPreferences workspaceManagerPreferences) |
Modifier and Type | Method and Description |
---|---|
protected com.google.common.cache.Cache<String,Object> |
createCache() |
void |
delete(Workspace workspace)
Deletes a workspace and its beans
|
<T> T |
getBean(Workspace workspace,
String beanName)
Returns a bean based on a workspace and a bean name.
|
long |
getBeansCount(Workspace workspace)
Return the beans count for a workspace
|
Workspace |
getOrCreateWorkspace(String name)
Returns a workspace, but if it does not exists, it creates a new one.
|
Workspace |
getWorkspace(String name)
Returns a workspace.
|
int |
getWorkspaceCount()
Returns the workspace count
|
void |
initialize() |
<T> void |
putBean(Workspace workspace,
String beanName,
T instance)
Put a bean instance into a Workspace.
|
public WorkspaceManager()
@Inject public WorkspaceManager(WorkspaceManagerPreferences workspaceManagerPreferences)
@PostConstruct public void initialize()
public Workspace getOrCreateWorkspace(String name)
name
- The name of the workspace.public Workspace getWorkspace(String name)
NoSuchElementException
name
- Workspace namepublic <T> T getBean(Workspace workspace, String beanName)
workspace
- The workspace name.beanName
- The bean name for that workspace.public <T> void putBean(Workspace workspace, String beanName, T instance)
workspace
- The workspace to store beansbeanName
- The bean nameinstance
- The bean instancepublic void delete(Workspace workspace)
workspace
- the workspace to deletepublic int getWorkspaceCount()
public long getBeansCount(Workspace workspace)
workspace
- The workspace to count beansCopyright © 2012–2020 JBoss by Red Hat. All rights reserved.