0 Replies Latest reply on Jun 17, 2010 1:52 AM by egor kolesnikov

    Any chances Component.checkNonAbstract() to be protected?

    egor kolesnikov Newbie


      I'm trying to inject RestEasy client interfaces as Seam components. While it's pretty straightforward with @Unwrap pattern, using IoCComponent approach appears to be a bit tricky.

      I can instantiate the bean using resteasy ProxyFactory and inject it into Application context, but for now I have to pass Object.class and thus Component.getInstance(Class c) call is not available.

      This is my interface:

      public interface BasicClient {
           List<Customer> getAllBy(String data);

      This is component wrapper from Seam-IOC:

      @Install(precedence = BUILT_IN, classDependencies = "org.jboss.resteasy.spi.ResteasyProviderFactory")
      public class ResteasyClientBootstrap {
           public void init() {
      // blah-blah-blah class scanning and initialisation skipped
                     componentName + Initialization.COMPONENT_SUFFIX,
      *               new RestEasyClientComponent(Object.class, // GOTCHA!*
                       componentName, ScopeType.STATELESS, beanClass));

      And RestEasyClientComponent looks like this:

      public class RestEasyClientComponent extends IoCComponent {
           private Class interfaceClass;
           public RestEasyClientComponent(Class clazz, String name, ScopeType scope, Class interfaceClass) {
                super(clazz, name, scope);
                this.interfaceClass = interfaceClass;
           protected Object instantiateIoCBean() throws Exception {
                return ProxyFactory.create(interfaceClass, "http://localhost/rest/");
           protected String getIoCName() {
                return null;