[jboss-user] [JBoss Seam] - Injection and disinjection control

msystems do-not-reply at jboss.com
Sun Nov 26 09:57:57 EST 2006


I have two Java Beans, Bean A (scope: session) and Bean B (scope: event). Bean A is injected
into Bean B. E.g.

Class A {
    ...
    ...
    ...
}

Class B {
	protected Object var;
	
	@In(value = "ASession", create = true)
	void setVar(Object var) {
		this.var = var;
		
		do something !
		...
		...
	}

	void doSomething1() {
	}
		
	void doSomething2() {
	}

	void doSomething3() {
	}
	
	...
	...
}

Each method invocation on Bean B results in an injection and disinjection.

In mine particularly case it's totally unnecessary to inject and disinject at each method invocation. I only need
an injection when an instance of class B is created.

Because of the current design of Seam my setVar() method is executed between 500 - 5000 (depends on the situation)
times by the BijectionInterceptor.bijectTargetComponent() and the state of the injected object is the same each time.

It would be very nice, if I could control the injection and disinjection, e.g.

	@In(oneInjection = true, disinjection = false, value = "ASession", create = true)
	void setVar(Object var) {
		this.var = var;
		
		do something !
		...
		...
	}
 
oneInjection = true // only inject one time.
disinjection = false // don't disinject

Could Seam support something like that?

Regards
Kenneth


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3988620#3988620

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3988620



More information about the jboss-user mailing list