/** * Create a service implementation. */ protected ProvidedServiceImplementation createImplementation(Implementation impl, Class<?> cma) { Class<?> cl = impl.value(); String exp = impl.expression().length()>0? impl.expression(): null; // If not specified (Object is default) or if user accidentally used pojo class -> ignore if(cl.equals(Object.class)) { cl = null; } else if(cl.equals(cma)) { cl = null; exp = "$pojoagent!=null? $pojoagent: $component"; System.out.println("Warning: ignoring implementation class because agent is service implementation"); } return new ProvidedServiceImplementation(cl, exp, impl.proxytype(), createBinding(impl.binding()), createUnparsedExpressions(impl.interceptors())); }
/** * Create a service implementation. */ protected ProvidedServiceImplementation createImplementation(Implementation impl) { return new ProvidedServiceImplementation(!impl.value().equals(Object.class)? impl.value(): null, impl.expression().length()>0? impl.expression(): null, impl.proxytype(), createBinding(impl.binding()), createUnparsedExpressions(impl.interceptors())); }
/** * Create a service binding. */ protected RequiredServiceBinding createBinding(Binding bd) { return bd==null || Implementation.BINDING_NULL.equals(bd.name()) ? null: new RequiredServiceBinding(bd.name(), bd.componentname().length()==0? null: bd.componentname(), bd.componenttype().length()==0? null: bd.componenttype(), bd.dynamic(), bd.scope(), bd.create(), bd.recover(), createUnparsedExpressions(bd.interceptors()), bd.proxytype(), bd.creationinfo().type().length()>0? createComponentInstanceInfo(bd.creationinfo()): null); }
/** * Create a service binding. */ protected RequiredServiceBinding createBinding(Binding bd) { return bd==null || Implementation.BINDING_NULL.equals(bd.name()) ? null: new RequiredServiceBinding(bd.name(), bd.componentname().length()==0? null: bd.componentname(), bd.componenttype().length()==0? null: bd.componenttype(), bd.dynamic(), bd.scope(), bd.create(), bd.recover(), createUnparsedExpressions(bd.interceptors()), bd.proxytype(), bd.creationinfo().type().length()>0? createComponentInstanceInfo(bd.creationinfo()): null); }
if(args.length>0) UnparsedExpression[] exps = createUnparsedExpressions(args); ret.setArguments(exps);
Publish p = vals[i].publish(); NameValue[] props = p.properties(); UnparsedExpression[] exps = createUnparsedExpressions(props); Publish p = provs[j].publish(); PublishInfo pi = p.publishid().length()==0? null: new PublishInfo(p.publishid(), p.publishtype(), p.mapping(), createUnparsedExpressions(p.properties())); ProvidedServiceInfo psi = new ProvidedServiceInfo(provs[j].name().length()>0? provs[j].name(): null, provs[j].type(), impl, pi);
if(args.length>0) UnparsedExpression[] exps = createUnparsedExpressions(args); ret.setArguments(exps);