177178179180181182183184185186187
Factory f; if (scope.factoryClass() == FactoryType.DEFAULT.class) { switch (scope.value()) { case Session: if (scope.args().length > 0) { f = new SessionFactory(cls, Boolean.parseBoolean(scope.args()[0])); } else { f = new SessionFactory(cls); } break; case PerRequest:
186187188189190191192193194195196
break; case PerRequest: f = new PerRequestFactory(cls); break; case Pooled: f = new PooledFactory(cls, Integer.parseInt(scope.args()[0])); break; case Spring: f = new SpringBeanFactory(scope.args()[0]); break; default:
189190191192193194195196197198199
break; case Pooled: f = new PooledFactory(cls, Integer.parseInt(scope.args()[0])); break; case Spring: f = new SpringBeanFactory(scope.args()[0]); break; default: f = new SingletonFactory(cls); break; }
198199200201202203204205206207208
break; } } else { try { f = (Factory)scope.factoryClass().getConstructor(Class.class, String[].class) .newInstance(cls, scope.args()); } catch (Throwable t) { throw new ServiceConstructionException(t); } } ((FactoryInvoker)i).setFactory(f);