• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

how to get actual target source from proxy

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello

need help to reference actual component from proxy.
Seam component is injected into a spring bean. Methods of seam component are required to be accessed inside the spring bean .

Does anyone have any example of using seam components in spring beans especially with proxy ?



I have a seam component injected in spring bean as follows.
SPRING CONTEXT below------------------------------------------------------
<seam:instance name="compSeam" create="true" scope="STATELESS" id="compSeam" proxy="true"/>

<beans:bean id="beanSpring"
class="com.sys.authentication.ASpringBean" >
<beans:property name="compSeam" > <beans:ref local="compSeam" />
</beans:property>
</beans:bean>


SPRING BEAN CLASS below----------------------------------------------------------
package com.sys.authentication;

public class ASpringBean {

ASeamComponent compSeam;

public void setCompSeam(ASeamComponent compSeam) {

System.out.println("Setting Seam AseamComponent in ASpring bean ");

this.compSeam = compSeam;

}

public ASeamComponent getCompSeam() {

return this.compSeam;

}

public String getSpringBeanUsername() {
return "Spring - username";
}

public String getSeamComponentUserName() { /---------------this method is giving error as envocationexception //
return compSeam.getUsername(); //
}

}

SEAM COMPONENT below------------------------------------------------------
package com.sys.authentication;

import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;

@Scope(ScopeType.STATELESS)
@Name("aSeam")
public class ASeamComponent {

public String getUsername() {
return "Seam - username";
}

}


This gives erorr on accessing the seam component's method
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic