Repository: stratos
Updated Branches:
  refs/heads/master e16acd17e -> 5a3e530a5


Adding mock iaas api meta-inf & web-inf files


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/5a3e530a
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/5a3e530a
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/5a3e530a

Branch: refs/heads/master
Commit: 5a3e530a5072db7be4e4b10b229573c541f5de99
Parents: e16acd1
Author: Imesh Gunaratne <[email protected]>
Authored: Tue Jan 27 17:54:50 2015 +0530
Committer: Imesh Gunaratne <[email protected]>
Committed: Tue Jan 27 17:54:50 2015 +0530

----------------------------------------------------------------------
 .../META-INF/webapp-classloading.xml            | 35 ++++++++++++
 .../mock-iaas-api/WEB-INF/cxf-servlet.xml       | 60 ++++++++++++++++++++
 .../main/webapp/mock-iaas-api/WEB-INF/web.xml   | 39 +++++++++++++
 3 files changed, 134 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/5a3e530a/components/org.apache.stratos.mock.iaas.api/src/main/webapp/mock-iaas-api/META-INF/webapp-classloading.xml
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.mock.iaas.api/src/main/webapp/mock-iaas-api/META-INF/webapp-classloading.xml
 
b/components/org.apache.stratos.mock.iaas.api/src/main/webapp/mock-iaas-api/META-INF/webapp-classloading.xml
new file mode 100644
index 0000000..c62912d
--- /dev/null
+++ 
b/components/org.apache.stratos.mock.iaas.api/src/main/webapp/mock-iaas-api/META-INF/webapp-classloading.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  #  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.
+  -->
+
+<!--
+    This file defines class loading policy of the whole container. But this 
behaviour can be overridden by individual webapps by putting this file into the 
META-INF/ directory.
+-->
+<Classloading xmlns="http://wso2.org/projects/as/classloading";>
+
+    <!-- Parent-first or child-first. Default behaviour is child-first.-->
+    <ParentFirst>false</ParentFirst>
+
+    <!--
+       Default environments that contains provides to all the webapps. This 
can be overridden by individual webapps by specifing required environments
+       Tomcat environment is the default and every webapps gets it even if 
they didn't specify it.
+       e.g. If a webapps requires CXF, they will get both Tomcat and CXF.
+     -->
+    <Environments>CXF,Carbon</Environments>
+</Classloading>

http://git-wip-us.apache.org/repos/asf/stratos/blob/5a3e530a/components/org.apache.stratos.mock.iaas.api/src/main/webapp/mock-iaas-api/WEB-INF/cxf-servlet.xml
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.mock.iaas.api/src/main/webapp/mock-iaas-api/WEB-INF/cxf-servlet.xml
 
b/components/org.apache.stratos.mock.iaas.api/src/main/webapp/mock-iaas-api/WEB-INF/cxf-servlet.xml
new file mode 100644
index 0000000..3e32698
--- /dev/null
+++ 
b/components/org.apache.stratos.mock.iaas.api/src/main/webapp/mock-iaas-api/WEB-INF/cxf-servlet.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  #  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.
+  -->
+
+<beans xmlns="http://www.springframework.org/schema/beans";
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+       xmlns:jaxrs="http://cxf.apache.org/jaxrs";
+       xmlns:util="http://www.springframework.org/schema/util";
+       xsi:schemaLocation="
+         http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+         http://www.springframework.org/schema/util 
http://www.springframework.org/schema/util/spring-util-3.0.xsd
+         http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd";>
+
+    <jaxrs:server id="mockIaasApi" address="/">
+        <jaxrs:serviceBeans>
+            <ref bean="mockIaasApiBean"/>
+        </jaxrs:serviceBeans>
+
+        <jaxrs:providers>
+            <ref bean="throwableExceptionHandler"/>
+            <ref bean="genericExceptionHandler"/>
+            <ref bean="badRequestExceptionHandler"/>
+            <ref bean="jsonProvider"/>
+            <ref bean="exceptionHandler"/>
+        </jaxrs:providers>
+    </jaxrs:server>
+
+    <bean id="mockIaasApiBean" 
class="org.apache.stratos.mock.iaas.api.MockIaasApi"/>
+    <bean id="exceptionHandler" 
class="org.apache.stratos.mock.iaas.api.handlers.CustomExceptionMapper"/>
+    <bean id="badRequestExceptionHandler" 
class="org.apache.stratos.mock.iaas.api.handlers.BadRequestExceptionMapper"/>
+    <bean id="genericExceptionHandler" 
class="org.apache.stratos.mock.iaas.api.handlers.GenericExceptionMapper"/>
+    <bean id="throwableExceptionHandler" 
class="org.apache.stratos.mock.iaas.api.handlers.CustomThrowableExceptionMapper"/>
+
+    <bean id="jsonProvider" 
class="org.apache.cxf.jaxrs.provider.json.JSONProvider">
+        <property name="supportUnwrapped" value="true"/>
+        <property name="serializeAsArray" value="true"/>
+        <property name="dropRootElement" value="true" />
+        <property name="dropCollectionWrapperElement" value="true"/>
+        <property name="arrayKeys">
+            <list>
+            </list>
+        </property>
+    </bean>
+</beans>

http://git-wip-us.apache.org/repos/asf/stratos/blob/5a3e530a/components/org.apache.stratos.mock.iaas.api/src/main/webapp/mock-iaas-api/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.mock.iaas.api/src/main/webapp/mock-iaas-api/WEB-INF/web.xml
 
b/components/org.apache.stratos.mock.iaas.api/src/main/webapp/mock-iaas-api/WEB-INF/web.xml
new file mode 100644
index 0000000..c9720c1
--- /dev/null
+++ 
b/components/org.apache.stratos.mock.iaas.api/src/main/webapp/mock-iaas-api/WEB-INF/web.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+
+<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee";
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+         http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd";>
+
+    <display-name>Stratos Mock IaaS API</display-name>
+
+    <servlet>
+        <servlet-name>MockIaasApi</servlet-name>
+        
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>MockIaasApi</servlet-name>
+        <url-pattern>/*</url-pattern>
+    </servlet-mapping>
+</web-app>
+

Reply via email to