Author: [email protected]
Date: Tue Jan 24 10:22:59 2012
New Revision: 1980

Log:
AMDATU-527 Refactored to local and global applications with configuration

Added:
   trunk/amdatu-kitchensink/demo-tenant-global/
   trunk/amdatu-kitchensink/demo-tenant-global/LICENSE
      - copied, changed from r1978, 
/trunk/amdatu-kitchensink/demo-tenant/LICENSE
   trunk/amdatu-kitchensink/demo-tenant-global/NOTICE
      - copied, changed from r1978, /trunk/amdatu-kitchensink/demo-tenant/NOTICE
   trunk/amdatu-kitchensink/demo-tenant-global/pom.xml
      - copied, changed from r1978, 
/trunk/amdatu-kitchensink/demo-tenant/pom.xml
   trunk/amdatu-kitchensink/demo-tenant-global/src/
   trunk/amdatu-kitchensink/demo-tenant-global/src/main/
   trunk/amdatu-kitchensink/demo-tenant-global/src/main/java/
   trunk/amdatu-kitchensink/demo-tenant-global/src/main/java/org/
   trunk/amdatu-kitchensink/demo-tenant-global/src/main/java/org/amdatu/
   
trunk/amdatu-kitchensink/demo-tenant-global/src/main/java/org/amdatu/kitchensink/
   
trunk/amdatu-kitchensink/demo-tenant-global/src/main/java/org/amdatu/kitchensink/demo/
   
trunk/amdatu-kitchensink/demo-tenant-global/src/main/java/org/amdatu/kitchensink/demo/tenant/
   
trunk/amdatu-kitchensink/demo-tenant-global/src/main/java/org/amdatu/kitchensink/demo/tenant/global/
   
trunk/amdatu-kitchensink/demo-tenant-global/src/main/java/org/amdatu/kitchensink/demo/tenant/global/GlobalApplication.java
   
trunk/amdatu-kitchensink/demo-tenant-global/src/main/java/org/amdatu/kitchensink/demo/tenant/global/impl/
   
trunk/amdatu-kitchensink/demo-tenant-global/src/main/java/org/amdatu/kitchensink/demo/tenant/global/impl/Activator.java
   
trunk/amdatu-kitchensink/demo-tenant-global/src/main/java/org/amdatu/kitchensink/demo/tenant/global/impl/GlobalApplicationImpl.java
   trunk/amdatu-kitchensink/demo-tenant-global/src/main/resources/
   trunk/amdatu-kitchensink/demo-tenant-global/src/main/resources/OSGI-INF/
   
trunk/amdatu-kitchensink/demo-tenant-global/src/main/resources/OSGI-INF/metatype/
   
trunk/amdatu-kitchensink/demo-tenant-global/src/main/resources/OSGI-INF/metatype/metatype.xml
   trunk/amdatu-kitchensink/demo-tenant-local/
   trunk/amdatu-kitchensink/demo-tenant-local/LICENSE
      - copied, changed from r1978, 
/trunk/amdatu-kitchensink/demo-tenant/LICENSE
   trunk/amdatu-kitchensink/demo-tenant-local/NOTICE
      - copied, changed from r1978, /trunk/amdatu-kitchensink/demo-tenant/NOTICE
   trunk/amdatu-kitchensink/demo-tenant-local/pom.xml
      - copied, changed from r1978, 
/trunk/amdatu-kitchensink/demo-tenant/pom.xml
   trunk/amdatu-kitchensink/demo-tenant-local/src/
   trunk/amdatu-kitchensink/demo-tenant-local/src/main/
   trunk/amdatu-kitchensink/demo-tenant-local/src/main/java/
   trunk/amdatu-kitchensink/demo-tenant-local/src/main/java/org/
   trunk/amdatu-kitchensink/demo-tenant-local/src/main/java/org/amdatu/
   
trunk/amdatu-kitchensink/demo-tenant-local/src/main/java/org/amdatu/kitchensink/
   
trunk/amdatu-kitchensink/demo-tenant-local/src/main/java/org/amdatu/kitchensink/demo/
   
trunk/amdatu-kitchensink/demo-tenant-local/src/main/java/org/amdatu/kitchensink/demo/tenant/
   
trunk/amdatu-kitchensink/demo-tenant-local/src/main/java/org/amdatu/kitchensink/demo/tenant/local/
   
trunk/amdatu-kitchensink/demo-tenant-local/src/main/java/org/amdatu/kitchensink/demo/tenant/local/LocalApplication.java
   
trunk/amdatu-kitchensink/demo-tenant-local/src/main/java/org/amdatu/kitchensink/demo/tenant/local/impl/
   
trunk/amdatu-kitchensink/demo-tenant-local/src/main/java/org/amdatu/kitchensink/demo/tenant/local/impl/Activator.java
   
trunk/amdatu-kitchensink/demo-tenant-local/src/main/java/org/amdatu/kitchensink/demo/tenant/local/impl/LocalApplicationImpl.java
   trunk/amdatu-kitchensink/demo-tenant-local/src/main/resources/
   trunk/amdatu-kitchensink/demo-tenant-local/src/main/resources/OSGI-INF/
   
trunk/amdatu-kitchensink/demo-tenant-local/src/main/resources/OSGI-INF/metatype/
   
trunk/amdatu-kitchensink/demo-tenant-local/src/main/resources/OSGI-INF/metatype/metatype.xml
   
trunk/amdatu-kitchensink/release-server/src/main/resources/tenants/demo-global.xml.xml
      - copied, changed from r1978, 
/trunk/amdatu-kitchensink/release-server/src/main/resources/tenants/tenant-tenant1-demo.xml
Modified:
   trunk/amdatu-kitchensink/demo-tenant/
   trunk/amdatu-kitchensink/pom.xml
   trunk/amdatu-kitchensink/release-server/pom.xml
   
trunk/amdatu-kitchensink/release-server/src/main/resources/tenants/tenant-tenant1-demo.xml
   
trunk/amdatu-kitchensink/release-server/src/main/resources/tenants/tenant-tenant2-demo.xml

Copied: trunk/amdatu-kitchensink/demo-tenant-global/LICENSE (from r1978, 
/trunk/amdatu-kitchensink/demo-tenant/LICENSE)
==============================================================================

Copied: trunk/amdatu-kitchensink/demo-tenant-global/NOTICE (from r1978, 
/trunk/amdatu-kitchensink/demo-tenant/NOTICE)
==============================================================================

Copied: trunk/amdatu-kitchensink/demo-tenant-global/pom.xml (from r1978, 
/trunk/amdatu-kitchensink/demo-tenant/pom.xml)
==============================================================================
--- /trunk/amdatu-kitchensink/demo-tenant/pom.xml       (original)
+++ trunk/amdatu-kitchensink/demo-tenant-global/pom.xml Tue Jan 24 10:22:59 2012
@@ -23,20 +23,10 @@
     <artifactId>org.amdatu.kitchensink</artifactId>
     <version>0.3.0-SNAPSHOT</version>
   </parent>
-  <artifactId>org.amdatu.kitchensink.demo.tenant</artifactId>
+  <artifactId>org.amdatu.kitchensink.demo.tenant.global</artifactId>
   <packaging>bundle</packaging>
-  <name>Amdatu Kitchensink - Multi-Tenant demo</name>
-  <description>This bundle provides a kitchensink demo for 
multi-tenancy</description>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.amdatu.core</groupId>
-      <artifactId>org.amdatu.core.tenant</artifactId>
-      <version>${project.version}</version>
-      <scope>provided</scope>
-      <type>bundle</type>
-    </dependency>
-  </dependencies>
+  <name>Amdatu Kitchensink - Multi-Tenant Demo Global</name>
+  <description>This bundle demonstrates the use of a global 
service</description>
 
   <build>
     <plugins>
@@ -45,9 +35,10 @@
         <artifactId>maven-bundle-plugin</artifactId>
         <configuration>
           <instructions>
-            
<Bundle-Activator>org.amdatu.kitchensink.demo.tenant.Activator</Bundle-Activator>
+            
<Bundle-Activator>org.amdatu.kitchensink.demo.tenant.global.impl.Activator</Bundle-Activator>
             <Embed-Dependency>*;scope=compile;inline=true</Embed-Dependency>
             <Export-Package/>
+               org.amdatu.kitchensink.demo.tenant.global;version=1.0.0
             <Import-Package>
               *
             </Import-Package>

Added: 
trunk/amdatu-kitchensink/demo-tenant-global/src/main/java/org/amdatu/kitchensink/demo/tenant/global/GlobalApplication.java
==============================================================================
--- (empty file)
+++ 
trunk/amdatu-kitchensink/demo-tenant-global/src/main/java/org/amdatu/kitchensink/demo/tenant/global/GlobalApplication.java
  Tue Jan 24 10:22:59 2012
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2010, 2011 The Amdatu Foundation
+ * 
+ * Licensed 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.amdatu.kitchensink.demo.tenant.global;
+
+/**
+ * @author <a href="mailto:[email protected]";>Amdatu Project 
Team</a>
+ */
+public interface GlobalApplication {
+
+       String helloWorld();
+}

Added: 
trunk/amdatu-kitchensink/demo-tenant-global/src/main/java/org/amdatu/kitchensink/demo/tenant/global/impl/Activator.java
==============================================================================
--- (empty file)
+++ 
trunk/amdatu-kitchensink/demo-tenant-global/src/main/java/org/amdatu/kitchensink/demo/tenant/global/impl/Activator.java
     Tue Jan 24 10:22:59 2012
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2010, 2011 The Amdatu Foundation
+ * 
+ * Licensed 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.amdatu.kitchensink.demo.tenant.global.impl;
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+import org.amdatu.kitchensink.demo.tenant.global.GlobalApplication;
+import org.apache.felix.dm.DependencyActivatorBase;
+import org.apache.felix.dm.DependencyManager;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.service.cm.ManagedService;
+
+/**
+ * @author <a href="mailto:[email protected]";>Amdatu Project 
Team</a>
+ */
+public class Activator extends DependencyActivatorBase {
+
+    @Override
+    public void init(BundleContext context, DependencyManager manager)
+        throws Exception {
+
+        Dictionary<String, String> props = new Hashtable<String, String>();
+        props.put(Constants.SERVICE_PID, GlobalApplicationImpl.CONFIG_PID);
+        manager.add(manager.createComponent()
+            .setInterface(new String[] { GlobalApplication.class.getName(), 
ManagedService.class.getName() }, props)
+            .setImplementation(GlobalApplicationImpl.class));
+    }
+
+    @Override
+    public void destroy(BundleContext context, DependencyManager manager)
+        throws Exception {
+
+    }
+
+}

Added: 
trunk/amdatu-kitchensink/demo-tenant-global/src/main/java/org/amdatu/kitchensink/demo/tenant/global/impl/GlobalApplicationImpl.java
==============================================================================
--- (empty file)
+++ 
trunk/amdatu-kitchensink/demo-tenant-global/src/main/java/org/amdatu/kitchensink/demo/tenant/global/impl/GlobalApplicationImpl.java
 Tue Jan 24 10:22:59 2012
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2010, 2011 The Amdatu Foundation
+ * 
+ * Licensed 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.amdatu.kitchensink.demo.tenant.global.impl;
+
+import java.util.Dictionary;
+
+import org.amdatu.kitchensink.demo.tenant.global.GlobalApplication;
+import org.apache.felix.dm.Component;
+import org.osgi.service.cm.ConfigurationException;
+import org.osgi.service.cm.ManagedService;
+
+/**
+ * @author <a href="mailto:[email protected]";>Amdatu Project 
Team</a>
+ */
+public class GlobalApplicationImpl implements ManagedService, 
GlobalApplication {
+
+    public final static String CONFIG_PID = 
"org.amdatu.kitchensink.demo.tenant.global";
+    public final static String CONFIG_MSG_KEY = "demo.tenant.msg";
+
+    private volatile Component m_component;
+
+    private String m_helloWorldMessage = "Default message";
+
+    public void init() {
+        setMessageProperty(m_helloWorldMessage);
+    }
+
+    public String helloWorld() {
+        return m_helloWorldMessage;
+    }
+
+    public void updated(Dictionary properties) throws ConfigurationException {
+        if (properties == null)
+            return;
+        Object msg = properties.get(CONFIG_MSG_KEY);
+        if (msg == null)
+            throw new ConfigurationException(CONFIG_MSG_KEY,
+                "Configuration value is missing");
+        if (!(msg instanceof String))
+            throw new ConfigurationException(CONFIG_MSG_KEY,
+                "Confgiration Value must be String");
+        m_helloWorldMessage = (String) msg;
+        setMessageProperty(m_helloWorldMessage);
+    }
+
+    private void setMessageProperty(String msg) {
+        Dictionary props = m_component.getServiceProperties();
+        props.put(CONFIG_MSG_KEY, m_helloWorldMessage);
+        m_component.setServiceProperties(props);
+    }
+}

Added: 
trunk/amdatu-kitchensink/demo-tenant-global/src/main/resources/OSGI-INF/metatype/metatype.xml
==============================================================================
--- (empty file)
+++ 
trunk/amdatu-kitchensink/demo-tenant-global/src/main/resources/OSGI-INF/metatype/metatype.xml
       Tue Jan 24 10:22:59 2012
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<MetaData xmlns="http://www.osgi.org/xmlns/metatype/v1.0.0";>
+  <OCD name="Amdatu Kitchensink Tenant Demo Global Configuration" 
id="org.amdatu.kitchensink.demo.tenant.global">
+    <AD id="demo.tenant.msg" type="STRING" cardinality="0" />
+  </OCD>
+  <Designate pid="org.amdatu.kitchensink.demo.tenant.global">
+    <Object ocdref="org.amdatu.kitchensink.demo.tenant.global" />
+  </Designate>
+</MetaData>
\ No newline at end of file

Copied: trunk/amdatu-kitchensink/demo-tenant-local/LICENSE (from r1978, 
/trunk/amdatu-kitchensink/demo-tenant/LICENSE)
==============================================================================

Copied: trunk/amdatu-kitchensink/demo-tenant-local/NOTICE (from r1978, 
/trunk/amdatu-kitchensink/demo-tenant/NOTICE)
==============================================================================

Copied: trunk/amdatu-kitchensink/demo-tenant-local/pom.xml (from r1978, 
/trunk/amdatu-kitchensink/demo-tenant/pom.xml)
==============================================================================
--- /trunk/amdatu-kitchensink/demo-tenant/pom.xml       (original)
+++ trunk/amdatu-kitchensink/demo-tenant-local/pom.xml  Tue Jan 24 10:22:59 2012
@@ -23,20 +23,10 @@
     <artifactId>org.amdatu.kitchensink</artifactId>
     <version>0.3.0-SNAPSHOT</version>
   </parent>
-  <artifactId>org.amdatu.kitchensink.demo.tenant</artifactId>
+  <artifactId>org.amdatu.kitchensink.demo.tenant.local</artifactId>
   <packaging>bundle</packaging>
-  <name>Amdatu Kitchensink - Multi-Tenant demo</name>
-  <description>This bundle provides a kitchensink demo for 
multi-tenancy</description>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.amdatu.core</groupId>
-      <artifactId>org.amdatu.core.tenant</artifactId>
-      <version>${project.version}</version>
-      <scope>provided</scope>
-      <type>bundle</type>
-    </dependency>
-  </dependencies>
+  <name>Amdatu Kitchensink - Multi-Tenant Demo Local</name>
+  <description>This bundle demonstrates the use of an adaptor to create tenant 
specific services</description>
 
   <build>
     <plugins>
@@ -45,9 +35,12 @@
         <artifactId>maven-bundle-plugin</artifactId>
         <configuration>
           <instructions>
-            
<Bundle-Activator>org.amdatu.kitchensink.demo.tenant.Activator</Bundle-Activator>
+            
<MultiTenant-Bundle-Activator>org.amdatu.kitchensink.demo.tenant.local.impl.Activator</MultiTenant-Bundle-Activator>
+            <MultiTenant-Scope>TENANT</MultiTenant-Scope>
+            
<Bundle-Activator>org.amdatu.core.tenant.adaptor.MultiTenantBundleActivator</Bundle-Activator>
             <Embed-Dependency>*;scope=compile;inline=true</Embed-Dependency>
             <Export-Package/>
+               org.amdatu.kitchensink.demo.tenant.local;version=1.0.0
             <Import-Package>
               *
             </Import-Package>

Added: 
trunk/amdatu-kitchensink/demo-tenant-local/src/main/java/org/amdatu/kitchensink/demo/tenant/local/LocalApplication.java
==============================================================================
--- (empty file)
+++ 
trunk/amdatu-kitchensink/demo-tenant-local/src/main/java/org/amdatu/kitchensink/demo/tenant/local/LocalApplication.java
     Tue Jan 24 10:22:59 2012
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2010, 2011 The Amdatu Foundation
+ * 
+ * Licensed 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.amdatu.kitchensink.demo.tenant.local;
+
+/**
+ * @author <a href="mailto:[email protected]";>Amdatu Project 
Team</a>
+ */
+public interface LocalApplication {
+
+       String helloWorld();
+}

Added: 
trunk/amdatu-kitchensink/demo-tenant-local/src/main/java/org/amdatu/kitchensink/demo/tenant/local/impl/Activator.java
==============================================================================
--- (empty file)
+++ 
trunk/amdatu-kitchensink/demo-tenant-local/src/main/java/org/amdatu/kitchensink/demo/tenant/local/impl/Activator.java
       Tue Jan 24 10:22:59 2012
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2010, 2011 The Amdatu Foundation
+ * 
+ * Licensed 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.amdatu.kitchensink.demo.tenant.local.impl;
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+import org.amdatu.kitchensink.demo.tenant.local.LocalApplication;
+import org.apache.felix.dm.DependencyActivatorBase;
+import org.apache.felix.dm.DependencyManager;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.service.cm.ManagedService;
+
+/**
+ * @author <a href="mailto:[email protected]";>Amdatu Project 
Team</a>
+ */
+public class Activator extends DependencyActivatorBase {
+
+    @Override
+    public void init(BundleContext context, DependencyManager manager)
+        throws Exception {
+
+        Dictionary<String, String> props = new Hashtable<String, String>();
+        props.put(Constants.SERVICE_PID, LocalApplicationImpl.CONFIG_PID);
+        manager.add(manager.createComponent()
+            .setInterface(new String[] { LocalApplication.class.getName(), 
ManagedService.class.getName() }, props)
+            .setImplementation(LocalApplicationImpl.class));
+    }
+
+    @Override
+    public void destroy(BundleContext context, DependencyManager manager)
+        throws Exception {
+
+    }
+
+}

Added: 
trunk/amdatu-kitchensink/demo-tenant-local/src/main/java/org/amdatu/kitchensink/demo/tenant/local/impl/LocalApplicationImpl.java
==============================================================================
--- (empty file)
+++ 
trunk/amdatu-kitchensink/demo-tenant-local/src/main/java/org/amdatu/kitchensink/demo/tenant/local/impl/LocalApplicationImpl.java
    Tue Jan 24 10:22:59 2012
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2010, 2011 The Amdatu Foundation
+ * 
+ * Licensed 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.amdatu.kitchensink.demo.tenant.local.impl;
+
+import java.util.Dictionary;
+
+import org.amdatu.kitchensink.demo.tenant.local.LocalApplication;
+import org.apache.felix.dm.Component;
+import org.osgi.service.cm.ConfigurationException;
+import org.osgi.service.cm.ManagedService;
+
+/**
+ * @author <a href="mailto:[email protected]";>Amdatu Project 
Team</a>
+ */
+public class LocalApplicationImpl implements ManagedService, LocalApplication {
+
+    public final static String CONFIG_PID = 
"org.amdatu.kitchensink.demo.tenant.local";
+    public final static String CONFIG_MSG_KEY = "demo.tenant.msg";
+
+    private volatile Component m_component;
+
+    private String m_helloWorldMessage = "Default message";
+
+    public void init() {
+        setMessageProperty(m_helloWorldMessage);
+    }
+
+    public String helloWorld() {
+        return m_helloWorldMessage;
+    }
+
+    public void updated(Dictionary properties) throws ConfigurationException {
+        if (properties == null)
+            return;
+        Object msg = properties.get(CONFIG_MSG_KEY);
+        if (msg == null)
+            throw new ConfigurationException(CONFIG_MSG_KEY,
+                "Configuration value is missing");
+        if (!(msg instanceof String))
+            throw new ConfigurationException(CONFIG_MSG_KEY,
+                "Confgiration Value must be String");
+        m_helloWorldMessage = (String) msg;
+        setMessageProperty(m_helloWorldMessage);
+    }
+
+    private void setMessageProperty(String msg) {
+        Dictionary props = m_component.getServiceProperties();
+        props.put(CONFIG_MSG_KEY, m_helloWorldMessage);
+        m_component.setServiceProperties(props);
+    }
+}

Added: 
trunk/amdatu-kitchensink/demo-tenant-local/src/main/resources/OSGI-INF/metatype/metatype.xml
==============================================================================
--- (empty file)
+++ 
trunk/amdatu-kitchensink/demo-tenant-local/src/main/resources/OSGI-INF/metatype/metatype.xml
        Tue Jan 24 10:22:59 2012
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<MetaData xmlns="http://www.osgi.org/xmlns/metatype/v1.0.0";>
+  <OCD name="Amdatu Kitchensink Tenant Demo Scoped Configuration" 
id="org.amdatu.kitchensink.demo.tenant.local">
+    <AD id="demo.tenant.msg" type="STRING" cardinality="0" />
+  </OCD>
+  <Designate pid="org.amdatu.kitchensink.demo.tenant.local">
+    <Object ocdref="org.amdatu.kitchensink.demo.tenant.local" />
+  </Designate>
+</MetaData>
\ No newline at end of file

Modified: trunk/amdatu-kitchensink/pom.xml
==============================================================================
--- trunk/amdatu-kitchensink/pom.xml    (original)
+++ trunk/amdatu-kitchensink/pom.xml    Tue Jan 24 10:22:59 2012
@@ -67,6 +67,7 @@
 
   <modules>
     <module>release-server</module>
-    <module>demo-tenant</module>
+    <module>demo-tenant-local</module>
+    <module>demo-tenant-global</module>
   </modules>
 </project>

Modified: trunk/amdatu-kitchensink/release-server/pom.xml
==============================================================================
--- trunk/amdatu-kitchensink/release-server/pom.xml     (original)
+++ trunk/amdatu-kitchensink/release-server/pom.xml     Tue Jan 24 10:22:59 2012
@@ -187,7 +187,13 @@
 
     <dependency>
       <groupId>org.amdatu.kitchensink</groupId>
-      <artifactId>org.amdatu.kitchensink.demo.tenant</artifactId>
+      <artifactId>org.amdatu.kitchensink.demo.tenant.local</artifactId>
+      <version>${project.version}</version>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.amdatu.kitchensink</groupId>
+      <artifactId>org.amdatu.kitchensink.demo.tenant.global</artifactId>
       <version>${project.version}</version>
       <scope>compile</scope>
     </dependency>

Copied: 
trunk/amdatu-kitchensink/release-server/src/main/resources/tenants/demo-global.xml.xml
 (from r1978, 
/trunk/amdatu-kitchensink/release-server/src/main/resources/tenants/tenant-tenant1-demo.xml)
==============================================================================
--- 
/trunk/amdatu-kitchensink/release-server/src/main/resources/tenants/tenant-tenant1-demo.xml
 (original)
+++ 
trunk/amdatu-kitchensink/release-server/src/main/resources/tenants/demo-global.xml.xml
      Tue Jan 24 10:22:59 2012
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <MetaData xmlns:metatype="http://www.osgi.org/xmlns/metatype/v1.0.0";>
-  <Designate pid="org.amdatu.kitchensink.demo.tenant">
-    <Object ocdref="org.amdatu.kitchensink.demo.tenant">
+  <Designate pid="org.amdatu.kitchensink.demo.tenant.global">
+    <Object ocdref="org.amdatu.kitchensink.demo.tenant.global">
       <Attribute adref="demo.tenant.msg">
-        <Value>Hello! I am Tenant 1</Value>
+        <Value>Hello! I am global!</Value>
       </Attribute>
     </Object>
   </Designate>

Modified: 
trunk/amdatu-kitchensink/release-server/src/main/resources/tenants/tenant-tenant1-demo.xml
==============================================================================
--- 
trunk/amdatu-kitchensink/release-server/src/main/resources/tenants/tenant-tenant1-demo.xml
  (original)
+++ 
trunk/amdatu-kitchensink/release-server/src/main/resources/tenants/tenant-tenant1-demo.xml
  Tue Jan 24 10:22:59 2012
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <MetaData xmlns:metatype="http://www.osgi.org/xmlns/metatype/v1.0.0";>
-  <Designate pid="org.amdatu.kitchensink.demo.tenant">
-    <Object ocdref="org.amdatu.kitchensink.demo.tenant">
+  <Designate pid="org.amdatu.kitchensink.demo.tenant.local">
+    <Object ocdref="org.amdatu.kitchensink.demo.tenant.local">
       <Attribute adref="demo.tenant.msg">
         <Value>Hello! I am Tenant 1</Value>
       </Attribute>

Modified: 
trunk/amdatu-kitchensink/release-server/src/main/resources/tenants/tenant-tenant2-demo.xml
==============================================================================
--- 
trunk/amdatu-kitchensink/release-server/src/main/resources/tenants/tenant-tenant2-demo.xml
  (original)
+++ 
trunk/amdatu-kitchensink/release-server/src/main/resources/tenants/tenant-tenant2-demo.xml
  Tue Jan 24 10:22:59 2012
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <MetaData xmlns:metatype="http://www.osgi.org/xmlns/metatype/v1.0.0";>
-  <Designate pid="org.amdatu.kitchensink.demo.tenant">
-    <Object ocdref="org.amdatu.kitchensink.demo.tenant">
+  <Designate pid="org.amdatu.kitchensink.demo.tenant.local">
+    <Object ocdref="org.amdatu.kitchensink.demo.tenant.local">
       <Attribute adref="demo.tenant.msg">
-        <Value>Salut mes amis! Moi, je m'appele Tenant 2</Value>
+        <Value>Salut! Je m'appele Tenant 2</Value>
       </Attribute>
     </Object>
   </Designate>
_______________________________________________
Amdatu-commits mailing list
[email protected]
http://lists.amdatu.org/mailman/listinfo/amdatu-commits

Reply via email to