You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by lr...@apache.org on 2008/12/09 01:25:09 UTC
svn commit: r724566 - in /tuscany/java/sca/modules/implementation-pojo:
META-INF/ src/main/java/org/apache/tuscany/sca/pojo/
src/main/java/org/apache/tuscany/sca/pojo/impl/
src/main/resources/META-INF/ src/main/resources/META-INF/services/
Author: lresende
Date: Mon Dec 8 16:25:09 2008
New Revision: 724566
URL: http://svn.apache.org/viewvc?rev=724566&view=rev
Log:
Adding factory for common java artifacts model objects
Added:
tuscany/java/sca/modules/implementation-pojo/src/main/java/org/apache/tuscany/sca/pojo/JavaFactory.java (with props)
tuscany/java/sca/modules/implementation-pojo/src/main/java/org/apache/tuscany/sca/pojo/impl/JavaFactoryImpl.java (with props)
tuscany/java/sca/modules/implementation-pojo/src/main/resources/META-INF/
tuscany/java/sca/modules/implementation-pojo/src/main/resources/META-INF/services/
tuscany/java/sca/modules/implementation-pojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.pojo.JavaFactory
Modified:
tuscany/java/sca/modules/implementation-pojo/META-INF/MANIFEST.MF
tuscany/java/sca/modules/implementation-pojo/src/main/java/org/apache/tuscany/sca/pojo/impl/JavaElementImpl.java
Modified: tuscany/java/sca/modules/implementation-pojo/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-pojo/META-INF/MANIFEST.MF?rev=724566&r1=724565&r2=724566&view=diff
==============================================================================
--- tuscany/java/sca/modules/implementation-pojo/META-INF/MANIFEST.MF (original)
+++ tuscany/java/sca/modules/implementation-pojo/META-INF/MANIFEST.MF Mon Dec 8 16:25:09 2008
@@ -1,11 +1,5 @@
Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.implementation.java.introspect;
- uses:="org.apache.tuscany.sca.assembly,org.apache.tuscany.sca.impleme
- ntation.java,org.osoa.sca";version="1.4",org.apache.tuscany.sca.imple
- mentation.java;uses:="org.apache.tuscany.sca.assembly,org.apache.tusc
- any.sca.implementation.java.introspect,org.apache.tuscany.sca.core,or
- g.apache.tuscany.sca.policy,org.apache.tuscany.sca.interfacedef.java"
- ;version="1.4"
+Export-Package: org.apache.tuscany.sca.pojo
Private-Package: org.apache.tuscany.sca.implementation.java.impl;versi
on="1.4",org.apache.tuscany.sca.implementation.java.introspect.impl;v
ersion="1.4"
@@ -20,12 +14,9 @@
Bundle-Description: Apache Tuscany SCA Java Implementation Model
Import-Package: javax.jws,
javax.xml.namespace,
-
org.apache.tuscany.sca.assembly;version="1.4",
org.apache.tuscany.sca.assembly.impl;version="1.4",
org.apache.tuscany.sca.core;version="1.4",
- org.apache.tuscany.sca.implementation.java;version="1.4",
- org.apache.tuscany.sca.implementation.java.introspect;version="1.4",
org.apache.tuscany.sca.interfacedef;version="1.4",
org.apache.tuscany.sca.interfacedef.java;version="1.4",
org.apache.tuscany.sca.interfacedef.java.impl;version="1.4";resolution:=optional,
Added: tuscany/java/sca/modules/implementation-pojo/src/main/java/org/apache/tuscany/sca/pojo/JavaFactory.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-pojo/src/main/java/org/apache/tuscany/sca/pojo/JavaFactory.java?rev=724566&view=auto
==============================================================================
--- tuscany/java/sca/modules/implementation-pojo/src/main/java/org/apache/tuscany/sca/pojo/JavaFactory.java (added)
+++ tuscany/java/sca/modules/implementation-pojo/src/main/java/org/apache/tuscany/sca/pojo/JavaFactory.java Mon Dec 8 16:25:09 2008
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.pojo;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+
+/**
+ * Factory for the Java model used during introspection of java class/interfaces
+ *
+ * @version $Rev$ $Date$
+ */
+
+public interface JavaFactory {
+
+ /**
+ * Create a model representing a java constructor
+ * @param clazz
+ * @return the java constructor
+ */
+ JavaConstructor<?> createJavaConstructor(Constructor<?> constructor);
+
+ /**
+ * Create model representing a java class
+ * @param clazz the class
+ * @return the java element representing the class
+ */
+ JavaElement createJavaElement(Class<?> clazz);
+
+ /**
+ * Create a model representing a java property
+ * @param field the property
+ * @return the java element representing the property
+ */
+ JavaElement createJavaElement(Field field);
+
+ /**
+ * Create a model representing a java constructor
+ * @param constructor the constructor
+ * @param index the constructor position
+ * @return the java element representing the constructor
+ */
+ JavaElement createJavaElement(Constructor<?> constructor, int index);
+
+ /**
+ * Create a model representing a java method
+ * @param method the method
+ * @param index the method position
+ * @return the java element representing the constructor
+ */
+ JavaElement createJavaElement(Method method, int index);
+
+ /**
+ * Create a model representing a java parameter
+ * @return the parameter
+ */
+ JavaParameter createJavaParameter(Constructor<?> constructor, int index);
+
+ /**
+ * Create a model representing a java resource
+ * @return
+ */
+ JavaResource createJavaResource(JavaElement element);
+
+}
\ No newline at end of file
Propchange: tuscany/java/sca/modules/implementation-pojo/src/main/java/org/apache/tuscany/sca/pojo/JavaFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/java/sca/modules/implementation-pojo/src/main/java/org/apache/tuscany/sca/pojo/JavaFactory.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: tuscany/java/sca/modules/implementation-pojo/src/main/java/org/apache/tuscany/sca/pojo/impl/JavaElementImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-pojo/src/main/java/org/apache/tuscany/sca/pojo/impl/JavaElementImpl.java?rev=724566&r1=724565&r2=724566&view=diff
==============================================================================
--- tuscany/java/sca/modules/implementation-pojo/src/main/java/org/apache/tuscany/sca/pojo/impl/JavaElementImpl.java (original)
+++ tuscany/java/sca/modules/implementation-pojo/src/main/java/org/apache/tuscany/sca/pojo/impl/JavaElementImpl.java Mon Dec 8 16:25:09 2008
@@ -44,12 +44,12 @@
private String name;
private Class<? extends Annotation> classifer;
- public JavaElementImpl(Class<?> cls) {
- this.anchor = cls;
+ public JavaElementImpl(Class<?> clazz) {
+ this.anchor = clazz;
this.elementType = ElementType.TYPE;
- this.type = cls;
- this.genericType = cls;
- this.name = cls.getName();
+ this.type = clazz;
+ this.genericType = clazz;
+ this.name = clazz.getName();
}
public JavaElementImpl(Field field) {
Added: tuscany/java/sca/modules/implementation-pojo/src/main/java/org/apache/tuscany/sca/pojo/impl/JavaFactoryImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-pojo/src/main/java/org/apache/tuscany/sca/pojo/impl/JavaFactoryImpl.java?rev=724566&view=auto
==============================================================================
--- tuscany/java/sca/modules/implementation-pojo/src/main/java/org/apache/tuscany/sca/pojo/impl/JavaFactoryImpl.java (added)
+++ tuscany/java/sca/modules/implementation-pojo/src/main/java/org/apache/tuscany/sca/pojo/impl/JavaFactoryImpl.java Mon Dec 8 16:25:09 2008
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.pojo.impl;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+
+import org.apache.tuscany.sca.pojo.JavaConstructor;
+import org.apache.tuscany.sca.pojo.JavaElement;
+import org.apache.tuscany.sca.pojo.JavaFactory;
+import org.apache.tuscany.sca.pojo.JavaParameter;
+import org.apache.tuscany.sca.pojo.JavaResource;
+
+/**
+ * Factory for the Java model used during introspection of java class/interfaces
+ *
+ * @version $Rev$ $Date$
+ */
+
+public class JavaFactoryImpl implements JavaFactory {
+
+ public void JavaFactory() {
+
+ }
+
+ public JavaConstructor<?> createJavaConstructor(Constructor<?> constructor){
+ return new JavaConstructorImpl(constructor);
+ }
+
+ public JavaElement createJavaElement(Class<?> clazz) {
+ return new JavaElementImpl(clazz);
+ }
+
+ public JavaElement createJavaElement(Field field){
+ return new JavaElementImpl(field);
+
+ }
+
+ public JavaElement createJavaElement(Constructor<?> constructor, int index) {
+ return new JavaElementImpl(constructor, index);
+
+ }
+
+ public JavaElement createJavaElement(Method method, int index) {
+ return new JavaElementImpl(method, index);
+ }
+
+ public JavaParameter createJavaParameter(Constructor<?> constructor, int index) {
+ return new JavaParameterImpl(constructor, index);
+ }
+
+ public JavaResource createJavaResource(JavaElement element) {
+ return new JavaResourceImpl(element);
+ }
+
+}
+
Propchange: tuscany/java/sca/modules/implementation-pojo/src/main/java/org/apache/tuscany/sca/pojo/impl/JavaFactoryImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/java/sca/modules/implementation-pojo/src/main/java/org/apache/tuscany/sca/pojo/impl/JavaFactoryImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: tuscany/java/sca/modules/implementation-pojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.pojo.JavaFactory
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-pojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.pojo.JavaFactory?rev=724566&view=auto
==============================================================================
--- tuscany/java/sca/modules/implementation-pojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.pojo.JavaFactory (added)
+++ tuscany/java/sca/modules/implementation-pojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.pojo.JavaFactory Mon Dec 8 16:25:09 2008
@@ -0,0 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
+# Implementation class for the java model factory
+org.apache.tuscany.sca.pojo.impl.JavaFactoryImpl
\ No newline at end of file