|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnl.pbemengine.engine.ng.base.autowire.AutowireRepository
public class AutowireRepository
A repository for classes that can be autowired for a specific context. Please note that each Ruleset maintains its own set of autowire classes
| Field Summary | |
|---|---|
static java.lang.String |
ROOT_CONTEXT
Name of the root context |
| Method Summary | |
|---|---|
boolean |
accessible(java.lang.String context,
java.lang.Class c)
Check if we can autowire a certain class in the given context, or the root context |
java.lang.Object |
createWiredObject(java.lang.String context,
java.lang.Class target)
Create an autowired object according to the indicated context |
protected java.lang.Object |
createWiredObject(java.lang.String context,
java.lang.Class target,
java.util.LinkedList<java.lang.Class> current,
org.hibernate.Session session)
Create an autowired object according to the indicated context |
static AutowireRepository |
getInstance()
Get an instance of the AutowireRepository |
void |
registerClass(java.lang.String context,
java.lang.Class cl)
Register a class for a given context |
void |
setSessionFactory(org.hibernate.SessionFactory sessionFactory)
Set the Hibernate Session Factory for this Repository |
void |
unwire(java.lang.Object o,
java.lang.String context)
Checks an object and any autowired dependencies for Hibernate sessions, and closes them |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String ROOT_CONTEXT
| Method Detail |
|---|
public static AutowireRepository getInstance()
public void registerClass(java.lang.String context,
java.lang.Class cl)
context - The context in which the class is locatedcl - The class to addpublic void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
sessionFactory - The Session Factory
public boolean accessible(java.lang.String context,
java.lang.Class c)
context - The context to checkc - The class to check
true if we can autowire this class, false
otherwise
public java.lang.Object createWiredObject(java.lang.String context,
java.lang.Class target)
throws CircularReferenceException
context - The context of the objecttarget - The target class of the created object
null if something went seriously
wrong with trying to invoke the constructor
CircularReferenceException
protected java.lang.Object createWiredObject(java.lang.String context,
java.lang.Class target,
java.util.LinkedList<java.lang.Class> current,
org.hibernate.Session session)
throws CircularReferenceException
context - The context of the objecttarget - The target class of the created objectcurrent - A List of objects currently being autowiredsession - A Hibernate session created in earlier iterations - passed
to ensure only 1 is created for each autowired object and its dependencies
null if something went seriously
wrong with trying to invoke the constructor
CircularReferenceException
public void unwire(java.lang.Object o,
java.lang.String context)
o - The object to unwirecontext - The context in which the object was wired
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||