Author: svkrish
Date: Mon Aug 13 10:32:37 2007
New Revision: 565449

URL: http://svn.apache.org/viewvc?view=rev&rev=565449
Log:
adding support for processing extension types metadata info from definitions.xml

Added:
    
incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/ExtensionTypeFactory.java
    
incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/BindingTypeImpl.java
    
incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/DefaultExtensionTypeFactory.java
    
incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/ExtensionTypeImpl.java
    
incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/ImplementationTypeImpl.java
Modified:
    
incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/ExtensionType.java

Modified: 
incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/ExtensionType.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/ExtensionType.java?view=diff&rev=565449&r1=565448&r2=565449
==============================================================================
--- 
incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/ExtensionType.java
 (original)
+++ 
incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/ExtensionType.java
 Mon Aug 13 10:32:37 2007
@@ -45,12 +45,27 @@
      * Returns the list of names of policy intents that will always be 
provided by this Extension Type
      * @ruturn list of Policy Intent names
      */
-    List<QName> getAlwaysProvidedPolicyIntents();
+    List<Intent> getAlwaysProvidedIntents();
     
     /**
      * Returns the list of names of policy intents that may be provided by 
this Extension Type thro
      * appropriate configuration
      * @ruturn list of Policy Intent names
      */
-    List<QName> getMayProvidePolicyIntents();
+    List<Intent> getMayProvideIntents();
+    
+
+    /**
+     * Returns true if the model element is unresolved.
+     * 
+     * @return true if the model element is unresolved.
+     */
+    boolean isUnresolved();
+
+    /**
+     * Sets whether the model element is unresolved.
+     * 
+     * @param unresolved whether the model element is unresolved
+     */
+    void setUnresolved(boolean unresolved);
 }

Added: 
incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/ExtensionTypeFactory.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/ExtensionTypeFactory.java?view=auto&rev=565449
==============================================================================
--- 
incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/ExtensionTypeFactory.java
 (added)
+++ 
incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/ExtensionTypeFactory.java
 Mon Aug 13 10:32:37 2007
@@ -0,0 +1,42 @@
+/*
+ * 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.policy;
+
+/**
+ * Factory interface for creating extension types meta data
+ * 
+ */
+public interface ExtensionTypeFactory {
+
+    /**
+     * Creates an ImplementationType instance to hold metadata related to
+     * a particular implementation extension in the SCA Domain
+     * 
+     * @return an instance of ImplementationType
+     */
+    ImplementationType createImplementationType();
+    
+    /**
+     * Creates an BindingType instance to hold metadata related to
+     * a particular binding extension in the SCA Domain
+     * 
+     * @return an instance of BindingType
+     */
+    BindingType createBindingType();
+}

Added: 
incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/BindingTypeImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/BindingTypeImpl.java?view=auto&rev=565449
==============================================================================
--- 
incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/BindingTypeImpl.java
 (added)
+++ 
incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/BindingTypeImpl.java
 Mon Aug 13 10:32:37 2007
@@ -0,0 +1,28 @@
+/*
+ * 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.policy.impl;
+
+import org.apache.tuscany.sca.policy.BindingType;
+
+/**
+ * Concrete implementation for a BindingType
+ * 
+ */
+public class BindingTypeImpl extends ExtensionTypeImpl implements BindingType {
+}

Added: 
incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/DefaultExtensionTypeFactory.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/DefaultExtensionTypeFactory.java?view=auto&rev=565449
==============================================================================
--- 
incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/DefaultExtensionTypeFactory.java
 (added)
+++ 
incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/DefaultExtensionTypeFactory.java
 Mon Aug 13 10:32:37 2007
@@ -0,0 +1,39 @@
+/*
+ * 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.policy.impl;
+
+import org.apache.tuscany.sca.policy.BindingType;
+import org.apache.tuscany.sca.policy.ExtensionTypeFactory;
+import org.apache.tuscany.sca.policy.ImplementationType;
+
+/**
+ * A Default concrete implementation for an ExtensionsTypeFactory
+ *
+ */
+public class DefaultExtensionTypeFactory implements ExtensionTypeFactory {
+
+    public BindingType createBindingType() {
+        return new BindingTypeImpl();
+    }
+
+    public ImplementationType createImplementationType() {
+        return new ImplementationTypeImpl();
+    }
+
+}

Added: 
incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/ExtensionTypeImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/ExtensionTypeImpl.java?view=auto&rev=565449
==============================================================================
--- 
incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/ExtensionTypeImpl.java
 (added)
+++ 
incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/ExtensionTypeImpl.java
 Mon Aug 13 10:32:37 2007
@@ -0,0 +1,65 @@
+/*
+ * 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.policy.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.policy.ExtensionType;
+import org.apache.tuscany.sca.policy.Intent;
+
+/**
+ * Concrete implementation for an Extension Type
+ *
+ */
+public abstract class ExtensionTypeImpl implements ExtensionType {
+    private List<Intent> alwaysProvides = new ArrayList<Intent>();
+    private List<Intent> mayProvides = new ArrayList<Intent>();
+    private QName typeName;
+    private boolean unResolved = true;
+    
+    public List<Intent> getAlwaysProvidedIntents() {
+        return alwaysProvides;
+    }
+
+    public List<Intent> getMayProvideIntents() {
+        return mayProvides;
+    }
+
+    public QName getTypeName() {
+        return typeName;
+    }
+
+    public void setTypeName(QName type) {
+        this.typeName = type;
+    }
+    
+    public boolean isUnresolved() {
+        return unResolved;
+    }
+
+    public void setUnresolved(boolean unresolved) {
+        this.unResolved = unresolved;
+    }
+
+    
+
+}

Added: 
incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/ImplementationTypeImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/ImplementationTypeImpl.java?view=auto&rev=565449
==============================================================================
--- 
incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/ImplementationTypeImpl.java
 (added)
+++ 
incubator/tuscany/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/ImplementationTypeImpl.java
 Mon Aug 13 10:32:37 2007
@@ -0,0 +1,28 @@
+/*
+ * 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.policy.impl;
+
+import org.apache.tuscany.sca.policy.ImplementationType;
+
+/**
+ * Concrete implementation for a Implementation Type
+ * 
+ */
+public class ImplementationTypeImpl extends ExtensionTypeImpl implements 
ImplementationType {
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to