summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/myfaces/src
diff options
context:
space:
mode:
Diffstat (limited to 'java/sca/modules/myfaces/src')
-rw-r--r--java/sca/modules/myfaces/src/main/java/org/apache/tuscany/myfaces/TuscanyAnnotationLifecycleProvider.java29
-rw-r--r--java/sca/modules/myfaces/src/main/java/org/apache/tuscany/myfaces/TuscanyAnnotationProcessor.java1
2 files changed, 5 insertions, 25 deletions
diff --git a/java/sca/modules/myfaces/src/main/java/org/apache/tuscany/myfaces/TuscanyAnnotationLifecycleProvider.java b/java/sca/modules/myfaces/src/main/java/org/apache/tuscany/myfaces/TuscanyAnnotationLifecycleProvider.java
index 2c470ffda2..a7152206eb 100644
--- a/java/sca/modules/myfaces/src/main/java/org/apache/tuscany/myfaces/TuscanyAnnotationLifecycleProvider.java
+++ b/java/sca/modules/myfaces/src/main/java/org/apache/tuscany/myfaces/TuscanyAnnotationLifecycleProvider.java
@@ -36,43 +36,24 @@ public class TuscanyAnnotationLifecycleProvider extends TomcatAnnotationLifecycl
private static Log log = LogFactory.getLog(TomcatAnnotationLifecycleProvider.class);
private TuscanyAnnotationProcessor annotationProcessor;
- private ExternalContext externalContext;
- private ServletContext sc;
+ private ServletContext servletContext;
public TuscanyAnnotationLifecycleProvider(ExternalContext externalContext) {
super(externalContext);
- this.externalContext = externalContext;
- this.sc = (ServletContext)externalContext.getContext();
- AnnotationProcessor ap = (org.apache.AnnotationProcessor)sc.getAttribute(org.apache.AnnotationProcessor.class.getName());
+ this.servletContext = (ServletContext)externalContext.getContext();
+ AnnotationProcessor ap = (org.apache.AnnotationProcessor)servletContext.getAttribute(org.apache.AnnotationProcessor.class.getName());
annotationProcessor = new TuscanyAnnotationProcessor(ap);
}
public Object newInstance(String className) throws InstantiationException, IllegalAccessException, InvocationTargetException, NamingException, ClassNotFoundException {
- System.out.println("foo newInstance: " + className);
-
- Class clazz = ClassUtils.classForName(className);
+ Class<?> clazz = ClassUtils.classForName(className);
log.info("Creating instance of " + className);
Object object = clazz.newInstance();
- annotationProcessor.processAnnotations(object, sc);
+ annotationProcessor.processAnnotations(object, servletContext);
annotationProcessor.postConstruct(object);
return object;
}
-// public boolean isAvailable() {
-// try {
-// ServletContext sc = (ServletContext)externalContext.getContext();
-// AnnotationProcessor ap = (org.apache.AnnotationProcessor)sc.getAttribute(org.apache.AnnotationProcessor.class.getName());
-//
-// annotationProcessor = new TuscanyAnnotationProcessor(ap);
-// sc.setAttribute(org.apache.AnnotationProcessor.class.getName(), annotationProcessor);
-//
-// return super.isAvailable();
-// } catch (Exception e) {
-// // ignore
-// }
-// return false;
-// }
-
}
diff --git a/java/sca/modules/myfaces/src/main/java/org/apache/tuscany/myfaces/TuscanyAnnotationProcessor.java b/java/sca/modules/myfaces/src/main/java/org/apache/tuscany/myfaces/TuscanyAnnotationProcessor.java
index 09aaac713a..bd9b19fd8c 100644
--- a/java/sca/modules/myfaces/src/main/java/org/apache/tuscany/myfaces/TuscanyAnnotationProcessor.java
+++ b/java/sca/modules/myfaces/src/main/java/org/apache/tuscany/myfaces/TuscanyAnnotationProcessor.java
@@ -44,7 +44,6 @@ public class TuscanyAnnotationProcessor implements org.apache.AnnotationProcesso
}
public void processAnnotations(Object arg0, ServletContext servletContext) throws IllegalAccessException, InvocationTargetException, NamingException {
- System.out.println("foo2 processAnnotations: " + arg0);
ContextHelper.inject(arg0, servletContext);
annotationProcessor.processAnnotations(arg0);
}