You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by rf...@apache.org on 2007/05/06 20:59:27 UTC
svn commit: r535642 -
/incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/HeuristicPojoProcessor.java
Author: rfeng
Date: Sun May 6 11:59:26 2007
New Revision: 535642
URL: http://svn.apache.org/viewvc?view=rev&rev=535642
Log:
Exclude the method/field annotated with @Callback from property/reference list
Modified:
incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/HeuristicPojoProcessor.java
Modified: incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/HeuristicPojoProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/HeuristicPojoProcessor.java?view=diff&rev=535642&r1=535641&r2=535642
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/HeuristicPojoProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-xml/src/main/java/org/apache/tuscany/implementation/java/introspect/impl/HeuristicPojoProcessor.java Sun May 6 11:59:26 2007
@@ -77,7 +77,9 @@
private JavaInterfaceFactory javaFactory;
private JavaInterfaceIntrospector interfaceIntrospector;
- public HeuristicPojoProcessor(AssemblyFactory assemblyFactory, JavaInterfaceFactory javaFactory, JavaInterfaceIntrospector interfaceIntrospector) {
+ public HeuristicPojoProcessor(AssemblyFactory assemblyFactory,
+ JavaInterfaceFactory javaFactory,
+ JavaInterfaceIntrospector interfaceIntrospector) {
super(assemblyFactory);
this.interfaceIntrospector = interfaceIntrospector;
this.javaFactory = javaFactory;
@@ -145,6 +147,9 @@
if (!isPublicSetter(method)) {
continue;
}
+ if (method.isAnnotationPresent(Callback.class)) {
+ continue;
+ }
if (!isInServiceInterface(method, services)) {
// Not part of the service interface
String name = toPropertyName(method.getName());
@@ -168,6 +173,9 @@
if (!isProtectedSetter(method)) {
continue;
}
+ if (method.isAnnotationPresent(Callback.class)) {
+ continue;
+ }
Class<?> param = method.getParameterTypes()[0];
String name = toPropertyName(method.getName());
setters.add(name);
@@ -188,6 +196,9 @@
// for the same name
Set<Field> fields = getAllPublicAndProtectedFields(clazz);
for (Field field : fields) {
+ if (field.isAnnotationPresent(Callback.class)) {
+ continue;
+ }
if (setters.contains(field.getName())) {
continue;
}
@@ -298,8 +309,9 @@
}
}
- private void calcParamNames(JavaParameterImpl[] parameters, Map<String, JavaElementImpl> props, Map<String, JavaElementImpl> refs)
- throws AmbiguousConstructorException {
+ private void calcParamNames(JavaParameterImpl[] parameters,
+ Map<String, JavaElementImpl> props,
+ Map<String, JavaElementImpl> refs) throws AmbiguousConstructorException {
// the constructor param types must unambiguously match defined
// reference or property types
for (JavaParameterImpl param : parameters) {
@@ -603,14 +615,14 @@
JavaInterfaceContract interfaceContract = javaFactory.createJavaInterfaceContract();
service.setInterfaceContract(interfaceContract);
-
+
JavaInterface callInterface = interfaceIntrospector.introspect(interfaze);
service.getInterfaceContract().setInterface(callInterface);
if (callInterface.getCallbackClass() != null) {
JavaInterface callbackInterface = interfaceIntrospector.introspect(callInterface.getCallbackClass());
service.getInterfaceContract().setCallbackInterface(callbackInterface);
}
-
+
Interface javaInterface = service.getInterfaceContract().getInterface();
javaInterface.setRemotable(interfaze.getAnnotation(Remotable.class) != null);
service.getInterfaceContract().setInterface(javaInterface);
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org