From 6393bfe8f17d21b355518c24cdc152233254bdfd Mon Sep 17 00:00:00 2001 From: lresende Date: Sat, 4 Apr 2009 00:11:14 +0000 Subject: Refactoring javascript extension points packages to follow the same naming pattern used by it's modules. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@761842 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca/core/web/ComponentJavaScriptGenerator.java | 59 ------ ...ComponentJavaScriptGeneratorExtensionPoint.java | 56 ----- ...ComponentJavaScriptGeneratorExtensionPoint.java | 154 -------------- ...efaultJavascriptProxyFactoryExtensionPoint.java | 225 --------------------- .../sca/core/web/JavascriptProxyFactory.java | 69 ------- .../web/JavascriptProxyFactoryExtensionPoint.java | 52 ----- .../javascript/ComponentJavaScriptGenerator.java | 59 ++++++ ...ComponentJavaScriptGeneratorExtensionPoint.java | 56 +++++ ...ComponentJavaScriptGeneratorExtensionPoint.java | 154 ++++++++++++++ ...efaultJavascriptProxyFactoryExtensionPoint.java | 225 +++++++++++++++++++++ .../sca/web/javascript/JavascriptProxyFactory.java | 69 +++++++ .../JavascriptProxyFactoryExtensionPoint.java | 52 +++++ ....web.ComponentJavaScriptGeneratorExtensionPoint | 18 -- ...a.core.web.JavascriptProxyFactoryExtensionPoint | 18 -- ...ript.ComponentJavaScriptGeneratorExtensionPoint | 18 ++ ...javascript.JavascriptProxyFactoryExtensionPoint | 18 ++ .../core-web-validation-messages.properties | 21 -- .../web-javascript-validation-messages.properties | 21 ++ 18 files changed, 672 insertions(+), 672 deletions(-) delete mode 100644 branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/core/web/ComponentJavaScriptGenerator.java delete mode 100644 branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/core/web/ComponentJavaScriptGeneratorExtensionPoint.java delete mode 100644 branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/core/web/DefaultComponentJavaScriptGeneratorExtensionPoint.java delete mode 100644 branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/core/web/DefaultJavascriptProxyFactoryExtensionPoint.java delete mode 100644 branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/core/web/JavascriptProxyFactory.java delete mode 100644 branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/core/web/JavascriptProxyFactoryExtensionPoint.java create mode 100644 branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/web/javascript/ComponentJavaScriptGenerator.java create mode 100644 branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/web/javascript/ComponentJavaScriptGeneratorExtensionPoint.java create mode 100644 branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/web/javascript/DefaultComponentJavaScriptGeneratorExtensionPoint.java create mode 100644 branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/web/javascript/DefaultJavascriptProxyFactoryExtensionPoint.java create mode 100644 branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/web/javascript/JavascriptProxyFactory.java create mode 100644 branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/web/javascript/JavascriptProxyFactoryExtensionPoint.java delete mode 100644 branches/sca-java-1.x/modules/web-javascript/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.web.ComponentJavaScriptGeneratorExtensionPoint delete mode 100644 branches/sca-java-1.x/modules/web-javascript/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.web.JavascriptProxyFactoryExtensionPoint create mode 100644 branches/sca-java-1.x/modules/web-javascript/src/main/resources/META-INF/services/org.apache.tuscany.sca.web.javascript.ComponentJavaScriptGeneratorExtensionPoint create mode 100644 branches/sca-java-1.x/modules/web-javascript/src/main/resources/META-INF/services/org.apache.tuscany.sca.web.javascript.JavascriptProxyFactoryExtensionPoint delete mode 100644 branches/sca-java-1.x/modules/web-javascript/src/main/resources/core-web-validation-messages.properties create mode 100644 branches/sca-java-1.x/modules/web-javascript/src/main/resources/web-javascript-validation-messages.properties (limited to 'branches/sca-java-1.x/modules/web-javascript/src') diff --git a/branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/core/web/ComponentJavaScriptGenerator.java b/branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/core/web/ComponentJavaScriptGenerator.java deleted file mode 100644 index 2f9ba42bc4..0000000000 --- a/branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/core/web/ComponentJavaScriptGenerator.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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.core.web; - -import java.io.IOException; -import java.io.PrintWriter; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.runtime.RuntimeComponent; - - -/** - * Widget component script generator interface - * This generates the necessary JavaScript client code into a single JavaScript per component - * - * @version $Rev$ $Date$ - */ -public interface ComponentJavaScriptGenerator { - - /** - * Return the QName that identify the Component script generator - * This is used to identify different generators supporting different JavaScript frameworks - * - * @return The QName - */ - QName getQName(); - - /** - * Generate the Java Script code for a given component - * - generate/append client proxyies as needed - * - generate tuscany namespace as needed - * - generate properties for JavaScript injection - * - generate references for JavaScript injection - * - * @param component The SCA Component to be used - * @param pw A Print Writer where the script should be written to - * @throws IOException - */ - void generateJavaScriptCode(RuntimeComponent component, PrintWriter pw) throws IOException; - -} diff --git a/branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/core/web/ComponentJavaScriptGeneratorExtensionPoint.java b/branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/core/web/ComponentJavaScriptGeneratorExtensionPoint.java deleted file mode 100644 index c2cba59362..0000000000 --- a/branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/core/web/ComponentJavaScriptGeneratorExtensionPoint.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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.core.web; - -import java.util.List; - -import javax.xml.namespace.QName; - -/** - * Widget component script generator extension pointinterface - * - * @version $Rev$ $Date$ - */ -public interface ComponentJavaScriptGeneratorExtensionPoint { - - /** - * Add a component script generator - * @param componentScriptGenerator - */ - void addComponentJavaScriptGenerator(ComponentJavaScriptGenerator componentScriptGenerator); - - /** - * Remove a component script generator - * @param componentScriptGenerator - */ - void removeComponentJavaScriptGenerator(ComponentJavaScriptGenerator componentScriptGenerator); - - /** - * Get a component scrpt generator instance based on QName - * @param bindingName - * @return - */ - ComponentJavaScriptGenerator getComponentJavaScriptGenerator(QName bindingName); - - /** - * Get a list of component script generator instances - */ - List getComponentJavaScriptGenerators(); -} diff --git a/branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/core/web/DefaultComponentJavaScriptGeneratorExtensionPoint.java b/branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/core/web/DefaultComponentJavaScriptGeneratorExtensionPoint.java deleted file mode 100644 index 121baba47b..0000000000 --- a/branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/core/web/DefaultComponentJavaScriptGeneratorExtensionPoint.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * 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.core.web; - -import java.io.IOException; -import java.lang.reflect.Constructor; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl; -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.core.UtilityExtensionPoint; -import org.apache.tuscany.sca.extensibility.ServiceDeclaration; -import org.apache.tuscany.sca.extensibility.ServiceDiscovery; -import org.apache.tuscany.sca.monitor.Monitor; -import org.apache.tuscany.sca.monitor.MonitorFactory; -import org.apache.tuscany.sca.monitor.Problem; -import org.apache.tuscany.sca.monitor.Problem.Severity; - - -/** - * Default extension point for widget component script generator - * - * @version $Rev$ $Date$ - */ -public class DefaultComponentJavaScriptGeneratorExtensionPoint implements ComponentJavaScriptGeneratorExtensionPoint { - private final List generators = new ArrayList(); - private final Map generatorsByQName = new HashMap(); - - private ExtensionPointRegistry extensionPoints; - private Monitor monitor = null; - - private boolean loaded = false; - - public DefaultComponentJavaScriptGeneratorExtensionPoint(ExtensionPointRegistry extensionPoints) { - this.extensionPoints = extensionPoints; - - UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class); - MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class); - if (monitorFactory != null) { - this.monitor = monitorFactory.createMonitor(); - } - } - - /** - * Report a exception. - * - * @param problems - * @param message - * @param model - */ - private void error(String message, Object model, Exception ex) { - if (monitor != null) { - Problem problem = new ProblemImpl(this.getClass().getName(), "core-web-validation-messages", Severity.ERROR, model, message, ex); - monitor.problem(problem); - } - } - - public void addComponentJavaScriptGenerator(ComponentJavaScriptGenerator componentScriptGenerator) { - if (componentScriptGenerator.getQName() != null) { - generatorsByQName.put(componentScriptGenerator.getQName(), componentScriptGenerator); - } - - generators.add(componentScriptGenerator); - } - - public void removeComponentJavaScriptGenerator(ComponentJavaScriptGenerator componentScriptGenerator) { - if (componentScriptGenerator.getQName() != null) { - generatorsByQName.remove(componentScriptGenerator.getQName()); - } - - generators.remove(componentScriptGenerator); - } - - - public ComponentJavaScriptGenerator getComponentJavaScriptGenerator(QName bindingName) { - loadFactories(); - return generatorsByQName.get(bindingName); - } - - public List getComponentJavaScriptGenerators() { - loadFactories(); - return this.generators; - } - - /** - * Private Utility methods - */ - - - /** - * Lazily load artifact processors registered in the extension point. - */ - @SuppressWarnings("unchecked") - private synchronized void loadFactories() { - if (loaded) { - return; - } - - // Get the proxy factories declarations - Set factoryDeclarations = null; - try { - factoryDeclarations = ServiceDiscovery.getInstance().getServiceDeclarations(ComponentJavaScriptGenerator.class); - } catch (IOException e) { - IllegalStateException ie = new IllegalStateException(e); - error("IllegalStateException", factoryDeclarations, ie); - throw ie; - } - - for (ServiceDeclaration processorDeclaration : factoryDeclarations) { - // Create a factory, and register it - ComponentJavaScriptGenerator generator = null; - try { - Class generatorClass = processorDeclaration.loadClass(); - - Constructor constructor = generatorClass.getConstructor(ExtensionPointRegistry.class); - generator = constructor.newInstance(extensionPoints); - - } catch (Exception e) { - IllegalStateException ie = new IllegalStateException(e); - error("IllegalStateException", generator, ie); - throw ie; - } - - addComponentJavaScriptGenerator(generator); - } - - loaded = true; - } - - -} diff --git a/branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/core/web/DefaultJavascriptProxyFactoryExtensionPoint.java b/branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/core/web/DefaultJavascriptProxyFactoryExtensionPoint.java deleted file mode 100644 index 1c6097834f..0000000000 --- a/branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/core/web/DefaultJavascriptProxyFactoryExtensionPoint.java +++ /dev/null @@ -1,225 +0,0 @@ -/* - * 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.core.web; - -import java.io.IOException; -import java.lang.reflect.Constructor; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl; -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.core.UtilityExtensionPoint; -import org.apache.tuscany.sca.extensibility.ServiceDeclaration; -import org.apache.tuscany.sca.extensibility.ServiceDiscovery; -import org.apache.tuscany.sca.monitor.Monitor; -import org.apache.tuscany.sca.monitor.MonitorFactory; -import org.apache.tuscany.sca.monitor.Problem; -import org.apache.tuscany.sca.monitor.Problem.Severity; - -/** - * Default extension point for javascript proxy factories - * - * @version $Rev$ $Date$ - */ -public class DefaultJavascriptProxyFactoryExtensionPoint implements JavascriptProxyFactoryExtensionPoint { - private final Map factoriesByQName = new HashMap(); - private final Map, JavascriptProxyFactory> factoriesByType = new HashMap, JavascriptProxyFactory>(); - - private Monitor monitor = null; - - private boolean loaded = false; - - public DefaultJavascriptProxyFactoryExtensionPoint(ExtensionPointRegistry extensionPoints) { - UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class); - MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class); - if (monitorFactory != null) { - this.monitor = monitorFactory.createMonitor(); - } - } - - /** - * Report a exception. - * - * @param problems - * @param message - * @param model - */ - private void error(String message, Object model, Exception ex) { - if (monitor != null) { - Problem problem = new ProblemImpl(this.getClass().getName(), "core-web-validation-messages", Severity.ERROR, model, message, ex); - monitor.problem(problem); - } - } - - public void addProxyFactory(JavascriptProxyFactory javascriptProxyfactory) { - if (javascriptProxyfactory.getModelType() != null) { - factoriesByType.put(javascriptProxyfactory.getModelType(), javascriptProxyfactory); - } - if (javascriptProxyfactory.getQName() != null) { - factoriesByQName.put(javascriptProxyfactory.getQName(), javascriptProxyfactory); - } - } - - public void removeProxyFactory(JavascriptProxyFactory javascriptProxyfactory) { - if (javascriptProxyfactory.getModelType() != null) { - factoriesByType.remove(javascriptProxyfactory.getModelType()); - } - if (javascriptProxyfactory.getQName() != null) { - factoriesByQName.remove(javascriptProxyfactory.getQName()); - } - } - - public JavascriptProxyFactory getProxyFactory(QName bindingName) { - loadFactories(); - return factoriesByQName.get(bindingName); - } - - public JavascriptProxyFactory getProxyFactory(Class bindingType) { - loadFactories(); - Class[] classes = bindingType.getInterfaces(); - for (Class c : classes) { - JavascriptProxyFactory proxyFactory = factoriesByType.get(c); - if (proxyFactory != null) { - return proxyFactory; - } - } - - //here we didn't find the proxy factory for the biding - JavascriptProxyFactory factory = null; - if (bindingType.isInterface()) { - // Dynamically load a factory class declared under META-INF/services - try { - Class factoryClass = ServiceDiscovery.getInstance().loadFirstServiceClass(bindingType); - if (factoryClass != null) { - - try { - // Default empty constructor - Constructor constructor = factoryClass.getConstructor(); - factory = (JavascriptProxyFactory) constructor.newInstance(); - } catch (NoSuchMethodException e) { - - // Constructor taking the model factory extension point - Constructor constructor = factoryClass.getConstructor(ModelFactoryExtensionPoint.class); - factory = (JavascriptProxyFactory) constructor.newInstance(this); - } - - // Cache the loaded factory - addProxyFactory(factory); - } - } catch (Exception e) { - throw new IllegalArgumentException(e); - } - } else { - - // Call the newInstance static method on the factory abstract class - try { - factory = (JavascriptProxyFactory) ServiceDiscovery.getInstance().newFactoryClassInstance(bindingType); - } catch (Exception e) { - throw new IllegalArgumentException(e); - } - - // Cache the factory - addProxyFactory(factory); - } - - return factory; - } - - /** - * Private Utility methods - */ - - /** - * Returns a QName object from a QName expressed as {ns}name - * or ns#name. - * - * @param qname - * @return - */ - private static QName getQName(String qname) { - if (qname == null) { - return null; - } - qname = qname.trim(); - if (qname.startsWith("{")) { - int h = qname.indexOf('}'); - if (h != -1) { - return new QName(qname.substring(1, h), qname.substring(h + 1)); - } - } else { - int h = qname.indexOf('#'); - if (h != -1) { - return new QName(qname.substring(0, h), qname.substring(h + 1)); - } - } - throw new IllegalArgumentException("Invalid qname: "+qname); - } - - /** - * Lazily load artifact processors registered in the extension point. - */ - private synchronized void loadFactories() { - if (loaded) { - return; - } - - // Get the proxy factories declarations - Set factoryDeclarations = null; - try { - factoryDeclarations = ServiceDiscovery.getInstance().getServiceDeclarations(JavascriptProxyFactory.class); - } catch (IOException e) { - IllegalStateException ie = new IllegalStateException(e); - error("IllegalStateException", factoryDeclarations, ie); - throw ie; - } - - for (ServiceDeclaration processorDeclaration : factoryDeclarations) { - Map attributes = processorDeclaration.getAttributes(); - - // Load a StAX artifact processor - - // Get the model QName - QName artifactType = getQName(attributes.get("qname")); - - // Get the model class name - String modelTypeName = attributes.get("model"); - - // Create a factory, and register it - JavascriptProxyFactory proxyFactory = null; - try { - proxyFactory = (JavascriptProxyFactory) processorDeclaration.loadClass().newInstance(); - } catch (Exception e) { - IllegalStateException ie = new IllegalStateException(e); - error("IllegalStateException", proxyFactory, ie); - throw ie; - } - - addProxyFactory(proxyFactory); - } - - loaded = true; - } - -} diff --git a/branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/core/web/JavascriptProxyFactory.java b/branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/core/web/JavascriptProxyFactory.java deleted file mode 100644 index daac7925bd..0000000000 --- a/branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/core/web/JavascriptProxyFactory.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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.core.web; - -import java.io.IOException; -import java.io.InputStream; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.ComponentReference; - -/** - * Javascript Proxy Factory used to allow Web related bindings to generate - * client js proxyies - * - * @version $Rev$ $Date$ - */ -public interface JavascriptProxyFactory { - - /** - * The binding model type associated with this factory - * @return the binding model type - */ - Class getModelType(); - - /** - * The binding qname associated with this factory - * @return the binding qname - */ - QName getQName(); - - /** - * Get the Javascript proxy client file name - * @return the javascript file name - */ - String getJavascriptProxyFile(); - - /** - * Get the Javascript proxy client contents as a stream - * @return - */ - InputStream getJavascriptProxyFileAsStream() throws IOException; - - - /** - * Create a JavaScript Proxy for a given reference - * @param componentReference The reference - * @return the javascript proxy code - * @throws IOException - */ - String createJavascriptReference(ComponentReference componentReference) throws IOException; -} diff --git a/branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/core/web/JavascriptProxyFactoryExtensionPoint.java b/branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/core/web/JavascriptProxyFactoryExtensionPoint.java deleted file mode 100644 index c396a02b30..0000000000 --- a/branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/core/web/JavascriptProxyFactoryExtensionPoint.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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.core.web; - -import javax.xml.namespace.QName; - -public interface JavascriptProxyFactoryExtensionPoint { - /** - * Add Javascript proxy factory - * - * @param javascriptProxyfactory The Javascript proxy factory - */ - void addProxyFactory(JavascriptProxyFactory javascriptProxyfactory); - - /** - * Remove Javascript proxy factory - * - * @param javascriptProxyfactory The Javascript proxy fatory - */ - void removeProxyFactory(JavascriptProxyFactory javascriptProxyfactory); - - /** - * Returns the Javascript proxy factory associated with the given QName - * @param bindingName - * @return - */ - JavascriptProxyFactory getProxyFactory(QName bindingName); - - /** - * Returns the Javascript proxy factory associated with the given Type - * @param bindingType - * @return - */ - JavascriptProxyFactory getProxyFactory(Class bindingType); -} diff --git a/branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/web/javascript/ComponentJavaScriptGenerator.java b/branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/web/javascript/ComponentJavaScriptGenerator.java new file mode 100644 index 0000000000..adfe449912 --- /dev/null +++ b/branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/web/javascript/ComponentJavaScriptGenerator.java @@ -0,0 +1,59 @@ +/* + * 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.web.javascript; + +import java.io.IOException; +import java.io.PrintWriter; + +import javax.xml.namespace.QName; + +import org.apache.tuscany.sca.runtime.RuntimeComponent; + + +/** + * Widget component script generator interface + * This generates the necessary JavaScript client code into a single JavaScript per component + * + * @version $Rev$ $Date$ + */ +public interface ComponentJavaScriptGenerator { + + /** + * Return the QName that identify the Component script generator + * This is used to identify different generators supporting different JavaScript frameworks + * + * @return The QName + */ + QName getQName(); + + /** + * Generate the Java Script code for a given component + * - generate/append client proxyies as needed + * - generate tuscany namespace as needed + * - generate properties for JavaScript injection + * - generate references for JavaScript injection + * + * @param component The SCA Component to be used + * @param pw A Print Writer where the script should be written to + * @throws IOException + */ + void generateJavaScriptCode(RuntimeComponent component, PrintWriter pw) throws IOException; + +} diff --git a/branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/web/javascript/ComponentJavaScriptGeneratorExtensionPoint.java b/branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/web/javascript/ComponentJavaScriptGeneratorExtensionPoint.java new file mode 100644 index 0000000000..ac160d7d1a --- /dev/null +++ b/branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/web/javascript/ComponentJavaScriptGeneratorExtensionPoint.java @@ -0,0 +1,56 @@ +/* + * 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.web.javascript; + +import java.util.List; + +import javax.xml.namespace.QName; + +/** + * Widget component script generator extension pointinterface + * + * @version $Rev$ $Date$ + */ +public interface ComponentJavaScriptGeneratorExtensionPoint { + + /** + * Add a component script generator + * @param componentScriptGenerator + */ + void addComponentJavaScriptGenerator(ComponentJavaScriptGenerator componentScriptGenerator); + + /** + * Remove a component script generator + * @param componentScriptGenerator + */ + void removeComponentJavaScriptGenerator(ComponentJavaScriptGenerator componentScriptGenerator); + + /** + * Get a component scrpt generator instance based on QName + * @param bindingName + * @return + */ + ComponentJavaScriptGenerator getComponentJavaScriptGenerator(QName bindingName); + + /** + * Get a list of component script generator instances + */ + List getComponentJavaScriptGenerators(); +} diff --git a/branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/web/javascript/DefaultComponentJavaScriptGeneratorExtensionPoint.java b/branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/web/javascript/DefaultComponentJavaScriptGeneratorExtensionPoint.java new file mode 100644 index 0000000000..043a46b951 --- /dev/null +++ b/branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/web/javascript/DefaultComponentJavaScriptGeneratorExtensionPoint.java @@ -0,0 +1,154 @@ +/* + * 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.web.javascript; + +import java.io.IOException; +import java.lang.reflect.Constructor; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import javax.xml.namespace.QName; + +import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl; +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.UtilityExtensionPoint; +import org.apache.tuscany.sca.extensibility.ServiceDeclaration; +import org.apache.tuscany.sca.extensibility.ServiceDiscovery; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.MonitorFactory; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.Problem.Severity; + + +/** + * Default extension point for widget component script generator + * + * @version $Rev$ $Date$ + */ +public class DefaultComponentJavaScriptGeneratorExtensionPoint implements ComponentJavaScriptGeneratorExtensionPoint { + private final List generators = new ArrayList(); + private final Map generatorsByQName = new HashMap(); + + private ExtensionPointRegistry extensionPoints; + private Monitor monitor = null; + + private boolean loaded = false; + + public DefaultComponentJavaScriptGeneratorExtensionPoint(ExtensionPointRegistry extensionPoints) { + this.extensionPoints = extensionPoints; + + UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class); + MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class); + if (monitorFactory != null) { + this.monitor = monitorFactory.createMonitor(); + } + } + + /** + * Report a exception. + * + * @param problems + * @param message + * @param model + */ + private void error(String message, Object model, Exception ex) { + if (monitor != null) { + Problem problem = new ProblemImpl(this.getClass().getName(), "web-javascript-validation-messages", Severity.ERROR, model, message, ex); + monitor.problem(problem); + } + } + + public void addComponentJavaScriptGenerator(ComponentJavaScriptGenerator componentScriptGenerator) { + if (componentScriptGenerator.getQName() != null) { + generatorsByQName.put(componentScriptGenerator.getQName(), componentScriptGenerator); + } + + generators.add(componentScriptGenerator); + } + + public void removeComponentJavaScriptGenerator(ComponentJavaScriptGenerator componentScriptGenerator) { + if (componentScriptGenerator.getQName() != null) { + generatorsByQName.remove(componentScriptGenerator.getQName()); + } + + generators.remove(componentScriptGenerator); + } + + + public ComponentJavaScriptGenerator getComponentJavaScriptGenerator(QName bindingName) { + loadFactories(); + return generatorsByQName.get(bindingName); + } + + public List getComponentJavaScriptGenerators() { + loadFactories(); + return this.generators; + } + + /** + * Private Utility methods + */ + + + /** + * Lazily load artifact processors registered in the extension point. + */ + @SuppressWarnings("unchecked") + private synchronized void loadFactories() { + if (loaded) { + return; + } + + // Get the proxy factories declarations + Set factoryDeclarations = null; + try { + factoryDeclarations = ServiceDiscovery.getInstance().getServiceDeclarations(ComponentJavaScriptGenerator.class); + } catch (IOException e) { + IllegalStateException ie = new IllegalStateException(e); + error("IllegalStateException", factoryDeclarations, ie); + throw ie; + } + + for (ServiceDeclaration processorDeclaration : factoryDeclarations) { + // Create a factory, and register it + ComponentJavaScriptGenerator generator = null; + try { + Class generatorClass = processorDeclaration.loadClass(); + + Constructor constructor = generatorClass.getConstructor(ExtensionPointRegistry.class); + generator = constructor.newInstance(extensionPoints); + + } catch (Exception e) { + IllegalStateException ie = new IllegalStateException(e); + error("IllegalStateException", generator, ie); + throw ie; + } + + addComponentJavaScriptGenerator(generator); + } + + loaded = true; + } + + +} diff --git a/branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/web/javascript/DefaultJavascriptProxyFactoryExtensionPoint.java b/branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/web/javascript/DefaultJavascriptProxyFactoryExtensionPoint.java new file mode 100644 index 0000000000..dc3de744ee --- /dev/null +++ b/branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/web/javascript/DefaultJavascriptProxyFactoryExtensionPoint.java @@ -0,0 +1,225 @@ +/* + * 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.web.javascript; + +import java.io.IOException; +import java.lang.reflect.Constructor; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +import javax.xml.namespace.QName; + +import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl; +import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.UtilityExtensionPoint; +import org.apache.tuscany.sca.extensibility.ServiceDeclaration; +import org.apache.tuscany.sca.extensibility.ServiceDiscovery; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.MonitorFactory; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.Problem.Severity; + +/** + * Default extension point for javascript proxy factories + * + * @version $Rev$ $Date$ + */ +public class DefaultJavascriptProxyFactoryExtensionPoint implements JavascriptProxyFactoryExtensionPoint { + private final Map factoriesByQName = new HashMap(); + private final Map, JavascriptProxyFactory> factoriesByType = new HashMap, JavascriptProxyFactory>(); + + private Monitor monitor = null; + + private boolean loaded = false; + + public DefaultJavascriptProxyFactoryExtensionPoint(ExtensionPointRegistry extensionPoints) { + UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class); + MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class); + if (monitorFactory != null) { + this.monitor = monitorFactory.createMonitor(); + } + } + + /** + * Report a exception. + * + * @param problems + * @param message + * @param model + */ + private void error(String message, Object model, Exception ex) { + if (monitor != null) { + Problem problem = new ProblemImpl(this.getClass().getName(), "web-javascript-validation-messages", Severity.ERROR, model, message, ex); + monitor.problem(problem); + } + } + + public void addProxyFactory(JavascriptProxyFactory javascriptProxyfactory) { + if (javascriptProxyfactory.getModelType() != null) { + factoriesByType.put(javascriptProxyfactory.getModelType(), javascriptProxyfactory); + } + if (javascriptProxyfactory.getQName() != null) { + factoriesByQName.put(javascriptProxyfactory.getQName(), javascriptProxyfactory); + } + } + + public void removeProxyFactory(JavascriptProxyFactory javascriptProxyfactory) { + if (javascriptProxyfactory.getModelType() != null) { + factoriesByType.remove(javascriptProxyfactory.getModelType()); + } + if (javascriptProxyfactory.getQName() != null) { + factoriesByQName.remove(javascriptProxyfactory.getQName()); + } + } + + public JavascriptProxyFactory getProxyFactory(QName bindingName) { + loadFactories(); + return factoriesByQName.get(bindingName); + } + + public JavascriptProxyFactory getProxyFactory(Class bindingType) { + loadFactories(); + Class[] classes = bindingType.getInterfaces(); + for (Class c : classes) { + JavascriptProxyFactory proxyFactory = factoriesByType.get(c); + if (proxyFactory != null) { + return proxyFactory; + } + } + + //here we didn't find the proxy factory for the biding + JavascriptProxyFactory factory = null; + if (bindingType.isInterface()) { + // Dynamically load a factory class declared under META-INF/services + try { + Class factoryClass = ServiceDiscovery.getInstance().loadFirstServiceClass(bindingType); + if (factoryClass != null) { + + try { + // Default empty constructor + Constructor constructor = factoryClass.getConstructor(); + factory = (JavascriptProxyFactory) constructor.newInstance(); + } catch (NoSuchMethodException e) { + + // Constructor taking the model factory extension point + Constructor constructor = factoryClass.getConstructor(ModelFactoryExtensionPoint.class); + factory = (JavascriptProxyFactory) constructor.newInstance(this); + } + + // Cache the loaded factory + addProxyFactory(factory); + } + } catch (Exception e) { + throw new IllegalArgumentException(e); + } + } else { + + // Call the newInstance static method on the factory abstract class + try { + factory = (JavascriptProxyFactory) ServiceDiscovery.getInstance().newFactoryClassInstance(bindingType); + } catch (Exception e) { + throw new IllegalArgumentException(e); + } + + // Cache the factory + addProxyFactory(factory); + } + + return factory; + } + + /** + * Private Utility methods + */ + + /** + * Returns a QName object from a QName expressed as {ns}name + * or ns#name. + * + * @param qname + * @return + */ + private static QName getQName(String qname) { + if (qname == null) { + return null; + } + qname = qname.trim(); + if (qname.startsWith("{")) { + int h = qname.indexOf('}'); + if (h != -1) { + return new QName(qname.substring(1, h), qname.substring(h + 1)); + } + } else { + int h = qname.indexOf('#'); + if (h != -1) { + return new QName(qname.substring(0, h), qname.substring(h + 1)); + } + } + throw new IllegalArgumentException("Invalid qname: "+qname); + } + + /** + * Lazily load artifact processors registered in the extension point. + */ + private synchronized void loadFactories() { + if (loaded) { + return; + } + + // Get the proxy factories declarations + Set factoryDeclarations = null; + try { + factoryDeclarations = ServiceDiscovery.getInstance().getServiceDeclarations(JavascriptProxyFactory.class); + } catch (IOException e) { + IllegalStateException ie = new IllegalStateException(e); + error("IllegalStateException", factoryDeclarations, ie); + throw ie; + } + + for (ServiceDeclaration processorDeclaration : factoryDeclarations) { + Map attributes = processorDeclaration.getAttributes(); + + // Load a StAX artifact processor + + // Get the model QName + QName artifactType = getQName(attributes.get("qname")); + + // Get the model class name + String modelTypeName = attributes.get("model"); + + // Create a factory, and register it + JavascriptProxyFactory proxyFactory = null; + try { + proxyFactory = (JavascriptProxyFactory) processorDeclaration.loadClass().newInstance(); + } catch (Exception e) { + IllegalStateException ie = new IllegalStateException(e); + error("IllegalStateException", proxyFactory, ie); + throw ie; + } + + addProxyFactory(proxyFactory); + } + + loaded = true; + } + +} diff --git a/branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/web/javascript/JavascriptProxyFactory.java b/branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/web/javascript/JavascriptProxyFactory.java new file mode 100644 index 0000000000..10455ef764 --- /dev/null +++ b/branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/web/javascript/JavascriptProxyFactory.java @@ -0,0 +1,69 @@ +/* + * 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.web.javascript; + +import java.io.IOException; +import java.io.InputStream; + +import javax.xml.namespace.QName; + +import org.apache.tuscany.sca.assembly.ComponentReference; + +/** + * Javascript Proxy Factory used to allow Web related bindings to generate + * client js proxyies + * + * @version $Rev$ $Date$ + */ +public interface JavascriptProxyFactory { + + /** + * The binding model type associated with this factory + * @return the binding model type + */ + Class getModelType(); + + /** + * The binding qname associated with this factory + * @return the binding qname + */ + QName getQName(); + + /** + * Get the Javascript proxy client file name + * @return the javascript file name + */ + String getJavascriptProxyFile(); + + /** + * Get the Javascript proxy client contents as a stream + * @return + */ + InputStream getJavascriptProxyFileAsStream() throws IOException; + + + /** + * Create a JavaScript Proxy for a given reference + * @param componentReference The reference + * @return the javascript proxy code + * @throws IOException + */ + String createJavascriptReference(ComponentReference componentReference) throws IOException; +} diff --git a/branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/web/javascript/JavascriptProxyFactoryExtensionPoint.java b/branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/web/javascript/JavascriptProxyFactoryExtensionPoint.java new file mode 100644 index 0000000000..bf0e6e0526 --- /dev/null +++ b/branches/sca-java-1.x/modules/web-javascript/src/main/java/org/apache/tuscany/sca/web/javascript/JavascriptProxyFactoryExtensionPoint.java @@ -0,0 +1,52 @@ +/* + * 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.web.javascript; + +import javax.xml.namespace.QName; + +public interface JavascriptProxyFactoryExtensionPoint { + /** + * Add Javascript proxy factory + * + * @param javascriptProxyfactory The Javascript proxy factory + */ + void addProxyFactory(JavascriptProxyFactory javascriptProxyfactory); + + /** + * Remove Javascript proxy factory + * + * @param javascriptProxyfactory The Javascript proxy fatory + */ + void removeProxyFactory(JavascriptProxyFactory javascriptProxyfactory); + + /** + * Returns the Javascript proxy factory associated with the given QName + * @param bindingName + * @return + */ + JavascriptProxyFactory getProxyFactory(QName bindingName); + + /** + * Returns the Javascript proxy factory associated with the given Type + * @param bindingType + * @return + */ + JavascriptProxyFactory getProxyFactory(Class bindingType); +} diff --git a/branches/sca-java-1.x/modules/web-javascript/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.web.ComponentJavaScriptGeneratorExtensionPoint b/branches/sca-java-1.x/modules/web-javascript/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.web.ComponentJavaScriptGeneratorExtensionPoint deleted file mode 100644 index cfe4491670..0000000000 --- a/branches/sca-java-1.x/modules/web-javascript/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.web.ComponentJavaScriptGeneratorExtensionPoint +++ /dev/null @@ -1,18 +0,0 @@ -# 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. - -org.apache.tuscany.sca.core.web.DefaultComponentJavaScriptGeneratorExtensionPoint diff --git a/branches/sca-java-1.x/modules/web-javascript/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.web.JavascriptProxyFactoryExtensionPoint b/branches/sca-java-1.x/modules/web-javascript/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.web.JavascriptProxyFactoryExtensionPoint deleted file mode 100644 index 81328476cc..0000000000 --- a/branches/sca-java-1.x/modules/web-javascript/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.web.JavascriptProxyFactoryExtensionPoint +++ /dev/null @@ -1,18 +0,0 @@ -# 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. - -org.apache.tuscany.sca.core.web.DefaultJavascriptProxyFactoryExtensionPoint diff --git a/branches/sca-java-1.x/modules/web-javascript/src/main/resources/META-INF/services/org.apache.tuscany.sca.web.javascript.ComponentJavaScriptGeneratorExtensionPoint b/branches/sca-java-1.x/modules/web-javascript/src/main/resources/META-INF/services/org.apache.tuscany.sca.web.javascript.ComponentJavaScriptGeneratorExtensionPoint new file mode 100644 index 0000000000..6a28e3481d --- /dev/null +++ b/branches/sca-java-1.x/modules/web-javascript/src/main/resources/META-INF/services/org.apache.tuscany.sca.web.javascript.ComponentJavaScriptGeneratorExtensionPoint @@ -0,0 +1,18 @@ +# 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. + +org.apache.tuscany.sca.web.javascript.DefaultComponentJavaScriptGeneratorExtensionPoint diff --git a/branches/sca-java-1.x/modules/web-javascript/src/main/resources/META-INF/services/org.apache.tuscany.sca.web.javascript.JavascriptProxyFactoryExtensionPoint b/branches/sca-java-1.x/modules/web-javascript/src/main/resources/META-INF/services/org.apache.tuscany.sca.web.javascript.JavascriptProxyFactoryExtensionPoint new file mode 100644 index 0000000000..95a7cecd2b --- /dev/null +++ b/branches/sca-java-1.x/modules/web-javascript/src/main/resources/META-INF/services/org.apache.tuscany.sca.web.javascript.JavascriptProxyFactoryExtensionPoint @@ -0,0 +1,18 @@ +# 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. + +org.apache.tuscany.sca.web.javascript.DefaultJavascriptProxyFactoryExtensionPoint diff --git a/branches/sca-java-1.x/modules/web-javascript/src/main/resources/core-web-validation-messages.properties b/branches/sca-java-1.x/modules/web-javascript/src/main/resources/core-web-validation-messages.properties deleted file mode 100644 index dbc7317653..0000000000 --- a/branches/sca-java-1.x/modules/web-javascript/src/main/resources/core-web-validation-messages.properties +++ /dev/null @@ -1,21 +0,0 @@ -# -# -# 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. -# -# -IllegalArgumentException = Invalid qname: {0} diff --git a/branches/sca-java-1.x/modules/web-javascript/src/main/resources/web-javascript-validation-messages.properties b/branches/sca-java-1.x/modules/web-javascript/src/main/resources/web-javascript-validation-messages.properties new file mode 100644 index 0000000000..dbc7317653 --- /dev/null +++ b/branches/sca-java-1.x/modules/web-javascript/src/main/resources/web-javascript-validation-messages.properties @@ -0,0 +1,21 @@ +# +# +# 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. +# +# +IllegalArgumentException = Invalid qname: {0} -- cgit v1.2.3