|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jini.rio.associations.AssociationInjector
public class AssociationInjector
The AssociationInjector is an AssociationListener implementation that provides support for setter-based dependency injection by calling setters on a target object method when it receives association events. For example, we have a bean called Foo and it requires JavaSpace. In order to have the JavaSpace proxy set, a setter method is required :
public class Foo { JavaSpace myJavaSpace; ... public void setMyJavaSpace(JavaSpace space) { myJavaSpace = space; } ... }Finally, in the OperationalString, you'll need to create an Association with a Property attribute which matches the setter.
Constructor Summary | |
---|---|
AssociationInjector(Object target)
Create an AssociationInjector |
Method Summary | |
---|---|
void |
broken(Association association,
Object service)
Always inject a null if the association is broken |
void |
changed(Association association,
Object service)
Get the next service in the collection for injection |
void |
discovered(Association association,
Object service)
Notify the AssociationListener that an Association has been discovered |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AssociationInjector(Object target) throws IntrospectionException
target
- The object which will have dependencies injected
IntrospectionException
Method Detail |
---|
public void discovered(Association association, Object service)
AssociationListener
discovered
in interface AssociationListener
association
- The Associationservice
- The associated service that has been discoveredAssociationListener.discovered(Association, Object)
public void changed(Association association, Object service)
changed
in interface AssociationListener
association
- The Associationservice
- The service that was removed, changing the endpointAssociationListener.changed(Association, Object)
public void broken(Association association, Object service)
null
if the association is broken
broken
in interface AssociationListener
association
- The Association.service
- The service that was removed, causing the Association to
be brokenAssociationListener.broken(Association, Object)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |