ServiceDefinition service = new ServiceDefinition(serviceName, contract); InjectingComponentType componentType = new InjectingComponentType(implClassName); componentType.add(service);
public TimerImplementation load(XMLStreamReader reader, IntrospectionContext context) throws XMLStreamException { Location startLocation = reader.getLocation(); TimerImplementation implementation = new TimerImplementation(); validateAttributes(reader, context, implementation); if (!processImplementationClass(implementation, reader, context)) { // an error with the implementation class, return a dummy implementation InjectingComponentType type = new InjectingComponentType(null); implementation.setComponentType(type); return implementation; } TimerData data = new TimerData(); implementation.setTimerData(data); String poolName = reader.getAttributeValue(null, "poolName"); if (poolName != null) { data.setPoolName(poolName); } processInitialDelay(data, reader, startLocation, context); processTimeUnit(data, reader, startLocation, context); processIntervalClass(reader, context, implementation); processRepeatInterval(reader, startLocation, context, implementation); processRepeatFixedRate(reader, startLocation, context, implementation); processFireOnce(reader, startLocation, context, implementation); processIntervalMethod(context, implementation); validateData(startLocation, context, data); loaderHelper.loadPolicySetsAndIntents(implementation, reader, context); InjectingComponentType componentType = implementationProcessor.introspect(implementation.getImplementationClass(), context); implementation.setComponentType(componentType); LoaderUtil.skipToEndElement(reader); return implementation; }
public InjectingComponentType introspect(String className, IntrospectionContext context) { InjectingComponentType componentType = new InjectingComponentType(className); componentType.setScope("STATELESS");
public void introspect(WebImplementation implementation, IntrospectionContext context) { WebComponentType componentType = new WebComponentType(); implementation.setComponentType(componentType); // load the servlet, filter and context listener classes referenced in the web.xml descriptor List<Class<?>> artifacts = xmlIntrospector.introspectArtifactClasses(context); for (Class<?> artifact : artifacts) { // introspect each class and generate a component type that will be merged into the web component type WebArtifactImplementation artifactImpl = new WebArtifactImplementation(); InjectingComponentType type = new InjectingComponentType(artifact.getName()); artifactImpl.setComponentType(type); TypeMapping mapping = context.getTypeMapping(artifact); if (mapping == null) { mapping = new TypeMapping(); context.addTypeMapping(artifact, mapping); helper.resolveTypeParameters(artifact, mapping); } IntrospectionContext childContext = new DefaultIntrospectionContext(context); classVisitor.visit(type, artifact, childContext); if (childContext.hasErrors()) { context.addErrors(childContext.getErrors()); } if (childContext.hasWarnings()) { context.addWarnings(childContext.getWarnings()); } // TODO apply heuristics mergeComponentTypes(implementation.getComponentType(), type, context); } }